[llvm] [InstCombine] Match intrinsic recurrences when known to be hoisted (PR #149858)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 07:03:34 PDT 2025


antoniofrighetto wrote:

>From the diff, it looks like the fold got triggered only with multi-use phi (though this folds fmaximumnum/fminimumnum too). Could make sense rooting this after foldOpIntoPhi with !PN->hasOneUse()?

I took a look at extending foldOpIntoPhi; though, if I didn't miss anything, it didn't look that promising unless passing an extra, say, IdempotentBinaryIntrinsic boolean or including the fold inside `if (!OneUse && !IdenticalUsers)` (which none of the two look that elegant to me).

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


More information about the llvm-commits mailing list