diff options
author | Lukas Sommer <sommer@esa.tu-darmstadt.de> | 2021-02-04 14:56:15 -0500 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2021-02-05 14:25:19 -0500 |
commit | 2303e93e666e13ebf6d24323729c28f520ecca37 (patch) | |
tree | 4930159f5d0fe23b3fd0c184783583558bef7395 /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | e3c0b0fe0958ef766aee01fc517f6476e712ff39 (diff) | |
download | llvm-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.cpp | 3 |
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()); |