mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Don't modify MO while use_iterator is still pointing to it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3246176838
commit
69a0aa87f8
@ -242,13 +242,14 @@ bool MipsDAGToDAGISel::ReplaceUsesWithZeroReg(MachineRegisterInfo *MRI,
|
||||
|
||||
// Replace uses with ZeroReg.
|
||||
for (MachineRegisterInfo::use_iterator U = MRI->use_begin(DstReg),
|
||||
E = MRI->use_end(); U != E; ++U) {
|
||||
E = MRI->use_end(); U != E;) {
|
||||
MachineOperand &MO = U.getOperand();
|
||||
unsigned OpNo = U.getOperandNo();
|
||||
MachineInstr *MI = MO.getParent();
|
||||
++U;
|
||||
|
||||
// Do not replace if it is a phi's operand or is tied to def operand.
|
||||
if (MI->isPHI() || MI->isRegTiedToDefOperand(U.getOperandNo()) ||
|
||||
MI->isPseudo())
|
||||
if (MI->isPHI() || MI->isRegTiedToDefOperand(OpNo) || MI->isPseudo())
|
||||
continue;
|
||||
|
||||
MO.setReg(ZeroReg);
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
define void @zero_u(%struct.unaligned* nocapture %p) nounwind {
|
||||
entry:
|
||||
; CHECK: swl $zero
|
||||
; CHECK: swr $zero
|
||||
%x = getelementptr inbounds %struct.unaligned* %p, i32 0, i32 0
|
||||
store i32 0, i32* %x, align 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user