[PATCH] D91476: [DCE] Always get TargetLibraryInfo
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 17 20:41:30 PST 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGee7d315cd939: [DCE] Always get TargetLibraryInfo (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91476/new/
https://reviews.llvm.org/D91476
Files:
llvm/lib/Transforms/Scalar/DCE.cpp
llvm/test/Transforms/DCE/calls-errno.ll
Index: llvm/test/Transforms/DCE/calls-errno.ll
===================================================================
--- llvm/test/Transforms/DCE/calls-errno.ll
+++ llvm/test/Transforms/DCE/calls-errno.ll
@@ -1,4 +1,5 @@
; RUN: opt < %s -dce -S | FileCheck %s
+; RUN: opt < %s -passes=dce -S | FileCheck %s
declare double @acos(double) nounwind
declare double @asin(double) nounwind
Index: llvm/lib/Transforms/Scalar/DCE.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/DCE.cpp
+++ llvm/lib/Transforms/Scalar/DCE.cpp
@@ -143,7 +143,7 @@
}
PreservedAnalyses DCEPass::run(Function &F, FunctionAnalysisManager &AM) {
- if (!eliminateDeadCode(F, AM.getCachedResult<TargetLibraryAnalysis>(F)))
+ if (!eliminateDeadCode(F, &AM.getResult<TargetLibraryAnalysis>(F)))
return PreservedAnalyses::all();
PreservedAnalyses PA;
@@ -162,13 +162,14 @@
if (skipFunction(F))
return false;
- auto *TLIP = getAnalysisIfAvailable<TargetLibraryInfoWrapperPass>();
- TargetLibraryInfo *TLI = TLIP ? &TLIP->getTLI(F) : nullptr;
+ TargetLibraryInfo *TLI =
+ &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F);
return eliminateDeadCode(F, TLI);
}
void getAnalysisUsage(AnalysisUsage &AU) const override {
+ AU.addRequired<TargetLibraryInfoWrapperPass>();
AU.setPreservesCFG();
}
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91476.305966.patch
Type: text/x-patch
Size: 1390 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201118/9c93391d/attachment.bin>
More information about the llvm-commits
mailing list