[PATCH] D97859: [LegalizeDAG] Implement promotion rules for SELECT_CC
LemonBoy via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 4 10:09:45 PST 2021
LemonBoy added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4727
+ if (NVT.isInteger()) {
+ ExtOp = isSignedIntSetCC(CCCode) ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND;
+ }
----------------
craig.topper wrote:
> If NVT is Integer, but operand 0 and 1 are floating point, I'm not sure we should be calling isSignedIntSetCC. The floating point and integer condition codes are shared. So SETGT, SETLT, SETLE, SETGE are also valid for floating point, but they wouldn't mean anything for determining if you should SIGN_EXTEND or ZERO_EXTEND the true/false values of the SELECT_CC.
>
> But I guess since this hasn't worked properly before now maybe this doesn't happen and it doesn't matter.
I see, this is trickier than anticipated. I'll simply assert that both types are equal and carry on, this promotion rule is rarely used and the only instances I could produce fall into this category.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97859/new/
https://reviews.llvm.org/D97859
More information about the llvm-commits
mailing list