Skip to content

Poison not propagate through @llvm.pow[i] #146560

@lukel97

Description

@lukel97

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 optimizerllvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions