Skip to content

[ESIMD][NFC] Do not take type for CreateLoad from pointer #3567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions llvm/lib/SYCLLowerIR/LowerESIMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,7 @@ static bool translateVLoad(CallInst &CI, SmallPtrSet<Type *, 4> &GVTS) {
if (GVTS.find(CI.getType()) != GVTS.end())
return false;
IRBuilder<> Builder(&CI);
auto *ElemT = CI.getArgOperand(0)->getType()->getPointerElementType();
auto LI = Builder.CreateLoad(ElemT, CI.getArgOperand(0), CI.getName());
auto LI = Builder.CreateLoad(CI.getType(), CI.getArgOperand(0), CI.getName());
LI->setDebugLoc(CI.getDebugLoc());
CI.replaceAllUsesWith(LI);
return true;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/SYCLLowerIR/LowerESIMDVLoadVStore.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ PreservedAnalyses ESIMDLowerLoadStorePass::run(Function &F,
if (GenXIntrinsic::isVStore(&Inst))
Builder.CreateStore(Inst.getOperand(0), Inst.getOperand(1));
else {
auto *ElemT = Inst.getOperand(0)->getType()->getPointerElementType();
auto LI = Builder.CreateLoad(ElemT, Inst.getOperand(0), Inst.getName());
auto LI = Builder.CreateLoad(Inst.getType(), Inst.getOperand(0),
Inst.getName());
LI->setDebugLoc(Inst.getDebugLoc());
Inst.replaceAllUsesWith(LI);
}
Expand Down
6 changes: 2 additions & 4 deletions llvm/lib/SYCLLowerIR/LowerWGScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ shareOutputViaLocalMem(Instruction &I, BasicBlock &BBa, BasicBlock &BBb,
Bld.CreateStore(&I, WGLocal);
// 3) Generate a load in the "worker" BB of the value stored by the leader
Bld.SetInsertPoint(&BBb.front());
auto *WGValT = WGLocal->getType()->getPointerElementType();
auto *WGVal = Bld.CreateLoad(WGValT, WGLocal, "wg_val_" + Twine(I.getName()));
auto *WGVal = Bld.CreateLoad(T, WGLocal, "wg_val_" + Twine(I.getName()));
// 4) Finally, replace usages of I outside the scope
for (auto *U : Users)
U->replaceUsesOfWith(&I, WGVal);
Expand Down Expand Up @@ -417,8 +416,7 @@ static void copyBetweenPrivateAndShadow(Value *L, GlobalVariable *Shadow,

if (!Loc2Shadow)
std::swap(Src, Dst);
auto *SrcT = Src->getType()->getPointerElementType();
Value *LocalVal = Builder.CreateLoad(SrcT, Src, "mat_ld");
Value *LocalVal = Builder.CreateLoad(T, Src, "mat_ld");
Builder.CreateStore(LocalVal, Dst);
}
}
Expand Down