File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1142,9 +1142,9 @@ void OptimizeIR(CodeGenContext* pContext)
1142
1142
mpm.add (new BreakConstantExpr ());
1143
1143
mpm.add (new IGCConstProp (!pContext->m_DriverInfo .SupportsPreciseMath ()));
1144
1144
1145
+ mpm.add (new CustomSafeOptPass ());
1145
1146
if (!pContext->m_DriverInfo .WADisableCustomPass ())
1146
1147
{
1147
- mpm.add (new CustomSafeOptPass ());
1148
1148
mpm.add (new CustomUnsafeOptPass ());
1149
1149
}
1150
1150
@@ -1300,9 +1300,9 @@ void OptimizeIR(CodeGenContext* pContext)
1300
1300
mpm.add (CreateEarlyOutPatternsPass ());
1301
1301
mpm.add (createBlendToDiscardPass ());
1302
1302
}
1303
+ mpm.add (new CustomSafeOptPass ());
1303
1304
if (!pContext->m_DriverInfo .WADisableCustomPass ())
1304
1305
{
1305
- mpm.add (new CustomSafeOptPass ());
1306
1306
mpm.add (new CustomUnsafeOptPass ());
1307
1307
}
1308
1308
}
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ void CustomSafeOptPass::visitAllocaInst(AllocaInst &I)
186
186
if (GetElementPtrInst *pGEP = llvm::dyn_cast<GetElementPtrInst>(*it))
187
187
{
188
188
ConstantInt *C0 = dyn_cast<ConstantInt>(pGEP->getOperand (1 ));
189
- if (!C0 || !C0->isZero ())
189
+ if (!C0 || !C0->isZero () || pGEP-> getNumOperands () != 3 )
190
190
{
191
191
return ;
192
192
}
You can’t perform that action at this time.
0 commit comments