1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
llvm-mirror/test/CodeGen/AArch64/aarch64-vcvtfp2fxs-combine.ll
Silviu Baranga 77684f300a [AArch64] PR28877: Don't assume we're running after legalization when creating vcvtfp2fxs
Summary:
The DAG combine transformation that was generating the
aarch64_neon_vcvtfp2fxs node was assuming that all
inputs where legal and wasn't accounting that the input
could be a v4f64 if we're trying to do the transformation
before legalization. We now bail out in this case.

All illegal types besides v4f64 were already rejected.

Fixes https://llvm.org/bugs/show_bug.cgi?id=28877.

Reviewers: jmolloy

Subscribers: aemerson, rengolin, llvm-commits

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

llvm-svn: 278002
2016-08-08 13:13:57 +00:00

25 lines
853 B
LLVM

; RUN: llc < %s -mtriple=aarch64-linux-eabi -o - | FileCheck %s
%struct.a= type { i64, i64, i64, i64 }
; DAG combine will try to perform a transformation that creates a vcvtfp2fxs
; with a v4f64 input. Since v4i64 is not legal we should bail out. We can
; pottentially still create the vcvtfp2fxs node after legalization (but on a
; v2f64).
; CHECK-LABEL: fun1
define void @fun1() local_unnamed_addr {
entry:
%mul = fmul <4 x double> zeroinitializer, <double 6.553600e+04, double 6.553600e+04, double 6.553600e+04, double 6.553600e+04>
%toi = fptosi <4 x double> %mul to <4 x i64>
%ptr = getelementptr inbounds %struct.a, %struct.a* undef, i64 0, i32 2
%elem = extractelement <4 x i64> %toi, i32 1
store i64 %elem, i64* %ptr, align 8
call void @llvm.trap()
unreachable
}
; Function Attrs: noreturn nounwind
declare void @llvm.trap()