llvm-project/llvm/test/CodeGen/Hexagon/avoid-predspill-calleesaved.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

49 lines
1.5 KiB
LLVM

; Check that a callee-saved register will be saved correctly if
; the predicate-to-GPR spilling code uses it.
;
; RUN: llc -mtriple=hexagon -hexagon-initial-cfg-cleanup=0 < %s | FileCheck %s
;
; We expect to spill p0 into a general-purpose register and keep it there,
; without adding an extra spill of that register.
;
; CHECK: PredSpill:
; CHECK-DAG: r{{[0-9]+}} = p0
; CHECK-DAG: p0 = r{{[0-9]+}}
; CHECK-NOT: = memw(r29
;
define void @PredSpill() {
entry:
br i1 undef, label %if.then, label %if.else.14
if.then: ; preds = %entry
br i1 undef, label %if.end.57, label %if.else
if.else: ; preds = %if.then
unreachable
if.else.14: ; preds = %entry
br i1 undef, label %if.then.17, label %if.end.57
if.then.17: ; preds = %if.else.14
br i1 undef, label %if.end.57, label %if.then.20
if.then.20: ; preds = %if.then.17
%call21 = tail call i32 @myfun()
%tobool22 = icmp eq i32 %call21, 0
%0 = tail call i32 @myfun()
br i1 %tobool22, label %if.else.42, label %if.then.23
if.then.23: ; preds = %if.then.20
unreachable
if.else.42: ; preds = %if.then.20
ret void
if.end.57: ; preds = %if.then.17, %if.else.14, %if.then
ret void
}
declare i32 @myfun()