[llvm-branch-commits] [llvm] [InstCombine] Fold fpto[su]i of llvm.trunc (PR #231414)
Harrison Hao via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Oct 13 02:08:42 PDT 2026
================
@@ -2592,6 +2592,11 @@ static Instruction *foldFPtoI(Instruction &FI, InstCombiner &IC) {
if (FPClass.isKnownNever(Mask))
return IC.replaceInstUsesWith(FI, ConstantInt::getNullValue(FI.getType()));
+ // fpto{u/s}i (trunc X) --> fpto{u/s}i X
+ Value *Src = nullptr;
----------------
harrisonGPU wrote:
Done. (In fact, some reviewers asked me to initialize it to `nullptr` before the pattern match, so I am not sure whether the initialization is necessary.)
https://github.com/llvm/llvm-project/pull/231414
More information about the llvm-branch-commits
mailing list