[PATCH] D122382: [SelectionDAG] Don't create illegally-typed nodes while constant folding

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 14:28:10 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5616
+        if (NewNodesMustHaveLegalTypes &&
+            ScalarOp.getOpcode() != ISD::Constant &&
+            TLI->getTypeAction(*getContext(), InSVT) !=
----------------
Can we use this instead of checking ISD::Constant

```
!isa<ConstantSDNode>(ScalarOp) && !ScalarOp.isUndef()
```

That allows undef(fixed the X86 test) and TargetConstant(fixes the mips changes). Does suggest that mips might be using TargetConstant in an odd way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122382



More information about the llvm-commits mailing list