1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
llvm-mirror/test/CodeGen/Hexagon/expand-condsets-dead-bad.ll
Krzysztof Parzyszek 90d780b0a6 [Hexagon] Mark dead defs as <dead> in expand-condsets
The code in updateDeadFlags removed unnecessary <dead> flags, but there
can be cases where such a flag is not set, and yet a register has become
dead. For example, if a mux with identical inputs is replaced with a COPY,
the predicate register may no longer be used after that.

llvm-svn: 297032
2017-03-06 17:09:06 +00:00

55 lines
1.5 KiB
LLVM

; RUN: llc -march=hexagon -verify-machineinstrs < %s | FileCheck %s
; REQUIRES: asserts
; Check for some output other than crashing.
; CHECK: bitsset
target triple = "hexagon"
; Function Attrs: nounwind
define void @fred() local_unnamed_addr #0 {
b0:
%v1 = load i32, i32* undef, align 4
%v2 = and i32 %v1, 603979776
%v3 = trunc i32 %v2 to i30
switch i30 %v3, label %b23 [
i30 -536870912, label %b4
i30 -469762048, label %b5
]
b4: ; preds = %b0
unreachable
b5: ; preds = %b0
%v6 = load i32, i32* undef, align 4
br i1 undef, label %b7, label %b8
b7: ; preds = %b5
br label %b9
b8: ; preds = %b5
br label %b9
b9: ; preds = %b8, %b7
%v10 = load i32, i32* undef, align 4
%v11 = load i32, i32* undef, align 4
%v12 = mul nsw i32 %v11, %v10
%v13 = ashr i32 %v12, 13
%v14 = mul nsw i32 %v13, %v13
%v15 = zext i32 %v14 to i64
%v16 = mul nsw i32 %v6, %v6
%v17 = zext i32 %v16 to i64
%v18 = lshr i64 %v17, 5
%v19 = select i1 undef, i64 %v18, i64 %v17
%v20 = mul nuw nsw i64 %v19, %v15
%v21 = trunc i64 %v20 to i32
%v22 = and i32 %v21, 2147483647
store i32 %v22, i32* undef, align 4
unreachable
b23: ; preds = %b0
ret void
}
attributes #0 = { nounwind "target-cpu"="hexagonv5" "target-features"="-hvx,-hvx-double,-long-calls" }