llvm-project/llvm/test/CodeGen/Hexagon/bit-bitsplit-at.ll
Fangrui Song 2208c97c1b [Hexagon,test] Change llc -march= to -mtriple=
Similar to 806761a7629df268c8aed49657aeccffa6bca449

-mtriple= specifies the full target triple while -march= merely sets the
architecture part of the default target triple, leaving a target triple which
may not make sense.

Therefore, -march= is error-prone and not recommended for tests without a target
triple. The issue has been benign as we recognize $unknown-apple-darwin as ELF instead
of rejecting it outrightly.
2024-12-15 10:20:22 -08:00

34 lines
934 B
LLVM

; RUN: llc -mtriple=hexagon < %s | FileCheck %s
; REQUIRES: asserts
; This testcase used to crash due to putting the bitsplit instruction in a
; wrong place.
; CHECK: bitsplit
target triple = "hexagon"
define fastcc i32 @fred(i32 %a0, ptr %a1, i1 %a2, i1 %a3) #0 {
b1:
%v2 = lshr i32 %a0, 16
%v3 = trunc i32 %v2 to i8
br i1 %a2, label %b6, label %b4
b4: ; preds = %b1
%v5 = and i32 %a0, 65535
br i1 %a3, label %b8, label %b9
b6: ; preds = %b1
%v7 = and i32 %a0, 65535
br label %b9
b8: ; preds = %b4
store i8 %v3, ptr %a1, align 2
ret i32 1
b9: ; preds = %b6, %b4
%v10 = phi i32 [ %v7, %b6 ], [ %v5, %b4 ]
ret i32 %v10
}
attributes #0 = { nounwind optsize "target-cpu"="hexagonv60" "target-features"="-hvx,-long-calls" }