@@ -27,8 +27,6 @@ SPDX-License-Identifier: MIT
2727#ifndef FUNCTIONGROUP_H
2828#define FUNCTIONGROUP_H
2929
30- #include " vc/GenXOpts/Utils/KernelInfo.h"
31- #include " llvm/ADT/SetVector.h"
3230#include " llvm/ADT/SmallVector.h"
3331#include " llvm/IR/Module.h"
3432#include " llvm/IR/ValueHandle.h"
@@ -43,18 +41,6 @@ class FunctionGroupAnalysis;
4341class LLVMContext ;
4442class PMStack ;
4543
46- namespace genx {
47- namespace fg {
48- inline bool isGroupHead (const Function &F) { return genx::isKernel (&F); }
49- inline bool isSubGroupHead (const Function &F) {
50- return genx::isReferencedIndirectly (&F) || genx::requiresStackCall (&F);
51- }
52- inline bool isHead (const Function &F) {
53- return isGroupHead (F) || isSubGroupHead (F);
54- }
55- } // namespace fg
56- } // namespace genx
57-
5844// ----------------------------------------------------------------------
5945// FunctionGroup : a group of Functions
6046//
@@ -64,9 +50,6 @@ class FunctionGroup {
6450 // Elements are asserting value handles, so we spot when a Function
6551 // in the group gets destroyed too early.
6652 SmallVector<AssertingVH<Function>, 8 > Functions;
67- // FunctionGroup can call the head function of another FunctionGroups with
68- // SUBGROUP type.
69- SetVector<const FunctionGroup *> Subgroups;
7053
7154public:
7255 FunctionGroup (FunctionGroupAnalysis *FGA) : FGA(FGA) {}
@@ -100,25 +83,6 @@ class FunctionGroup {
10083 StringRef getName () { return getHead ()->getName (); }
10184 LLVMContext &getContext () { return getHead ()->getContext (); }
10285 Module *getModule () { return getHead ()->getParent (); }
103- void addSubgroup (FunctionGroup *FG) {
104- IGC_ASSERT (FG);
105- IGC_ASSERT (FG->getHead ());
106- IGC_ASSERT_MESSAGE (genx::fg::isSubGroupHead (*FG->getHead ()),
107- " Provided function group has incorrect type" );
108- Subgroups.insert (FG);
109- }
110- using subgroup_iterator = decltype (Subgroups)::iterator;
111- using const_subgroup_iterator = decltype (Subgroups)::const_iterator;
112- subgroup_iterator begin_subgroup () { return Subgroups.begin (); }
113- subgroup_iterator end_subgroup () { return Subgroups.end (); }
114- const_subgroup_iterator begin_subgroup () const { return Subgroups.begin (); }
115- const_subgroup_iterator end_subgroup () const { return Subgroups.end (); }
116- iterator_range<subgroup_iterator> subgroups () {
117- return make_range (begin_subgroup (), end_subgroup ());
118- }
119- iterator_range<const_subgroup_iterator> subgroups () const {
120- return make_range (begin_subgroup (), end_subgroup ());
121- }
12286};
12387
12488// ----------------------------------------------------------------------
@@ -189,8 +153,6 @@ class FunctionGroupAnalysis : public ModulePass {
189153 FunctionGroup *getGroup (const Function *F, FGType Type) const ;
190154 FunctionGroup *getGroup (const Function *F) const ;
191155 FunctionGroup *getSubGroup (const Function *F) const ;
192- // get group or subgroup depending on where the function is.
193- FunctionGroup *getAnyGroup (const Function *F) const ;
194156 // getGroupForHead : get the FunctionGroup for which Function F is the
195157 // head, else 0
196158 FunctionGroup *getGroupForHead (const Function *F) const ;
@@ -199,40 +161,10 @@ class FunctionGroupAnalysis : public ModulePass {
199161 // iterator for FunctionGroups in the analysis
200162 typedef SmallVectorImpl<FunctionGroup *>::iterator iterator;
201163 typedef SmallVectorImpl<FunctionGroup *>::const_iterator const_iterator;
202- using all_iterator = concat_iterator<FunctionGroup *, iterator, iterator>;
203- using const_all_iterator =
204- concat_iterator<FunctionGroup *const , const_iterator, const_iterator>;
205164 iterator begin () { return iterator (Groups.begin ()); }
206165 iterator end () { return iterator (Groups.end ()); }
207166 const_iterator begin () const { return const_iterator (Groups.begin ()); }
208167 const_iterator end () const { return const_iterator (Groups.end ()); }
209-
210- iterator subgroup_begin () { return iterator (NonMainGroups.begin ()); }
211- iterator subgroup_end () { return iterator (NonMainGroups.end ()); }
212- const_iterator subgroup_begin () const {
213- return const_iterator (NonMainGroups.begin ());
214- }
215- const_iterator subgroup_end () const {
216- return const_iterator (NonMainGroups.end ());
217- }
218- iterator_range<iterator> subgroups () {
219- return make_range (subgroup_begin (), subgroup_end ());
220- }
221- iterator_range<const_iterator> subgroups () const {
222- return make_range (subgroup_begin (), subgroup_end ());
223- }
224-
225- iterator_range<all_iterator> AllGroups () {
226- return concat<FunctionGroup *>(
227- make_range (begin (), end ()),
228- make_range (subgroup_begin (), subgroup_end ()));
229- }
230- iterator_range<const_all_iterator> AllGroups () const {
231- return concat<FunctionGroup *const >(
232- make_range (begin (), end ()),
233- make_range (subgroup_begin (), subgroup_end ()));
234- }
235-
236168 size_t size () const { return Groups.size (); }
237169 // addToFunctionGroup : add Function F to FunctionGroup FG
238170 // Using this (rather than calling push_back directly on the FunctionGroup)
0 commit comments