Skip to content

Commit 3275c8a

Browse files
jaladreipsigcbot
authored andcommitted
Handle selects and memsets in alloca tracking
Handle selects and memsets in alloca tracking
1 parent cca2a9f commit 3275c8a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

IGC/AdaptorCommon/LivenessUtils/AllocationLivenessAnalyzer.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,12 @@ static bool tryFindPointerOrigin(GetElementPtrInst *Ptr, SmallVectorImpl<Instruc
401401
return tryFindPointerOriginImpl(Ptr->getPointerOperand(), origins, cache);
402402
}
403403

404+
static bool tryFindPointerOrigin(SelectInst *Ptr, SmallVectorImpl<Instruction *> &origins,
405+
DenseSet<Value *> &cache) {
406+
return tryFindPointerOriginImpl(Ptr->getTrueValue(), origins, cache) &&
407+
tryFindPointerOriginImpl(Ptr->getFalseValue(), origins, cache);
408+
}
409+
404410
static bool tryFindPointerOriginImpl(Value *ptr, SmallVectorImpl<Instruction *> &origins, DenseSet<Value *> &cache) {
405411
if (!cache.insert(ptr).second)
406412
return true;
@@ -409,6 +415,10 @@ static bool tryFindPointerOriginImpl(Value *ptr, SmallVectorImpl<Instruction *>
409415
return tryFindPointerOrigin(GEP, origins, cache);
410416
}
411417

418+
if (auto *select = dyn_cast<SelectInst>(ptr)) {
419+
return tryFindPointerOrigin(select, origins, cache);
420+
}
421+
412422
if (auto *allocaI = dyn_cast<AllocaInst>(ptr)) {
413423
origins.push_back(allocaI);
414424
return true;

0 commit comments

Comments
 (0)