diff options
author | Paul Walker <paul.walker@arm.com> | 2024-03-08 12:09:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 12:09:05 +0000 |
commit | bd6eb54886ad12fb523e924e7291abfa2b010e3c (patch) | |
tree | 854ea76359d2f50aa541a02d6c64e0afadeca478 /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | 4d478bcb4fc4fcf6532b725a0d070cb0c0cf9430 (diff) | |
download | llvm-bd6eb54886ad12fb523e924e7291abfa2b010e3c.zip llvm-bd6eb54886ad12fb523e924e7291abfa2b010e3c.tar.gz llvm-bd6eb54886ad12fb523e924e7291abfa2b010e3c.tar.bz2 |
[LLVM][CodeGen] Teach SelectionDAG how to expand FREM to a vector math call. (#83859)
This removes, at least when a vector library is available, a failure
case for scalable vectors. Doing so means we can confidently cost vector
FREM instructions without making an assumption that later passes will
transform the IR before it gets to the code generator.
NOTE: Whilst only FREM has been implemented the same mechanism
can be used for the other libm related ISD nodes.
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index cf068ec..8832b51 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -205,6 +205,10 @@ static cl::opt<bool> MISchedPostRA( static cl::opt<bool> EarlyLiveIntervals("early-live-intervals", cl::Hidden, cl::desc("Run live interval analysis earlier in the pipeline")); +static cl::opt<bool> DisableReplaceWithVecLib( + "disable-replace-with-vec-lib", cl::Hidden, + cl::desc("Disable replace with vector math call pass")); + /// Option names for limiting the codegen pipeline. /// Those are used in error reporting and we didn't want /// to duplicate their names all over the place. @@ -856,7 +860,7 @@ void TargetPassConfig::addIRPasses() { if (getOptLevel() != CodeGenOptLevel::None && !DisableConstantHoisting) addPass(createConstantHoistingPass()); - if (getOptLevel() != CodeGenOptLevel::None) + if (getOptLevel() != CodeGenOptLevel::None && !DisableReplaceWithVecLib) addPass(createReplaceWithVeclibLegacyPass()); if (getOptLevel() != CodeGenOptLevel::None && !DisablePartialLibcallInlining) |