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
Diff Detail
Event Timeline
LGTM.
lib/Target/PowerPC/PPCTargetMachine.cpp | ||
---|---|---|
369 | 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 | I feel it is better to use Subtarget.needsSwapsForVSXMemOps() to make the meaning of the check clearer. |
lib/Target/PowerPC/PPCTargetMachine.cpp | ||
---|---|---|
371 | This is actually a really good point. I forgot that we added that function. Please use that instead. |
lib/Target/PowerPC/PPCTargetMachine.cpp | ||
---|---|---|
371 | I agree with Hiroshi, this is a good way to increase code readability. |
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.
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. :)
Please add a comment such as