Skip to content

Commit 392e99c

Browse files
committed
LoopIdiomRecognize: add negative tests for powi idiom
The following code, when compiled under -ffast-math, produces bad codegen due to LoopVectorize: float powi(float base, int exp) { float result = 1.0; for (int i = 0; i < exp; ++i) result *= base; return result; } It can easily be replaced with the llvm.powi intrinsic, when the exponent is a C int type. This is the job of LoopIdiomRecognize, and has been marked as a TODO item for years. In preparation to fulfill this wish, add negative tests corresponding to variations of this program.
1 parent a2e8207 commit 392e99c

File tree

1 file changed

+471
-0
lines changed
  • llvm/test/Transforms/LoopIdiom

1 file changed

+471
-0
lines changed

0 commit comments

Comments
 (0)