[PATCH] D34757: [PowerPC] better instruction selection for OR (XOR) with a 32-bit immediate
Hiroshi Inoue via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 27 21:34:18 PDT 2017
inouehrs added inline comments.
================
Comment at: lib/Target/PowerPC/PPCISelDAGToDAG.cpp:3356
+ bool IsPPC64 = PPCSubTarget->isPPC64();
+ if (IsPPC64 && isInt64Immediate(N->getOperand(1), Imm64) &&
+ (Imm64 & ~0xFFFFFFFFuLL) == 0) {
----------------
nemanjai wrote:
> We don't want to do this with `i32` nodes? Or is this already handled correctly due to code elsewhere?
This code optimize both i64 and i32 on ppc64.
```
unsigned long f64b(unsigned long x) {
return x | 0xFFFFFFuLL;
}
unsigned f32b(unsigned x) {
return x | 0xFFFFFF;
}
```
I added test cases for i32 (ori_test_e and xori_test_e)
https://reviews.llvm.org/D34757
More information about the llvm-commits
mailing list