1 ; RUN: llc < %s | FileCheck %s
3 ; Test to make sure that if math that can roll over has been used we don't
4 ; use the potential overflow as the basis for an address calculation later by
5 ; sinking it into a different basic block.
7 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
8 target triple = "x86_64-apple-macosx10.9.0"
10 ; Function Attrs: nounwind ssp uwtable
11 define void @test_sink(ptr %arg1, i32 %arg2, i8 %arg3) #0 {
12 %tmp1 = add i32 -2147483648, %arg2
13 %tmp2 = add i32 -2147483648, %tmp1
14 %tmp3 = getelementptr i8, ptr %arg1, i32 %arg2
18 %tmp4 = getelementptr i8, ptr %arg1, i32 %tmp2
19 store i8 %arg3, ptr %tmp4
23 ; CHECK-LABEL: test_sink:
24 ; CHECK: movslq %esi, [[TEMP:%[a-z0-9]+]]
25 ; CHECK: movb %dl, (%rdi,[[TEMP]])