On power 8 we sometimes insert swaps to deal with the difference between Little Endian and Big Endian. The swap removal pass is supposed to clean up these swaps. On power 9 we don't need this pass since we do not need to insert the swaps in the first place.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM.
lib/Target/PowerPC/PPCTargetMachine.cpp | ||
---|---|---|
369 ↗ | (On Diff #103964) | Please add a comment such as // Power ISA 3.0 has load/store instructions that preserve // element order so swaps aren't introduced. The pass to remove // them is thereby not necessary. |
lib/Target/PowerPC/PPCTargetMachine.cpp | ||
---|---|---|
371 ↗ | (On Diff #103964) | I feel it is better to use Subtarget.needsSwapsForVSXMemOps() to make the meaning of the check clearer. |
lib/Target/PowerPC/PPCTargetMachine.cpp | ||
---|---|---|
371 ↗ | (On Diff #103964) | This is actually a really good point. I forgot that we added that function. Please use that instead. |
lib/Target/PowerPC/PPCTargetMachine.cpp | ||
---|---|---|
371 ↗ | (On Diff #103964) | I agree with Hiroshi, this is a good way to increase code readability. |
Comment Actions
Sorry... We can't do what I wanted to do in the first place because I don't have access to the PPCSubtarget object in the PPCTargetMachine code.
I've moved the guard into the PPCVSXSwapRemoval code.
Comment Actions
This is how you should do it. Though I'm not sure it isn't just better to check for "processor >= power9", but *shrug* for now.
I've also marked getSubtargetImpl() as delete so you won't be tempted again. :)