[PATCH] D121355: [SelectionDAG] Fold shift constants into cmp

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 21:58:02 PDT 2022


craig.topper added inline comments.
Herald added a subscriber: StephenFan.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:4552
+            // Replace C1 with (NewC << ShiftBits) is legal
+            // X <  C1     -> X <  (NewC << ShiftBits)
+            // X >= C1     -> X >= (NewC << ShiftBits)
----------------
The first two cases never happen do they?

In those cases `C1 == NewC << ShiftBits` and we already checked  isLegalICmpImmediate on line 4500.


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

https://reviews.llvm.org/D121355



More information about the llvm-commits mailing list