1 ; RUN: llc -o - -mtriple=x86_64-linux-gnu %s | FileCheck %s 2 3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 4 target triple = "x86_64-unknown-linux-gnu" 5 6 ; We should be able to bypass the load values to their corresponding 7 ; stores here. 8 9 ; CHECK-LABEL: foo 10 ; CHECK-DAG: movl %esi, -8(%rsp) 11 ; CHECK-DAG: movl %ecx, -16(%rsp) 12 ; CHECK-DAG: movl %edi, -4(%rsp) 13 ; CHECK-DAG: movl %edx, -12(%rsp) 14 ; CHECK: leal 15 ; CHECK: addl 16 ; CHECK: addl 17 ; CHECK: retq 18 19 define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d) { 20 entry: 21 %a0 = alloca i32 22 %a1 = alloca i32 23 %a2 = alloca i32 24 %a3 = alloca i32 25 store i32 %b, i32* %a1 26 store i32 %d, i32* %a3 27 store i32 %a, i32* %a0 28 store i32 %c, i32* %a2 29 %l0 = load i32, i32* %a0 30 %l1 = load i32, i32* %a1 31 %l2 = load i32, i32* %a2 32 %l3 = load i32, i32* %a3 33 %add0 = add nsw i32 %l0, %l1 34 %add1 = add nsw i32 %add0, %l2 35 %add2 = add nsw i32 %add1, %l3 36 ret i32 %add2 37 } 38