1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -early-cse -opaque-pointers < %s | FileCheck %s
4 define i32 @different_types_load(ptr %p) {
5 ; CHECK-LABEL: @different_types_load(
6 ; CHECK-NEXT: [[V1:%.*]] = load i32, ptr [[P:%.*]], align 4
7 ; CHECK-NEXT: [[V2:%.*]] = load i64, ptr [[P]], align 4
8 ; CHECK-NEXT: [[V2_C:%.*]] = trunc i64 [[V2]] to i32
9 ; CHECK-NEXT: [[SUB:%.*]] = sub i32 [[V1]], [[V2_C]]
10 ; CHECK-NEXT: ret i32 [[SUB]]
12 %v1 = load i32, ptr %p
13 %v2 = load i64, ptr %p
14 %v2.c = trunc i64 %v2 to i32
15 %sub = sub i32 %v1, %v2.c
19 define i32 @different_types_store(ptr %p, i32 %a) {
20 ; CHECK-LABEL: @different_types_store(
21 ; CHECK-NEXT: store i32 [[A:%.*]], ptr [[P:%.*]], align 4
22 ; CHECK-NEXT: [[V2:%.*]] = load i64, ptr [[P]], align 4
23 ; CHECK-NEXT: [[V2_C:%.*]] = trunc i64 [[V2]] to i32
24 ; CHECK-NEXT: [[SUB:%.*]] = sub i32 [[A]], [[V2_C]]
25 ; CHECK-NEXT: ret i32 [[SUB]]
28 %v2 = load i64, ptr %p
29 %v2.c = trunc i64 %v2 to i32
30 %sub = sub i32 %a, %v2.c