1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -passes=newgvn -S < %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:4"
5 target triple = "x86_64-unknown-linux-gnu"
7 define void @f0(i1 %alwaysFalse, i64 %val, ptr %loc) {
8 ; CHECK-LABEL: define void @f0(
9 ; CHECK-SAME: i1 [[ALWAYSFALSE:%.*]], i64 [[VAL:%.*]], ptr [[LOC:%.*]]) {
11 ; CHECK-NEXT: store i64 [[VAL]], ptr [[LOC]], align 8
12 ; CHECK-NEXT: br i1 [[ALWAYSFALSE]], label [[NEVERTAKEN:%.*]], label [[ALWAYSTAKEN:%.*]]
14 ; CHECK-NEXT: [[PTR:%.*]] = load ptr addrspace(4), ptr [[LOC]], align 8
15 ; CHECK-NEXT: store i8 5, ptr addrspace(4) [[PTR]], align 1
16 ; CHECK-NEXT: ret void
18 ; CHECK-NEXT: ret void
21 store i64 %val, ptr %loc
22 br i1 %alwaysFalse, label %neverTaken, label %alwaysTaken
25 %ptr = load ptr addrspace(4), ptr %loc
26 store i8 5, ptr addrspace(4) %ptr
33 define i64 @f1(i1 %alwaysFalse, ptr addrspace(4) %val, ptr %loc) {
34 ; CHECK-LABEL: define i64 @f1(
35 ; CHECK-SAME: i1 [[ALWAYSFALSE:%.*]], ptr addrspace(4) [[VAL:%.*]], ptr [[LOC:%.*]]) {
37 ; CHECK-NEXT: store ptr addrspace(4) [[VAL]], ptr [[LOC]], align 8
38 ; CHECK-NEXT: br i1 [[ALWAYSFALSE]], label [[NEVERTAKEN:%.*]], label [[ALWAYSTAKEN:%.*]]
40 ; CHECK-NEXT: [[INT:%.*]] = load i64, ptr [[LOC]], align 8
41 ; CHECK-NEXT: ret i64 [[INT]]
43 ; CHECK-NEXT: ret i64 42
46 store ptr addrspace(4) %val, ptr %loc
47 br i1 %alwaysFalse, label %neverTaken, label %alwaysTaken
50 %int = load i64, ptr %loc