summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-22 06:54:26 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-22 06:54:26 +0000
commitf216421181393fd3993b47960de44ad448710fb9 (patch)
treeae500df3a6ec6e27fc001ca49de19f2734bc30a1 /lib
parent2425f8c62931f6ab127784adbf6f52bc8c684113 (diff)
downloadllvm-f216421181393fd3993b47960de44ad448710fb9.tar.gz
When folding memory operands in machine instructions be careful to
leave register operands with the same use/def flags as the original instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86RegisterInfo.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp
index 6479ad56a7ec..d97b52953153 100644
--- a/lib/Target/X86/X86RegisterInfo.cpp
+++ b/lib/Target/X86/X86RegisterInfo.cpp
@@ -112,13 +112,15 @@ static MachineInstr *MakeMIInst(unsigned Opcode, unsigned FrameIndex,
static MachineInstr *MakeRMInst(unsigned Opcode, unsigned FrameIndex,
MachineInstr *MI) {
- return addFrameReference(BuildMI(Opcode, 5, MI->getOperand(0).getReg()),
+ const MachineOperand& op = MI->getOperand(0);
+ return addFrameReference(BuildMI(Opcode, 5, op.getReg(), op.getUseType()),
FrameIndex);
}
static MachineInstr *MakeRMIInst(unsigned Opcode, unsigned FrameIndex,
MachineInstr *MI) {
- return addFrameReference(BuildMI(Opcode, 5, MI->getOperand(0).getReg()),
+ const MachineOperand& op = MI->getOperand(0);
+ return addFrameReference(BuildMI(Opcode, 5, op.getReg(), op.getUseType()),
FrameIndex).addZImm(MI->getOperand(2).getImmedValue());
}