diff options
author | James Molloy <james.molloy@arm.com> | 2014-07-23 13:33:00 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2014-07-23 13:33:00 +0000 |
commit | bc9fed82ccf8ae255b3c53c62a31292192d0fd15 (patch) | |
tree | b90b0af431b7ede3d05d390d627e4c033eb6d1ca /llvm | |
parent | 3dfa09bbbc07134da15cdf57928a67f85dc966ab (diff) | |
download | bcm5719-llvm-bc9fed82ccf8ae255b3c53c62a31292192d0fd15.tar.gz bcm5719-llvm-bc9fed82ccf8ae255b3c53c62a31292192d0fd15.zip |
Enable partial libcall inlining for all targets by default.
This pass attempts to speculatively use a sqrt instruction if one exists on the target, falling back to a libcall if the target instruction returned NaN.
This was enabled for MIPS and System-Z, but is well guarded and is good for most targets - GCC does this for (that I've checked) X86, ARM and AArch64.
llvm-svn: 213752
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/CodeGen/Passes.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetMachine.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/Passes.cpp b/llvm/lib/CodeGen/Passes.cpp index 249b2d0f6bb..6e86c8f2109 100644 --- a/llvm/lib/CodeGen/Passes.cpp +++ b/llvm/lib/CodeGen/Passes.cpp @@ -71,6 +71,8 @@ static cl::opt<bool> DisableCGP("disable-cgp", cl::Hidden, cl::desc("Disable Codegen Prepare")); static cl::opt<bool> DisableCopyProp("disable-copyprop", cl::Hidden, cl::desc("Disable Copy Propagation pass")); +static cl::opt<bool> DisablePartialLibcallInlining("disable-partial-libcall-inlining", + cl::Hidden, cl::desc("Disable Partial Libcall Inlining")); static cl::opt<bool> PrintLSR("print-lsr-output", cl::Hidden, cl::desc("Print LLVM IR produced by the loop-reduce pass")); static cl::opt<bool> PrintISelInput("print-isel-input", cl::Hidden, @@ -399,6 +401,9 @@ void TargetPassConfig::addIRPasses() { // Prepare expensive constants for SelectionDAG. if (getOptLevel() != CodeGenOpt::None && !DisableConstantHoisting) addPass(createConstantHoistingPass()); + + if (getOptLevel() != CodeGenOpt::None && !DisablePartialLibcallInlining) + addPass(createPartiallyInlineLibCallsPass()); } /// Turn exception handling constructs into something the code generators can diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp index bb1870ebe60..d9856dc15e1 100644 --- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp +++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp @@ -141,7 +141,6 @@ void MipsPassConfig::addIRPasses() { addPass(createMipsOs16(getMipsTargetMachine())); if (getMipsSubtarget().inMips16HardFloat()) addPass(createMips16HardFloat(getMipsTargetMachine())); - addPass(createPartiallyInlineLibCallsPass()); } // Install an instruction selector pass using // the ISelDag to gen Mips code. diff --git a/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp b/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp index 0122e99f8a7..a30b225e502 100644 --- a/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp +++ b/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp @@ -49,7 +49,6 @@ public: void SystemZPassConfig::addIRPasses() { TargetPassConfig::addIRPasses(); - addPass(createPartiallyInlineLibCallsPass()); } bool SystemZPassConfig::addInstSelector() { |