diff options
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZTDC.cpp')
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZTDC.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZTDC.cpp b/llvm/lib/Target/SystemZ/SystemZTDC.cpp index f103812eb096..7cb7dca2ea28 100644 --- a/llvm/lib/Target/SystemZ/SystemZTDC.cpp +++ b/llvm/lib/Target/SystemZ/SystemZTDC.cpp @@ -44,7 +44,9 @@ //===----------------------------------------------------------------------===// #include "SystemZ.h" +#include "SystemZSubtarget.h" #include "llvm/ADT/MapVector.h" +#include "llvm/CodeGen/TargetPassConfig.h" #include "llvm/IR/Constants.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/InstIterator.h" @@ -53,6 +55,7 @@ #include "llvm/IR/IntrinsicsS390.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Module.h" +#include "llvm/Target/TargetMachine.h" #include <deque> #include <set> @@ -72,6 +75,11 @@ public: } bool runOnFunction(Function &F) override; + + void getAnalysisUsage(AnalysisUsage &AU) const override { + AU.addRequired<TargetPassConfig>(); + } + private: // Maps seen instructions that can be mapped to a TDC, values are // (TDC operand, TDC mask, worthy flag) triples. @@ -310,6 +318,12 @@ void SystemZTDCPass::convertLogicOp(BinaryOperator &I) { } bool SystemZTDCPass::runOnFunction(Function &F) { + auto &TPC = getAnalysis<TargetPassConfig>(); + if (TPC.getTM<TargetMachine>() + .getSubtarget<SystemZSubtarget>(F) + .hasSoftFloat()) + return false; + ConvertedInsts.clear(); LogicOpsWorklist.clear(); PossibleJunk.clear(); |