Skip to content

Commit a6a3160

Browse files
karolzwolakigcbot
authored andcommitted
Don't compare pointer types on opaque pointers in
`SOALayoutChecker::visitBitCastInst()` `SOALayoutChecker::visitBitCastInst()` assumed we're on typed pointers and tried to get pointer types, triggering LLVM assert on opaque pointers.
1 parent e3be8fe commit a6a3160

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

IGC/Compiler/CISACodeGen/LowerGEPForPrivMem.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,11 @@ bool SOALayoutChecker::checkUsers(Instruction &I) {
517517
}
518518

519519
bool SOALayoutChecker::visitBitCastInst(BitCastInst &BI) {
520-
if (BI.use_empty() || IsBitCastForLifetimeMark(&BI)) {
520+
// no sense in comparing pointer base types on opaque pointers
521+
if (BI.use_empty() || IsBitCastForLifetimeMark(&BI) || AreOpaquePointersEnabled()) {
521522
return true;
522523
}
523-
524+
// FIXME: remove this once we only support opaque pointers
524525
Type *baseT = GetBaseType(IGCLLVM::getNonOpaquePtrEltTy(BI.getType()), true);
525526
Type *sourceType = GetBaseType(IGCLLVM::getNonOpaquePtrEltTy(BI.getOperand(0)->getType()), true);
526527
if (baseT->isStructTy() || sourceType->isStructTy()) {

0 commit comments

Comments
 (0)