diff options
-rw-r--r-- | lib/Target/X86/InstSelectSimple.cpp | 3 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelSimple.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp index dd93142f64..e35867df00 100644 --- a/lib/Target/X86/InstSelectSimple.cpp +++ b/lib/Target/X86/InstSelectSimple.cpp @@ -1092,7 +1092,8 @@ ISel::visitAllocaInst (AllocaInst &I) unsigned int allocatedTypeWords = allocatedTypeSize / 4; if (allocatedTypeSize % 4 != 0) { allocatedTypeWords++; } // Subtract size from stack pointer, thereby allocating some space. - BuildMI (BB, X86::SUBri32, 1, X86::ESP).addZImm (allocatedTypeWords * 4); + BuildMI(BB, X86::SUBri32, 2, + X86::ESP).addReg(X86::ESP).addZImm(allocatedTypeWords * 4); // Put a pointer to the space into the result register, by copying // the stack pointer. BuildMI (BB, X86::MOVrr32, 1, getReg (I)).addReg (X86::ESP); diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp index dd93142f64..e35867df00 100644 --- a/lib/Target/X86/X86ISelSimple.cpp +++ b/lib/Target/X86/X86ISelSimple.cpp @@ -1092,7 +1092,8 @@ ISel::visitAllocaInst (AllocaInst &I) unsigned int allocatedTypeWords = allocatedTypeSize / 4; if (allocatedTypeSize % 4 != 0) { allocatedTypeWords++; } // Subtract size from stack pointer, thereby allocating some space. - BuildMI (BB, X86::SUBri32, 1, X86::ESP).addZImm (allocatedTypeWords * 4); + BuildMI(BB, X86::SUBri32, 2, + X86::ESP).addReg(X86::ESP).addZImm(allocatedTypeWords * 4); // Put a pointer to the space into the result register, by copying // the stack pointer. BuildMI (BB, X86::MOVrr32, 1, getReg (I)).addReg (X86::ESP); |