Index: src/IceTargetLoweringX86BaseImpl.h |
diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h |
index 435332bbef78b3c474ec461a2d94a0472f73e45d..bcbc3ced817194c64689b8d51b0559c8d517c881 100644 |
--- a/src/IceTargetLoweringX86BaseImpl.h |
+++ b/src/IceTargetLoweringX86BaseImpl.h |
@@ -2283,7 +2283,9 @@ void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Instr) { |
T_edx = makeReg(Ty, Edx); |
_mov(T, Src0, Eax); |
_mov(T_edx, Ctx->getConstantZero(Ty)); |
- _div(T, Src1, T_edx); |
+ _div(T_edx, Src1, T); |
+ Context.insert<InstFakeDef>(T, T_edx); |
+ _set_dest_redefined(); |
_mov(Dest, T); |
} break; |
case InstArithmetic::Sdiv: |
@@ -2343,7 +2345,9 @@ void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Instr) { |
break; |
} |
_cbwdq(T_edx, T); |
- _idiv(T, Src1, T_edx); |
+ _idiv(T_edx, Src1, T); |
+ Context.insert<InstFakeDef>(T, T_edx); |
John
2016/07/19 03:18:19
can you use the _redefined method here?
_redefine
Jim Stichnoth
2016/07/19 13:35:35
Done.
|
+ _set_dest_redefined(); |
_mov(Dest, T); |
break; |
case InstArithmetic::Urem: { |
@@ -2373,7 +2377,9 @@ void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Instr) { |
T_edx = makeReg(Ty, Edx); |
_mov(T_edx, Ctx->getConstantZero(Ty)); |
_mov(T, Src0, Eax); |
- _div(T_edx, Src1, T); |
+ _div(T, Src1, T_edx); |
+ Context.insert<InstFakeDef>(T_edx, T); |
+ _set_dest_redefined(); |
if (Ty == IceType_i8) { |
// Register ah must be moved into one of {al,bl,cl,dl} before it can be |
// moved into a general 8-bit register. |
@@ -2450,7 +2456,9 @@ void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Instr) { |
T_edx = makeReg(Ty, Edx); |
_mov(T, Src0, Eax); |
_cbwdq(T_edx, T); |
- _idiv(T_edx, Src1, T); |
+ _idiv(T, Src1, T_edx); |
+ Context.insert<InstFakeDef>(T_edx, T); |
+ _set_dest_redefined(); |
if (Ty == IceType_i8) { |
// Register ah must be moved into one of {al,bl,cl,dl} before it can be |
// moved into a general 8-bit register. |