Skip to content

Commit accd0b5

Browse files
authored
Revert "[ESIMD] Infer address space of pointer that are passed through invoke_simd to ESIMD API to generate better code on BE" (#14607)
Reverts #14528 Postcommit failures
1 parent 9572660 commit accd0b5

File tree

3 files changed

+0
-161
lines changed

3 files changed

+0
-161
lines changed

llvm/lib/SYCLLowerIR/LowerInvokeSimd.cpp

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "llvm/ADT/SmallPtrSet.h"
2828
#include "llvm/GenXIntrinsics/GenXMetadata.h"
2929
#include "llvm/IR/Constants.h"
30-
#include "llvm/IR/InstIterator.h"
3130
#include "llvm/IR/Instructions.h"
3231
#include "llvm/IR/Module.h"
3332
#include "llvm/IR/Verifier.h"
@@ -260,45 +259,6 @@ void markFunctionAsESIMD(Function *F) {
260259
}
261260
}
262261

263-
void adjustAddressSpace(Function *F, uint32_t ArgNo, uint32_t ArgAddrSpace) {
264-
Argument *Arg = F->getArg(ArgNo);
265-
for (User *ArgUse : Arg->users()) {
266-
Instruction *Instr = dyn_cast<Instruction>(ArgUse);
267-
if (!Instr)
268-
continue;
269-
const AddrSpaceCastInst *ASC = dyn_cast<AddrSpaceCastInst>(ArgUse);
270-
if (ASC) {
271-
if (ASC->getDestAddressSpace() == ArgAddrSpace)
272-
continue;
273-
}
274-
275-
const CallInst *CI = dyn_cast<CallInst>(ArgUse);
276-
if (CI) {
277-
Function *Callee = CI->getCalledFunction();
278-
if (!Callee || Callee->isDeclaration())
279-
continue;
280-
281-
for (uint32_t i = 0; i < CI->getNumOperands(); ++i) {
282-
if (CI->getOperand(i) == Arg) {
283-
adjustAddressSpace(Callee, i, ArgAddrSpace);
284-
}
285-
}
286-
} else {
287-
for (unsigned int i = 0; i < ArgUse->getNumOperands(); ++i) {
288-
if (ArgUse->getOperand(i) == Arg) {
289-
PointerType *NPT = PointerType::get(Arg->getContext(), ArgAddrSpace);
290-
291-
auto *NewInstr = new AddrSpaceCastInst(ArgUse->getOperand(i), NPT);
292-
NewInstr->insertBefore(Instr);
293-
NewInstr->setDebugLoc(Instr->getDebugLoc());
294-
295-
ArgUse->setOperand(i, NewInstr);
296-
}
297-
}
298-
}
299-
}
300-
}
301-
302262
// Process 'invoke_simd(sub_group_obj, f, spmd_args...);' call.
303263
//
304264
// If f is a function name or a function pointer, this call is lowered into
@@ -359,25 +319,6 @@ bool processInvokeSimdCall(CallInst *InvokeSimd,
359319
SimdF->addFnAttr(INVOKE_SIMD_DIRECT_TARGET_ATTR);
360320
}
361321

362-
if (!SimdF->isDeclaration()) {
363-
// The real arguments for invoke_simd callee start at index 2.
364-
for (uint32_t i = 2; i < InvokeSimd->arg_size(); ++i) {
365-
const Value *Arg = InvokeSimd->getArgOperand(i);
366-
if (Arg->getType()->isPointerTy()) {
367-
uint32_t AddressSpace = Arg->getType()->getPointerAddressSpace();
368-
if (AddressSpace == 4) {
369-
const AddrSpaceCastInst *ASC = dyn_cast<AddrSpaceCastInst>(Arg);
370-
if (!ASC)
371-
continue;
372-
373-
AddressSpace =
374-
ASC->getOperand(0)->getType()->getPointerAddressSpace();
375-
}
376-
adjustAddressSpace(SimdF, i - 2, AddressSpace);
377-
}
378-
}
379-
}
380-
381322
// The invoke_simd target is known at compile-time - optimize.
382323
// 1. find the call to f within the cloned helper - it is its first parameter
383324
constexpr unsigned SimdCallTargetArgNo = 0;

sycl/test-e2e/ESIMD/PerformanceTests/invoke_simd_smoke.cpp

Lines changed: 0 additions & 16 deletions
This file was deleted.

sycl/test/invoke_simd/invoke_simd_address_space_inferral.cpp

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)