diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-22 12:44:16 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-22 12:44:16 +0000 |
| commit | 2b7fef681fb65798e756c463dd3198e5af87f300 (patch) | |
| tree | cc566e6794e45712f4bc3efbc35c71c93472b218 /llvm/lib/Transforms | |
| parent | 716859aa644f0df05a84b77f8bd11a057083efe1 (diff) | |
| download | bcm5719-llvm-2b7fef681fb65798e756c463dd3198e5af87f300.tar.gz bcm5719-llvm-2b7fef681fb65798e756c463dd3198e5af87f300.zip | |
Delete more dead code.
Found by gcc 6.
llvm-svn: 273402
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp | 22 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | 12 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopInterchange.cpp | 16 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 30 |
4 files changed, 0 insertions, 80 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp index 9e3cf3041a0..dd4e7e27a96 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp @@ -58,7 +58,6 @@ namespace { // operators inevitably call FAddendCoef's constructor which is not cheap. void operator=(const FAddendCoef &A); void operator+=(const FAddendCoef &A); - void operator-=(const FAddendCoef &A); void operator*=(const FAddendCoef &S); bool isOne() const { return isInt() && IntVal == 1; } @@ -279,27 +278,6 @@ void FAddendCoef::operator+=(const FAddendCoef &That) { T.add(createAPFloatFromInt(T.getSemantics(), That.IntVal), RndMode); } -void FAddendCoef::operator-=(const FAddendCoef &That) { - enum APFloat::roundingMode RndMode = APFloat::rmNearestTiesToEven; - if (isInt() == That.isInt()) { - if (isInt()) - IntVal -= That.IntVal; - else - getFpVal().subtract(That.getFpVal(), RndMode); - return; - } - - if (isInt()) { - const APFloat &T = That.getFpVal(); - convertToFpType(T.getSemantics()); - getFpVal().subtract(T, RndMode); - return; - } - - APFloat &T = getFpVal(); - T.subtract(createAPFloatFromInt(T.getSemantics(), IntVal), RndMode); -} - void FAddendCoef::operator*=(const FAddendCoef &That) { if (That.isOne()) return; diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 6b2df2a1d9d..df48897f2c7 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -99,8 +99,6 @@ private: Constant *getEmitFunctionFunc(); Constant *getEmitArcsFunc(); Constant *getSummaryInfoFunc(); - Constant *getDeleteWriteoutFunctionListFunc(); - Constant *getDeleteFlushFunctionListFunc(); Constant *getEndFileFunc(); // Create or retrieve an i32 state value that is used to represent the @@ -817,16 +815,6 @@ Constant *GCOVProfiler::getSummaryInfoFunc() { return M->getOrInsertFunction("llvm_gcda_summary_info", FTy); } -Constant *GCOVProfiler::getDeleteWriteoutFunctionListFunc() { - FunctionType *FTy = FunctionType::get(Type::getVoidTy(*Ctx), false); - return M->getOrInsertFunction("llvm_delete_writeout_function_list", FTy); -} - -Constant *GCOVProfiler::getDeleteFlushFunctionListFunc() { - FunctionType *FTy = FunctionType::get(Type::getVoidTy(*Ctx), false); - return M->getOrInsertFunction("llvm_delete_flush_function_list", FTy); -} - Constant *GCOVProfiler::getEndFileFunc() { FunctionType *FTy = FunctionType::get(Type::getVoidTy(*Ctx), false); return M->getOrInsertFunction("llvm_gcda_end_file", FTy); diff --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp index 6e74a733d11..5dc0de25971 100644 --- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp +++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp @@ -403,11 +403,9 @@ public: private: void splitInnerLoopLatch(Instruction *); - void splitOuterLoopLatch(); void splitInnerLoopHeader(); bool adjustLoopLinks(); void adjustLoopPreheaders(); - void adjustOuterLoopPreheader(); bool adjustLoopBranches(); void updateIncomingBlock(BasicBlock *CurrBlock, BasicBlock *OldPred, BasicBlock *NewPred); @@ -1074,13 +1072,6 @@ void LoopInterchangeTransform::splitInnerLoopLatch(Instruction *Inc) { InnerLoopLatch = SplitBlock(InnerLoopLatchPred, Inc, DT, LI); } -void LoopInterchangeTransform::splitOuterLoopLatch() { - BasicBlock *OuterLoopLatch = OuterLoop->getLoopLatch(); - BasicBlock *OuterLatchLcssaPhiBlock = OuterLoopLatch; - OuterLoopLatch = SplitBlock(OuterLatchLcssaPhiBlock, - OuterLoopLatch->getFirstNonPHI(), DT, LI); -} - void LoopInterchangeTransform::splitInnerLoopHeader() { // Split the inner loop header out. Here make sure that the reduction PHI's @@ -1125,13 +1116,6 @@ static void moveBBContents(BasicBlock *FromBB, Instruction *InsertBefore) { FromBB->getTerminator()->getIterator()); } -void LoopInterchangeTransform::adjustOuterLoopPreheader() { - BasicBlock *OuterLoopPreHeader = OuterLoop->getLoopPreheader(); - BasicBlock *InnerPreHeader = InnerLoop->getLoopPreheader(); - - moveBBContents(OuterLoopPreHeader, InnerPreHeader->getTerminator()); -} - void LoopInterchangeTransform::updateIncomingBlock(BasicBlock *CurrBlock, BasicBlock *OldPred, BasicBlock *NewPred) { diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index 7b95ac04b5f..2eade8cbe8e 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -144,20 +144,6 @@ public: /// (not an MDNode, or MDNode::isResolved() returns true). Metadata *mapMetadata(const Metadata *MD); - // Map LocalAsMetadata, which never gets memoized. - // - // If the referenced local is not mapped, the principled return is nullptr. - // However, optimization passes sometimes move metadata operands *before* the - // SSA values they reference. To prevent crashes in \a RemapInstruction(), - // return "!{}" when RF_IgnoreMissingLocals is not set. - // - // \note Adding a mapping for LocalAsMetadata is unsupported. Add a mapping - // to the value map for the SSA value in question instead. - // - // FIXME: Once we have a verifier check for forward references to SSA values - // through metadata operands, always return nullptr on unmapped locals. - Metadata *mapLocalAsMetadata(const LocalAsMetadata &LAM); - void scheduleMapGlobalInitializer(GlobalVariable &GV, Constant &Init, unsigned MCID); void scheduleMapAppendingVariable(GlobalVariable &GV, Constant *InitPrefix, @@ -817,22 +803,6 @@ Optional<Metadata *> Mapper::mapSimpleMetadata(const Metadata *MD) { return None; } -Metadata *Mapper::mapLocalAsMetadata(const LocalAsMetadata &LAM) { - // Lookup the mapping for the value itself, and return the appropriate - // metadata. - if (Value *V = mapValue(LAM.getValue())) { - if (V == LAM.getValue()) - return const_cast<LocalAsMetadata *>(&LAM); - return ValueAsMetadata::get(V); - } - - // FIXME: always return nullptr once Verifier::verifyDominatesUse() ensures - // metadata operands only reference defined SSA values. - return (Flags & RF_IgnoreMissingLocals) - ? nullptr - : MDTuple::get(LAM.getContext(), None); -} - Metadata *Mapper::mapMetadata(const Metadata *MD) { assert(MD && "Expected valid metadata"); assert(!isa<LocalAsMetadata>(MD) && "Unexpected local metadata"); |

