140 lines · plain
1; RUN: llc -mtriple=hexagon < %s | FileCheck %s2 3target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"4target triple = "hexagon"5 6; CHECK-LABEL: test07; CHECK: memw(r29+#{{[0-9]+}}) += #18define void @test0() #0 {9entry:10 %x = alloca i32, align 411 call void @llvm.lifetime.start.p0(i64 4, ptr %x) #312 call void @foo(ptr nonnull %x) #313 %0 = load i32, ptr %x, align 4, !tbaa !114 %inc = add nsw i32 %0, 115 store i32 %inc, ptr %x, align 4, !tbaa !116 call void @foo(ptr nonnull %x) #317 call void @llvm.lifetime.end.p0(i64 4, ptr %x) #318 ret void19}20 21; CHECK-LABEL: test122; CHECK: memw(r29+#{{[0-9]+}}) -= #123define void @test1() #0 {24entry:25 %x = alloca i32, align 426 call void @llvm.lifetime.start.p0(i64 4, ptr %x) #327 call void @foo(ptr nonnull %x) #328 %0 = load i32, ptr %x, align 4, !tbaa !129 %inc = sub nsw i32 %0, 130 store i32 %inc, ptr %x, align 4, !tbaa !131 call void @foo(ptr nonnull %x) #332 call void @llvm.lifetime.end.p0(i64 4, ptr %x) #333 ret void34}35 36; CHECK-LABEL: test237; CHECK: memw(r29+#{{[0-9]+}}) = setbit(#0)38define void @test2() #0 {39entry:40 %x = alloca i32, align 441 call void @llvm.lifetime.start.p0(i64 4, ptr %x) #342 call void @foo(ptr nonnull %x) #343 %0 = load i32, ptr %x, align 4, !tbaa !144 %inc = or i32 %0, 145 store i32 %inc, ptr %x, align 4, !tbaa !146 call void @foo(ptr nonnull %x) #347 call void @llvm.lifetime.end.p0(i64 4, ptr %x) #348 ret void49}50 51; CHECK-LABEL: test352; CHECK: memw(r29+#{{[0-9]+}}) = clrbit(#0)53define void @test3() #0 {54entry:55 %x = alloca i32, align 456 call void @llvm.lifetime.start.p0(i64 4, ptr %x) #357 call void @foo(ptr nonnull %x) #358 %0 = load i32, ptr %x, align 4, !tbaa !159 %inc = and i32 %0, -260 store i32 %inc, ptr %x, align 4, !tbaa !161 call void @foo(ptr nonnull %x) #362 call void @llvm.lifetime.end.p0(i64 4, ptr %x) #363 ret void64}65 66; CHECK-LABEL: test467; CHECK: memw(r29+#{{[0-9]+}}) += r68define void @test4(i32 %a) #0 {69entry:70 %x = alloca i32, align 471 call void @llvm.lifetime.start.p0(i64 4, ptr %x) #372 call void @foo(ptr nonnull %x) #373 %0 = load i32, ptr %x, align 4, !tbaa !174 %inc = add nsw i32 %0, %a75 store i32 %inc, ptr %x, align 4, !tbaa !176 call void @foo(ptr nonnull %x) #377 call void @llvm.lifetime.end.p0(i64 4, ptr %x) #378 ret void79}80 81; CHECK-LABEL: test582; CHECK: memw(r29+#{{[0-9]+}}) -= r83define void @test5(i32 %a) #0 {84entry:85 %x = alloca i32, align 486 call void @llvm.lifetime.start.p0(i64 4, ptr %x) #387 call void @foo(ptr nonnull %x) #388 %0 = load i32, ptr %x, align 4, !tbaa !189 %inc = sub nsw i32 %0, %a90 store i32 %inc, ptr %x, align 4, !tbaa !191 call void @foo(ptr nonnull %x) #392 call void @llvm.lifetime.end.p0(i64 4, ptr %x) #393 ret void94}95 96; CHECK-LABEL: test697; CHECK: memw(r29+#{{[0-9]+}}) |= r98define void @test6(i32 %a) #0 {99entry:100 %x = alloca i32, align 4101 call void @llvm.lifetime.start.p0(i64 4, ptr %x) #3102 call void @foo(ptr nonnull %x) #3103 %0 = load i32, ptr %x, align 4, !tbaa !1104 %inc = or i32 %0, %a105 store i32 %inc, ptr %x, align 4, !tbaa !1106 call void @foo(ptr nonnull %x) #3107 call void @llvm.lifetime.end.p0(i64 4, ptr %x) #3108 ret void109}110 111; CHECK-LABEL: test7112; CHECK: memw(r29+#{{[0-9]+}}) &= r113define void @test7(i32 %a) #0 {114entry:115 %x = alloca i32, align 4116 call void @llvm.lifetime.start.p0(i64 4, ptr %x) #3117 call void @foo(ptr nonnull %x) #3118 %0 = load i32, ptr %x, align 4, !tbaa !1119 %inc = and i32 %0, %a120 store i32 %inc, ptr %x, align 4, !tbaa !1121 call void @foo(ptr nonnull %x) #3122 call void @llvm.lifetime.end.p0(i64 4, ptr %x) #3123 ret void124}125 126 127declare void @foo(ptr) #2128declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1129declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1130 131attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv60" "target-features"="+hvx,+hvx-length64b" "unsafe-fp-math"="false" "use-soft-float"="false" }132attributes #1 = { argmemonly nounwind }133attributes #2 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv60" "target-features"="+hvx,+hvx-length64b" "unsafe-fp-math"="false" "use-soft-float"="false" }134attributes #3 = { nounwind }135 136!1 = !{!2, !2, i64 0}137!2 = !{!"int", !3, i64 0}138!3 = !{!"omnipotent char", !4, i64 0}139!4 = !{!"Simple C/C++ TBAA"}140