[llvm] [InstCombine] Improve eq/ne by parts to handle ult/ugt equality pattern (PR #69884)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 06:47:14 PDT 2023


================
@@ -1166,7 +1166,7 @@ static Value *extractIntPart(const IntPart &P, IRBuilderBase &Builder) {
     V = Builder.CreateLShr(V, P.StartBit);
   Type *TruncTy = V->getType()->getWithNewBitWidth(P.NumBits);
   if (TruncTy != V->getType())
-    V = Builder.CreateTrunc(V, TruncTy);
+    V = Builder.CreateZExtOrTrunc(V, TruncTy);
----------------
dtcxzyw wrote:

It is confusing to me. Can you explain this further?


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


More information about the llvm-commits mailing list