U.S. stocks rose on Friday with the S&P 500 building on its rally to records, as investors bet that higher inflation will be temporary as the economy continues to recover from the pandemic.