[PATCH] D34545: [AMDGPU] Simplify setcc (sext from i1 b), -1|0, cc
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 22 18:05:51 PDT 2017
rampitec added inline comments.
================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:5127-5135
+ auto CRHS = dyn_cast<ConstantSDNode>(RHS);
+ if (!CRHS) {
+ CRHS = dyn_cast<ConstantSDNode>(LHS);
+ if (CRHS) {
+ std::swap(LHS, RHS);
+ CC = getSetCCSwappedOperands(CC);
+ }
----------------
arsenm wrote:
> Constants are canonicalized to the RHS as is, you shouldn't' need to handle this here
I agree, but I have seen a real case where it was swapped.
https://reviews.llvm.org/D34545
More information about the llvm-commits
mailing list