Skip to content

Commit

Permalink
[ESIMD] Fix build error showed with disabled asserts (#4733)
Browse files Browse the repository at this point in the history
Surprisingly Instruction->getNameOrAsOperand() is not defined when
asserts are disabled. Replaced that method usage with getName() method.

Signed-off-by: Vyacheslav N Klochkov <[email protected]>
  • Loading branch information
v-klochkov authored Oct 10, 2021
1 parent 97aec64 commit a618e1a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/lib/SYCLLowerIR/LowerESIMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,15 +885,14 @@ static Instruction *generateGenXCall(ExtractElementInst *EEI,
EEI->getModule(), ID, FixedVectorType::get(I32Ty, MAX_DIMS))
: GenXIntrinsic::getGenXDeclaration(EEI->getModule(), ID);

std::string ResultName =
(Twine(EEI->getNameOrAsOperand()) + "." + FullIntrinName).str();
std::string ResultName = (Twine(EEI->getName()) + "." + FullIntrinName).str();
Instruction *Inst = IntrinsicInst::Create(NewFDecl, {}, ResultName, EEI);
Inst->setDebugLoc(EEI->getDebugLoc());

if (IsVectorCall) {
Type *I32Ty = Type::getInt32Ty(EEI->getModule()->getContext());
std::string ExtractName =
(Twine(Inst->getNameOrAsOperand()) + ".ext." + Twine(IndexValue)).str();
(Twine(Inst->getName()) + ".ext." + Twine(IndexValue)).str();
Inst = ExtractElementInst::Create(Inst, ConstantInt::get(I32Ty, IndexValue),
ExtractName, EEI);
Inst->setDebugLoc(EEI->getDebugLoc());
Expand Down

0 comments on commit a618e1a

Please sign in to comment.