1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -tbaa -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(i32*, float*) {
6 ; CHECK-LABEL: @test_load_store_load_combine(
7 ; CHECK-NEXT: [[A:%.*]] = load i32, i32* [[TMP0:%.*]], align 4, !tbaa [[TBAA0:![0-9]+]]
8 ; CHECK-NEXT: [[F:%.*]] = sitofp i32 [[A]] to float
9 ; CHECK-NEXT: store float [[F]], float* [[TMP1:%.*]], align 4, !tbaa [[TBAA4:![0-9]+]]
10 ; CHECK-NEXT: ret i32 [[A]]
12 %a = load i32, i32* %0, align 4, !tbaa !0
13 %f = sitofp i32 %a to float
14 store float %f, float* %1, align 4, !tbaa !4
15 %b = load i32, i32* %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}