llvm-project/llvm/test/CodeGen/Hexagon/branchfolder-keep-impdef.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

30 lines
901 B
LLVM

; RUN: llc -mtriple=hexagon -verify-machineinstrs < %s | FileCheck %s
;
; Check that the testcase compiles successfully. Expect that if-conversion
; took place.
; CHECK-LABEL: fred:
; CHECK: if (!p0) r{{[0-9]+}} = memw(r{{[0-9]+}}+#0)
target triple = "hexagon"
define void @fred(i32 %p0) local_unnamed_addr align 2 {
b0:
br i1 undef, label %b1, label %b2
b1: ; preds = %b0
%t0 = load ptr, ptr undef, align 4
br label %b2
b2: ; preds = %b1, %b0
%t1 = phi ptr [ %t0, %b1 ], [ undef, %b0 ]
%t2 = getelementptr inbounds i8, ptr %t1, i32 %p0
tail call void @llvm.memmove.p0.p0.i32(ptr undef, ptr %t2, i32 undef, i1 false) #1
ret void
}
declare void @llvm.memmove.p0.p0.i32(ptr nocapture, ptr nocapture readonly, i32, i1) #0
attributes #0 = { argmemonly nounwind }
attributes #1 = { nounwind }