-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
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
I believe we should be able to fold @llvm.pow[i] with a poison operand to poison:
define float @src(float %x) {
%powi = call float @llvm.powi(float poison, i32 %pow)
ret float %powi
}
define float @tgt(float %x) {
ret float poison
}But we don't do this today: https://godbolt.org/z/EGrYPc6oW
I can't think of a reason why poison wouldn't propagate, I presume it would act similarly to e.g. @llvm.sqrt which we do fold poison through.
Alive doesn't seem to support the pow[i] libcall just yet https://alive2.llvm.org/ce/z/CXcVgc
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