1 ; RUN: llc -march=hexagon < %s | FileCheck %s 2 ; Check that the load/store to the volatile stack object has not been 3 ; optimized away. 4 5 target triple = "hexagon" 6 7 ; CHECK-LABEL: foo 8 ; CHECK: memw(r29+#4) = 9 ; CHECK: = memw(r29+#4) 10 define i32 @foo(i32 %a) #0 { 11 entry: 12 %x = alloca i32, align 4 13 %x.0.x.0..sroa_cast = bitcast i32* %x to i8* 14 call void @llvm.lifetime.start.p0i8(i64 4, i8* %x.0.x.0..sroa_cast) 15 store volatile i32 0, i32* %x, align 4 16 %call = tail call i32 bitcast (i32 (...)* @bar to i32 ()*)() #0 17 %x.0.x.0. = load volatile i32, i32* %x, align 4 18 %add = add nsw i32 %x.0.x.0., %a 19 call void @llvm.lifetime.end.p0i8(i64 4, i8* %x.0.x.0..sroa_cast) 20 ret i32 %add 21 } 22 23 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1 24 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1 25 26 declare i32 @bar(...) #0 27 28 attributes #0 = { nounwind } 29 attributes #1 = { argmemonly nounwind } 30