[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
Sat Nov 4 02:32:31 PDT 2023


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

Why do you rename `TruncTy` to `OutTy`?

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


More information about the llvm-commits mailing list