[PowerPC] Don't commute trivial rlwimi instructions
authorHal Finkel <hfinkel@anl.gov>
Sun, 6 Sep 2015 04:17:30 +0000 (04:17 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 6 Sep 2015 04:17:30 +0000 (04:17 +0000)
commit9f11e5da345cac0ed3dece4c1c3dee153382fa01
tree5899a84b1e6cc4b4e5543d4ac0c4f6bba7deab06
parentcb52ea5f9dd5c0fda285285d2eefbc6e39f60b1e
[PowerPC] Don't commute trivial rlwimi instructions

To commute a trivial rlwimi instructions (meaning one with a full mask and zero
shift), we'd need to ability to form an all-zero mask (instead of an all-one
mask) using rlwimi. We can't represent this, however, and we'll miscompile code
if we try.

The code quality problem that this highlights (that SDAG simplification can
lead to us generating an ISD::OR node with a constant zero LHS) will be fixed
as a follow-up.

Fixes PR24719.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246937 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCInstrInfo.cpp
test/CodeGen/PowerPC/no-rlwimi-trivial-commute.mir [new file with mode: 0644]