[PATCH] D97859: [LegalizeDAG] Implement promotion rules for SELECT_CC

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 10:41:37 PST 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4728
+    // Cast the operands.
+    Tmp1 = DAG.getNode(ExtOp, dl, NVT, Node->getOperand(0));
+    Tmp2 = DAG.getNode(ExtOp, dl, NVT, Node->getOperand(1));
----------------
LemonBoy wrote:
> craig.topper wrote:
> > I believe ISD::SELECT_CC can have integer operands for the compare and FP operands for the result and true/false value.
> I actually tried to do so but hit an assertion when the previous node is RAUW'd.
> The assert message is `"Cannot replace uses of with self"`, some brief testing showed it complains after the `SELECT_CC` is promoted for the second time.
Sorry, what exactly did you try to do?   My point was only that you can't assume the same extend opcode is valid for all operands or that all operands want to be promoted to NVT.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97859/new/

https://reviews.llvm.org/D97859



More information about the llvm-commits mailing list