From 436906ab3cbe991826a8967f2c3c14850d267cbf Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 10 Mar 2014 02:45:14 +0000 Subject: [PATCH] [TTI] There is actually no realistic way to pop TTI implementations off the stack of the analysis group because they are all immutable passes. This is made clear by Craig's recent work to use override systematically -- we weren't overriding anything for 'finalizePass' because there is no such thing. This is kind of a lame restriction on the API -- we can no longer push and pop things, we just set up the stack and run. However, I'm not invested in building some better solution on top of the existing (terrifying) immutable pass and legacy pass manager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203437 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/TargetTransformInfo.h | 5 ----- lib/Analysis/TargetTransformInfo.cpp | 10 ---------- lib/CodeGen/BasicTargetTransformInfo.cpp | 4 ---- lib/Target/AArch64/AArch64TargetTransformInfo.cpp | 4 ---- lib/Target/ARM/ARMTargetTransformInfo.cpp | 4 ---- lib/Target/PowerPC/PPCTargetTransformInfo.cpp | 4 ---- lib/Target/R600/AMDGPUTargetTransformInfo.cpp | 2 -- lib/Target/X86/X86TargetTransformInfo.cpp | 4 ---- lib/Target/XCore/XCoreTargetTransformInfo.cpp | 4 ---- 9 files changed, 41 deletions(-) diff --git a/include/llvm/Analysis/TargetTransformInfo.h b/include/llvm/Analysis/TargetTransformInfo.h index 03ef8004c18..178d55305e2 100644 --- a/include/llvm/Analysis/TargetTransformInfo.h +++ b/include/llvm/Analysis/TargetTransformInfo.h @@ -59,11 +59,6 @@ protected: /// group's stack. void pushTTIStack(Pass *P); - /// All pass subclasses must in their finalizePass routine call popTTIStack - /// to update the pointers tracking the previous TTI instance in the analysis - /// group's stack, and the top of the analysis group's stack. - void popTTIStack(); - /// All pass subclasses must call TargetTransformInfo::getAnalysisUsage. virtual void getAnalysisUsage(AnalysisUsage &AU) const; diff --git a/lib/Analysis/TargetTransformInfo.cpp b/lib/Analysis/TargetTransformInfo.cpp index c27ba01c6bc..0dcdd12a409 100644 --- a/lib/Analysis/TargetTransformInfo.cpp +++ b/lib/Analysis/TargetTransformInfo.cpp @@ -35,16 +35,6 @@ void TargetTransformInfo::pushTTIStack(Pass *P) { PTTI->TopTTI = this; } -void TargetTransformInfo::popTTIStack() { - TopTTI = 0; - - // Walk up the chain and update the top TTI pointer. - for (TargetTransformInfo *PTTI = PrevTTI; PTTI; PTTI = PTTI->PrevTTI) - PTTI->TopTTI = PrevTTI; - - PrevTTI = 0; -} - void TargetTransformInfo::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } diff --git a/lib/CodeGen/BasicTargetTransformInfo.cpp b/lib/CodeGen/BasicTargetTransformInfo.cpp index 003f4c4c9e8..02cc31b6d2b 100644 --- a/lib/CodeGen/BasicTargetTransformInfo.cpp +++ b/lib/CodeGen/BasicTargetTransformInfo.cpp @@ -47,10 +47,6 @@ public: pushTTIStack(this); } - virtual void finalizePass() { - popTTIStack(); - } - virtual void getAnalysisUsage(AnalysisUsage &AU) const override { TargetTransformInfo::getAnalysisUsage(AU); } diff --git a/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/lib/Target/AArch64/AArch64TargetTransformInfo.cpp index 5d54da84dee..ef50fd75f6b 100644 --- a/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ b/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -56,10 +56,6 @@ public: pushTTIStack(this); } - virtual void finalizePass() { - popTTIStack(); - } - virtual void getAnalysisUsage(AnalysisUsage &AU) const override { TargetTransformInfo::getAnalysisUsage(AU); } diff --git a/lib/Target/ARM/ARMTargetTransformInfo.cpp b/lib/Target/ARM/ARMTargetTransformInfo.cpp index bf6df3e404a..d3b43cddcb6 100644 --- a/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -56,10 +56,6 @@ public: pushTTIStack(this); } - virtual void finalizePass() { - popTTIStack(); - } - void getAnalysisUsage(AnalysisUsage &AU) const override { TargetTransformInfo::getAnalysisUsage(AU); } diff --git a/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/lib/Target/PowerPC/PPCTargetTransformInfo.cpp index 22cdd66dbb5..984519c0793 100644 --- a/lib/Target/PowerPC/PPCTargetTransformInfo.cpp +++ b/lib/Target/PowerPC/PPCTargetTransformInfo.cpp @@ -56,10 +56,6 @@ public: pushTTIStack(this); } - virtual void finalizePass() { - popTTIStack(); - } - virtual void getAnalysisUsage(AnalysisUsage &AU) const override { TargetTransformInfo::getAnalysisUsage(AU); } diff --git a/lib/Target/R600/AMDGPUTargetTransformInfo.cpp b/lib/Target/R600/AMDGPUTargetTransformInfo.cpp index a335fc67f97..51225eb7f88 100644 --- a/lib/Target/R600/AMDGPUTargetTransformInfo.cpp +++ b/lib/Target/R600/AMDGPUTargetTransformInfo.cpp @@ -57,8 +57,6 @@ public: virtual void initializePass() override { pushTTIStack(this); } - virtual void finalizePass() { popTTIStack(); } - virtual void getAnalysisUsage(AnalysisUsage &AU) const override { TargetTransformInfo::getAnalysisUsage(AU); } diff --git a/lib/Target/X86/X86TargetTransformInfo.cpp b/lib/Target/X86/X86TargetTransformInfo.cpp index 3dbfd741945..c2456e74adb 100644 --- a/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/lib/Target/X86/X86TargetTransformInfo.cpp @@ -56,10 +56,6 @@ public: pushTTIStack(this); } - virtual void finalizePass() { - popTTIStack(); - } - virtual void getAnalysisUsage(AnalysisUsage &AU) const override { TargetTransformInfo::getAnalysisUsage(AU); } diff --git a/lib/Target/XCore/XCoreTargetTransformInfo.cpp b/lib/Target/XCore/XCoreTargetTransformInfo.cpp index baaf3f7cfff..313d18d1f2f 100644 --- a/lib/Target/XCore/XCoreTargetTransformInfo.cpp +++ b/lib/Target/XCore/XCoreTargetTransformInfo.cpp @@ -46,10 +46,6 @@ public: pushTTIStack(this); } - virtual void finalizePass() { - popTTIStack(); - } - virtual void getAnalysisUsage(AnalysisUsage &AU) const override { TargetTransformInfo::getAnalysisUsage(AU); }