diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-08-23 10:27:02 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-08-23 10:27:02 +0000 |
commit | a8a7099c1849fcbb4a68642a292fd0250aa46505 (patch) | |
tree | f3f31347a082cd803e6a47a6e8b57294ac55748d /lib/Target/SystemZ/SystemZTargetMachine.cpp | |
parent | 287c84a0b45cc826b1200f4cf4be3547d2fcd69c (diff) | |
download | llvm-a8a7099c1849fcbb4a68642a292fd0250aa46505.tar.gz llvm-a8a7099c1849fcbb4a68642a292fd0250aa46505.tar.bz2 llvm-a8a7099c1849fcbb4a68642a292fd0250aa46505.tar.xz |
Turn MipsOptimizeMathLibCalls into a target-independent scalar transform
...so that it can be used for z too. Most of the code is the same.
The only real change is to use TargetTransformInfo to test when a sqrt
instruction is available.
The pass is opt-in because at the moment it only handles sqrt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189097 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/SystemZTargetMachine.cpp')
-rw-r--r-- | lib/Target/SystemZ/SystemZTargetMachine.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/SystemZ/SystemZTargetMachine.cpp b/lib/Target/SystemZ/SystemZTargetMachine.cpp index 856183c6f4..f2761520cd 100644 --- a/lib/Target/SystemZ/SystemZTargetMachine.cpp +++ b/lib/Target/SystemZ/SystemZTargetMachine.cpp @@ -10,6 +10,7 @@ #include "SystemZTargetMachine.h" #include "llvm/CodeGen/Passes.h" #include "llvm/Support/TargetRegistry.h" +#include "llvm/Transforms/Scalar.h" using namespace llvm; @@ -47,12 +48,18 @@ public: return getTM<SystemZTargetMachine>(); } + virtual void addIRPasses() LLVM_OVERRIDE; virtual bool addInstSelector() LLVM_OVERRIDE; virtual bool addPreSched2() LLVM_OVERRIDE; virtual bool addPreEmitPass() LLVM_OVERRIDE; }; } // end anonymous namespace +void SystemZPassConfig::addIRPasses() { + TargetPassConfig::addIRPasses(); + addPass(createPartiallyInlineLibCallsPass()); +} + bool SystemZPassConfig::addInstSelector() { addPass(createSystemZISelDag(getSystemZTargetMachine(), getOptLevel())); return false; |