[llvm] Port isNonZeroShift to SelectionDAG (PR #146125)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 11:47:57 PDT 2025


================
@@ -5871,6 +5871,55 @@ bool SelectionDAG::isKnownNeverZeroFloat(SDValue Op) const {
       Op, [](ConstantFPSDNode *C) { return !C->isZero(); });
 }
 
+static bool isNonZeroShift(const SDValue I, const KnownBits &KnownVal,
+                           unsigned Depth) {
+  auto ShiftOp = [&](const APInt &Lhs, const APInt &Rhs) {
+    switch (I.getOpcode()) {
+    case Instruction::Shl:
----------------
topperc wrote:

These are IR opcodes. They are different for SelectionDAG.

https://github.com/llvm/llvm-project/pull/146125


More information about the llvm-commits mailing list