[llvm] LoopIdiomRecognize: strip bad TODO (NFC) (PR #92890)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 21 03:08:08 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Ramkumar Ramachandra (artagnon)
<details>
<summary>Changes</summary>
There are several reasons why handling powi in LoopIdiomRecognize is a bad idea:
- powi corresponds to a GCC builtin that is only defined for C int (which is i32 for most targets).
- powi isn't always lowered by targets correctly for non-i32 parameters. Several targets fail to compile llvm.powi.f32.i16, for example.
- Unlike memcpy and memset, which tend to be important enough internal intrinsics that you have to handle them correctly even in freestanding modes, powi isn't.
Strip this bad TODO to avoid misleading contributors.
---
Full diff: https://github.com/llvm/llvm-project/pull/92890.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp (+2-4)
``````````diff
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index c7e25c9f3d2c9..3fe5478408d45 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -22,8 +22,6 @@
//
// Future loop memory idioms to recognize:
// memcmp, strlen, etc.
-// Future floating point idioms to recognize in -ffast-math mode:
-// fpowi
//
// This could recognize common matrix multiplies and dot product idioms and
// replace them with calls to BLAS (if linked in??).
@@ -1107,7 +1105,7 @@ bool LoopIdiomRecognize::processLoopStridedStore(
GV->setAlignment(Align(16));
Value *PatternPtr = GV;
NewCall = Builder.CreateCall(MSP, {BasePtr, PatternPtr, NumBytes});
-
+
// Set the TBAA info if present.
if (AATags.TBAA)
NewCall->setMetadata(LLVMContext::MD_tbaa, AATags.TBAA);
@@ -1117,7 +1115,7 @@ bool LoopIdiomRecognize::processLoopStridedStore(
if (AATags.NoAlias)
NewCall->setMetadata(LLVMContext::MD_noalias, AATags.NoAlias);
- }
+ }
NewCall->setDebugLoc(TheStore->getDebugLoc());
``````````
</details>
https://github.com/llvm/llvm-project/pull/92890
More information about the llvm-commits
mailing list