OSDN Git Service

Allow unordered loads to be considered invariant in CodeGen
authorPhilip Reames <listmail@philipreames.com>
Tue, 19 Mar 2019 18:27:18 +0000 (18:27 +0000)
committerPhilip Reames <listmail@philipreames.com>
Tue, 19 Mar 2019 18:27:18 +0000 (18:27 +0000)
commitc2065f2c0ba9be0704c14292d297427dede8b272
tree7f2adc0b5e5c2b70c912df503fd6db59676c154b
parent7feeb42225d81e36e20777057175eae7922dd6b3
Allow unordered loads to be considered invariant in CodeGen

The actual code change is fairly straight forward, but exercising it isn't. First, it turned out we weren't adding the appropriate flags in SelectionDAG. Second, it turned out that we've got some optimization gaps, so obvious test cases don't work.

My first attempt (in atomic-unordered.ll) points out a deficiency in our peephole-opt folding logic which I plan to fix separately. Instead, I'm exercising this through MachineLICM.

Differential Revision: https://reviews.llvm.org/D59375

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356494 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineInstr.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/X86/atomic-unordered.ll
test/CodeGen/X86/hoist-invariant-load.ll