Skip to content

Commit 62d69c0

Browse files
krzysiek358igcbot
authored andcommitted
Remove obsolete code from GASResolving pass
Remove unused code from GASResolving pass
1 parent e5f14e0 commit 62d69c0

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

IGC/Compiler/Optimizer/OpenCLPasses/GenericAddressResolution/GASResolving.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ bool GASResolving::resolveMemoryFromHost(Function& F) const {
147147

148148
// collect load candidates and in parallel check for unsafe instructions
149149
// visitor may be a more beautiful way to do this
150-
bool HasASCast = false; // if there exists addrspace cast from non global/generic space
151-
bool HasPtoi = false; // if there exists ptrtoint with global/generic space
152150
for (BasicBlock& B : F) {
153151
for (Instruction& I : B) {
154152
if (auto LI = dyn_cast<LoadInst>(&I)) {
@@ -173,22 +171,8 @@ bool GASResolving::resolveMemoryFromHost(Function& F) const {
173171
return false;
174172
}
175173
else if (auto PI = dyn_cast<PtrToIntInst>(&I)) {
176-
// if we have a ptrtoint we need to check data flow which we don't want to
177-
if (PI->getPointerAddressSpace() != ADDRESS_SPACE_GLOBAL &&
178-
PI->getPointerAddressSpace() != ADDRESS_SPACE_GENERIC)
179-
return false;
180-
else {
181-
HasPtoi = true;
182-
}
183-
184174
return false;
185175
}
186-
else if (auto AI = dyn_cast<AddrSpaceCastInst>(&I)) {
187-
if (AI->getSrcAddressSpace() != ADDRESS_SPACE_GLOBAL &&
188-
AI->getSrcAddressSpace() != ADDRESS_SPACE_GENERIC) {
189-
HasASCast = true;
190-
}
191-
}
192176
else if (auto SI = dyn_cast<StoreInst>(&I)) {
193177
Value* V = SI->getValueOperand();
194178
if (isa<PointerType>(V->getType())) {
@@ -202,8 +186,6 @@ bool GASResolving::resolveMemoryFromHost(Function& F) const {
202186
}
203187
}
204188
}
205-
if (HasASCast && HasPtoi)
206-
return false;
207189

208190
if (Loads.empty())
209191
return false;

0 commit comments

Comments
 (0)