; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 ; RUN: opt < %s -data-layout="e-p:32:32:32-p1:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-n8:16:32" -passes=gvn,dce -S | FileCheck %s --check-prefixes=CHECK,MDEP ; RUN: opt < %s -data-layout="e-p:32:32:32-p1:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-n8:16:32" -passes='gvn',dce -S | FileCheck %s --check-prefixes=CHECK,MSSA define i8 @coerce_offset0_addrspacecast(i32 %V, ptr %P) { ; CHECK-LABEL: define i8 @coerce_offset0_addrspacecast( ; CHECK-SAME: i32 [[V:%.*]], ptr [[P:%.*]]) { ; CHECK-NEXT: store i32 [[V]], ptr [[P]], align 4 ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[V]], 16 ; CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i8 ; CHECK-NEXT: ret i8 [[TMP2]] ; store i32 %V, ptr %P %P2 = addrspacecast ptr %P to ptr addrspace(1) %P3 = getelementptr i8, ptr addrspace(1) %P2, i32 2 %A = load i8, ptr addrspace(1) %P3 ret i8 %A } ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; MDEP: {{.*}} ; MSSA: {{.*}}