File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -307,13 +307,11 @@ bool DataScalarizerVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) {
307307 bool NeedsTransform = false ;
308308
309309 // Unwrap GEP ConstantExprs to find the base operand and element type
310- while (auto *CE = dyn_cast<ConstantExpr>(PtrOperand)) {
311- if (auto *GEPCE = dyn_cast<GEPOperator>(CE)) {
312- GOp = GEPCE;
313- PtrOperand = GEPCE->getPointerOperand ();
314- NewGEPType = GEPCE->getSourceElementType ();
315- } else
316- break ;
310+ while (auto *GEPCE = dyn_cast_or_null<GEPOperator>(
311+ dyn_cast<ConstantExpr>(PtrOperand))) {
312+ GOp = GEPCE;
313+ PtrOperand = GEPCE->getPointerOperand ();
314+ NewGEPType = GEPCE->getSourceElementType ();
317315 }
318316
319317 if (GlobalVariable *NewGlobal = lookupReplacementGlobal (PtrOperand)) {
You can’t perform that action at this time.
0 commit comments