[SelectionDAGBuilder] Add masked loads to PendingLoads rather than calling DAG.setRoot.
authorCraig Topper <craig.topper@intel.com>
Thu, 26 Jul 2018 23:22:11 +0000 (23:22 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 26 Jul 2018 23:22:11 +0000 (23:22 +0000)
commit1a40a065499deab5b5bd2bdc9d4ca471dd1f85f0
tree5745decb5072017c2b0669434ee74d63df14fcc4
parent4d23f45a11325dfc03a9904cfc1e354c54f06081
[SelectionDAGBuilder] Add masked loads to PendingLoads rather than calling DAG.setRoot.

Masked loads are calling DAG.getRoot rather than calling SelectionDAGBuilder::getRoot, which means the PendingLoads weren't emptied to update the root and create any needed TokenFactor. So it would be incorrect to call setRoot for the masked load.

This patch instead adds the masked load to PendingLoads so that the root doesn't get update until a store or scatter or something happens.. Alternatively, we could call SelectionDAGBuilder::getRoot before it, but that would create unnecessary serialization.

llvm-svn: 338085
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/X86/avx512-bugfix-26264.ll
llvm/test/CodeGen/X86/avx512-masked-memop-64-32.ll
llvm/test/CodeGen/X86/masked_memop.ll