Index: lib/Target/ARM64/ARM64AddressTypePromotion.cpp =================================================================== --- lib/Target/ARM64/ARM64AddressTypePromotion.cpp +++ lib/Target/ARM64/ARM64AddressTypePromotion.cpp @@ -216,7 +216,7 @@ return false; for (const Use &U : SExt->uses()) { - if (isa(*U)) + if (isa(U.getUser())) return true; } @@ -287,7 +287,7 @@ // been moved yet. while (!Inst->use_empty()) { Value::use_iterator UseIt = Inst->use_begin(); - Instruction *UseInst = dyn_cast(*UseIt); + Instruction *UseInst = dyn_cast(UseIt->getUser()); assert(UseInst && "Use of sext is not an Instruction!"); UseInst->setOperand(UseIt->getOperandNo(), SExt); } @@ -438,7 +438,7 @@ bool insert = false; // #1. for (const Use &U : SExt->uses()) { - const Instruction *Inst = dyn_cast(U); + const Instruction *Inst = dyn_cast(U.getUser()); if (Inst && Inst->getNumOperands() > 2) { DEBUG(dbgs() << "Interesting use in GetElementPtrInst\n" << *Inst << '\n');