summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2013-01-03 06:40:20 +0000
committerCraig Topper <craig.topper@gmail.com>2013-01-03 06:40:20 +0000
commit7c27cc9fd03803f5766079e0089b03a733b72b70 (patch)
tree131f537ddc171ad557d612e08dcf3587ac78d02b /llvm/lib/Target
parentc8c12bc0ff9c9563a2b101b639948ca3629d949f (diff)
downloadbcm5719-llvm-7c27cc9fd03803f5766079e0089b03a733b72b70.tar.gz
bcm5719-llvm-7c27cc9fd03803f5766079e0089b03a733b72b70.zip
Mark DIV/IDIV instructions hasSideEffects=1 because they can trap when dividing by 0. This is needed to keep early if conversion from moving them across basic blocks.
llvm-svn: 171461
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86InstrArithmetic.td2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86InstrArithmetic.td b/llvm/lib/Target/X86/X86InstrArithmetic.td
index d56763ea9d2..3540fc31257 100644
--- a/llvm/lib/Target/X86/X86InstrArithmetic.td
+++ b/llvm/lib/Target/X86/X86InstrArithmetic.td
@@ -266,7 +266,7 @@ def IMUL64rmi8 : RIi8<0x6B, MRMSrcMem, // GR64 = [mem64]*I8
// unsigned division/remainder
-let hasSideEffects = 0 in {
+let hasSideEffects = 1 in { // so that we don't speculatively execute
let Defs = [AL,EFLAGS,AX], Uses = [AX] in
def DIV8r : I<0xF6, MRM6r, (outs), (ins GR8:$src), // AX/r8 = AL,AH
"div{b}\t$src", [], IIC_DIV8_REG>;
OpenPOWER on IntegriCloud