1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/CodeGen/Hexagon/find-loop-instr.ll
Sumanth Gundapaneni 262321d1ff [Hexagon] New HVX target features.
This patch lets the llvm tools handle the new HVX target features that
are added by frontend (clang). The target-features are of the form
"hvx-length64b" for 64 Byte HVX mode, "hvx-length128b" for 128 Byte mode HVX.
"hvx-double" is an alias to "hvx-length128b" and is soon will be deprecated.
The hvx version target feature is upgated form "+hvx" to "+hvxv{version_number}.
Eg: "+hvxv62"

For the correct HVX code generation, the user must use the following
target features.
For 64B mode: "+hvxv62" "+hvx-length64b"
For 128B mode: "+hvxv62" "+hvx-length128b"

Clang picks a default length if none is specified. If for some reason,
no hvx-length is specified to llvm, the compilation will bail out.
There is a corresponding clang patch.

Differential Revision: https://reviews.llvm.org/D38851

llvm-svn: 316101
2017-10-18 18:07:07 +00:00

80 lines
2.4 KiB
LLVM

; RUN: llc -march=hexagon < %s
; REQUIRES: asserts
; This code causes multiple endloop instructions to be generated for the
; same loop. The findLoopInstr would encounter for one endloop would encounter
; the other endloop, and return null in response. This resulted in a crash.
;
; Check that with the fix we are able to compile this code successfully.
target triple = "hexagon"
; Function Attrs: norecurse
define void @fred() local_unnamed_addr #0 align 2 {
b0:
br label %b7
b1: ; preds = %b9
br i1 undef, label %b4, label %b2
b2: ; preds = %b1
%v3 = sub i32 undef, undef
br label %b4
b4: ; preds = %b2, %b1
%v5 = phi i32 [ undef, %b1 ], [ %v3, %b2 ]
br i1 undef, label %b14, label %b6
b6: ; preds = %b4
br label %b10
b7: ; preds = %b0
br i1 undef, label %b9, label %b8
b8: ; preds = %b7
unreachable
b9: ; preds = %b7
br label %b1
b10: ; preds = %b21, %b6
%v11 = phi i32 [ %v22, %b21 ], [ %v5, %b6 ]
br i1 undef, label %b21, label %b12
b12: ; preds = %b10
br label %b15
b13: ; preds = %b21
br label %b14
b14: ; preds = %b13, %b4
ret void
b15: ; preds = %b12
br i1 undef, label %b16, label %b17
b16: ; preds = %b15
store i32 0, i32* undef, align 4
br label %b21
b17: ; preds = %b15
br label %b18
b18: ; preds = %b17
br i1 undef, label %b19, label %b20
b19: ; preds = %b18
br label %b21
b20: ; preds = %b18
store i32 0, i32* undef, align 4
br label %b21
b21: ; preds = %b20, %b19, %b16, %b10
%v22 = add i32 %v11, -8
%v23 = icmp eq i32 %v22, 0
br i1 %v23, label %b13, label %b10
}
attributes #0 = { norecurse "target-cpu"="hexagonv60" "target-features"="-hvx,-long-calls" }