65 lines · plain
1; RUN: llc -mtriple=hexagon -hexagon-initial-cfg-cleanup=0 < %s | FileCheck %s2; REQUIRES: asserts3 4; This used to crash. Check for some sane output.5; CHECK: sath6 7target triple = "hexagon"8 9define void @fred() local_unnamed_addr #0 {10b0:11 %v1 = load i32, ptr undef, align 412 %v2 = tail call i32 @llvm.hexagon.A2.sath(i32 undef)13 %v3 = and i32 %v1, 60397977614 %v4 = trunc i32 %v3 to i3015 switch i30 %v4, label %b22 [16 i30 -536870912, label %b517 i30 -469762048, label %b618 ]19 20b5: ; preds = %b021 unreachable22 23b6: ; preds = %b024 %v7 = load i32, ptr undef, align 425 %v8 = sub nsw i32 65536, %v726 %v9 = load i32, ptr undef, align 427 %v10 = mul nsw i32 %v9, %v928 %v11 = zext i32 %v10 to i6429 %v12 = mul nsw i32 %v2, %v830 %v13 = sext i32 %v12 to i6431 %v14 = mul nsw i64 %v13, %v1132 %v15 = trunc i64 %v14 to i3233 %v16 = and i32 %v15, 214748364734 store i32 %v16, ptr undef, align 435 %v17 = lshr i64 %v14, 3136 %v18 = trunc i64 %v17 to i3237 store i32 %v18, ptr undef, align 438 br label %b1939 40b19: ; preds = %b641 br i1 undef, label %b20, label %b2142 43b20: ; preds = %b1944 unreachable45 46b21: ; preds = %b1947 br label %b2348 49b22: ; preds = %b050 unreachable51 52b23: ; preds = %b2153 %v24 = load i32, ptr undef, align 454 %v25 = shl i32 %v24, 155 %v26 = and i32 %v25, 6553456 %v27 = or i32 %v26, 057 store i32 %v27, ptr undef, align 458 ret void59}60 61declare i32 @llvm.hexagon.A2.sath(i32) #162 63attributes #0 = { nounwind "target-cpu"="hexagonv5" "target-features"="-hvx,-long-calls" }64attributes #1 = { nounwind readnone }65