brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 4021426 Raw
44 lines · plain
1; RUN: llc < %s -mtriple=x86_64-darwin -mcpu=generic | FileCheck %s2; XFAIL: *3; rdar:15661073 simple example of redundant adds4;5; MachineCSE should coalesce trivial subregister copies.6;7; The extra movl+addl should be removed during MachineCSE.8; CHECK-LABEL: redundantadd9; CHECK: cmpq10; CHECK: movq11; CHECK-NOT: movl12; CHECK: addl13; CHECK-NOT: addl14; CHECK: ret15 16define i64 @redundantadd(ptr %a0, ptr %a1) {17entry:18  %tmp8 = load i64, ptr %a0, align 819  %tmp12 = load i64, ptr %a1, align 820  %tmp13 = icmp ult i64 %tmp12, -28147497671065621  br i1 %tmp13, label %exit1, label %body22 23exit1:24  unreachable25 26body:27  %tmp14 = trunc i64 %tmp8 to i3228  %tmp15 = trunc i64 %tmp12 to i3229  %tmp16 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %tmp14, i32 %tmp15)30  %tmp17 = extractvalue { i32, i1 } %tmp16, 131  br i1 %tmp17, label %exit2, label %return32 33exit2:34  unreachable35 36return:37  %tmp18 = add i64 %tmp12, %tmp838  %tmp19 = and i64 %tmp18, 429496729539  %tmp20 = or i64 %tmp19, -28147497671065640  ret i64 %tmp2041}42 43declare { i32, i1 } @llvm.sadd.with.overflow.i32(i32, i32)44