[llvm] [InstCombine] Fold `sext(trunc nsw)` and `zext(trunc nuw)` (PR #88609)

via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 13 07:18:49 PDT 2024


================
@@ -1467,6 +1478,15 @@ Instruction *InstCombinerImpl::visitSExt(SExtInst &Sext) {
     if (ComputeNumSignBits(X, 0, &Sext) > XBitSize - SrcBitSize)
       return CastInst::CreateIntegerCast(X, DestTy, /* isSigned */ true);
----------------
YanWQ-monad wrote:

Yes. After removal, no regression shown in dtcxzyw's benchmark. Thanks

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


More information about the llvm-commits mailing list