1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=instcombine -S < %s | FileCheck %s
4 ; Check that load to load forwarding works with non aliasing store inbetween.
5 define i32 @test_load_store_load_combine(ptr, ptr) {
6 ; CHECK-LABEL: @test_load_store_load_combine(
7 ; CHECK-NEXT: [[A:%.*]] = load i32, ptr [[TMP0:%.*]], align 4, !tbaa [[TBAA0:![0-9]+]]
8 ; CHECK-NEXT: [[F:%.*]] = sitofp i32 [[A]] to float
9 ; CHECK-NEXT: store float [[F]], ptr [[TMP1:%.*]], align 4, !tbaa [[TBAA4:![0-9]+]]
10 ; CHECK-NEXT: ret i32 [[A]]
12 %a = load i32, ptr %0, align 4, !tbaa !0
13 %f = sitofp i32 %a to float
14 store float %f, ptr %1, align 4, !tbaa !4
15 %b = load i32, ptr %0, align 4, !tbaa !0
20 !1 = !{!"int", !2, i64 0}
21 !2 = !{!"omnipotent char", !3, i64 0}
22 !3 = !{!"Simple C++ TBAA"}
24 !5 = !{!"float", !2, i64 0}