-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
constant-foldingProblems related to constant folding in the optimizerProblems related to constant folding in the optimizerllvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passes
Description
The motivation for this is #153069, where we would like to avoid regressions by being able to simplify unary and ternary intrinsics in IRBuilderFolder.
Currently we can only fold binary intrinsics. I presume we want to change the IRBuilderFolder interface from FoldBinaryIntrinsic -> FoldIntrinsic. I'm not sure what needs to change in ConstantFolder.cpp though. I see we have ConstantFoldBinaryIntrinsic, but we also seem to handle scalar intrinsics in ConstantFoldCall?
The only folding we really need for #153069 is propagating poison, i.e. intrinsicPropagatesPoison
Some relevant discussion in #150931 (comment)
Metadata
Metadata
Assignees
Labels
constant-foldingProblems related to constant folding in the optimizerProblems related to constant folding in the optimizerllvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passes