aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetPassConfig.cpp
diff options
context:
space:
mode:
authorLukas Sommer <sommer@esa.tu-darmstadt.de>2021-02-04 14:56:15 -0500
committerSanjay Patel <spatel@rotateright.com>2021-02-05 14:25:19 -0500
commit2303e93e666e13ebf6d24323729c28f520ecca37 (patch)
tree4930159f5d0fe23b3fd0c184783583558bef7395 /llvm/lib/CodeGen/TargetPassConfig.cpp
parente3c0b0fe0958ef766aee01fc517f6476e712ff39 (diff)
downloadllvm-2303e93e666e13ebf6d24323729c28f520ecca37.zip
llvm-2303e93e666e13ebf6d24323729c28f520ecca37.tar.gz
llvm-2303e93e666e13ebf6d24323729c28f520ecca37.tar.bz2
[Codegen][ReplaceWithVecLib] add pass to replace vector intrinsics with calls to vector library
This patch adds a pass to replace calls to vector intrinsics (i.e., LLVM intrinsics operating on vector operands) with calls to a vector library. Currently, calls to LLVM intrinsics are only replaced with calls to vector libraries when scalar calls to intrinsics are vectorized by the Loop- or SLP-Vectorizer. With this pass, it is now possible to replace calls to LLVM intrinsics already operating on vector operands, e.g., if such code was generated by MLIR. For the replacement, information from the TargetLibraryInfo, e.g., as specified via -vector-library is used. Differential Revision: https://reviews.llvm.org/D95373
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetPassConfig.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp
index e844d03..3e5a666 100644
--- a/llvm/lib/CodeGen/TargetPassConfig.cpp
+++ b/llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -858,6 +858,9 @@ void TargetPassConfig::addIRPasses() {
if (getOptLevel() != CodeGenOpt::None && !DisableConstantHoisting)
addPass(createConstantHoistingPass());
+ if (getOptLevel() != CodeGenOpt::None)
+ addPass(createReplaceWithVeclibLegacyPass());
+
if (getOptLevel() != CodeGenOpt::None && !DisablePartialLibcallInlining)
addPass(createPartiallyInlineLibCallsPass());