[PATCH] D112298: [InstCombine] Generalize sadd.sat combine to compute sign bits.
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 3 07:40:52 PDT 2021
lebedev.ri added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2324-2325
Function *F = Intrinsic::getDeclaration(MinMax1.getModule(), IntrinsicID, NewTy);
- Value *AT = Builder.CreateSExt(A, NewTy);
- Value *BT = Builder.CreateSExt(B, NewTy);
+ Value *AT = Builder.CreateTrunc(AddSub->getOperand(0), NewTy);
+ Value *BT = Builder.CreateTrunc(AddSub->getOperand(1), NewTy);
Value *Sat = Builder.CreateCall(F, {AT, BT});
----------------
Should these not be `CreateTruncOrBitCast`?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112298/new/
https://reviews.llvm.org/D112298
More information about the llvm-commits
mailing list