[PATCH] D124419: [InstCombine] try to fold icmp with mismatched extended operands

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 14:45:08 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:4724
+      if ((CastOp1->getOpcode() == Instruction::SExt &&
+           isKnownNonNegative(X, DL, 0, &AC, &ICmp, &DT)) ||
+          (CastOp1->getOpcode() == Instruction::ZExt &&
----------------
Isn't the sext handling here redundant due to https://github.com/llvm/llvm-project/blob/76d1f5eaa87b3d1ae5f4c07114313350152c24f2/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp#L1506-L1508, which will canonicalize to zext?


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

https://reviews.llvm.org/D124419



More information about the llvm-commits mailing list