Skip to content

Commit fdfad43

Browse files
apronin-inteligcbot
authored andcommitted
Fix early return on GenXPromoteArray
Early return could allow some bad allocas pass candidate checks.
1 parent c73367e commit fdfad43

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXPromoteArray.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,10 @@ static bool CheckAllocaUsesInternal(Instruction *I) {
507507
// Not a candidate.
508508
return false;
509509
} else if (PtrToIntInst *PTI = dyn_cast<PtrToIntInst>(*use_it)) {
510-
return CheckPtrToIntCandidate(PTI);
510+
if (CheckPtrToIntCandidate(PTI))
511+
continue;
512+
// Not a candidate.
513+
return false;
511514
} else if (IntrinsicInst *intr = dyn_cast<IntrinsicInst>(*use_it)) {
512515
auto IID = GenXIntrinsic::getAnyIntrinsicID(intr);
513516
if (IID == llvm::Intrinsic::lifetime_start ||

0 commit comments

Comments
 (0)