llvm.org GIT mirror llvm / e7f8191
Allow AArch64FastISel to degrade graceully in the presence of an MVT::i128 Currently AArch64FastISel crashes if it tries to extend an integer into an MVT::i128. This can happen by creating 128 bit integers like so: typedef unsigned int uint128_t __attribute__((mode(TI))); typedef int sint128_t __attribute__((mode(TI))); This patch makes EmitIntExt check for their presence and then falls back to SelectionDAG. Tests included. rdar://17516686 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212492 91177308-0d34-0410-b5e6-96231b3b80d8 Louis Gerbarg 6 years ago
2 changed file(s) with 24 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
17491749 unsigned AArch64FastISel::EmitIntExt(MVT SrcVT, unsigned SrcReg, MVT DestVT,
17501750 bool isZExt) {
17511751 assert(DestVT != MVT::i1 && "ZeroExt/SignExt an i1?");
1752
1753 // FastISel does not have plumbing to deal with an MVT::i128, if we see one
1754 // so rather than return one we need to bail out to SelectionDAG.
1755 if (DestVT == MVT::i128)
1756 return 0;
1757
17521758 unsigned Opc;
17531759 unsigned Imm = 0;
17541760
0 ; RUN: llc -O0 -mtriple=arm64-apple-ios7.0 -mcpu=generic < %s | FileCheck %s
1
2 ; Function Attrs: nounwind ssp
3 define void @test1() {
4 %1 = sext i32 0 to i128
5 call void @test2(i128 %1)
6 ret void
7
8 ; The i128 is 0 so the we can test to make sure it is propogated into the x
9 ; registers that make up the i128 pair
10
11 ; CHECK: mov x0, xzr
12 ; CHECK: mov x1, x0
13 ; CHECK: bl _test2
14
15 }
16
17 declare void @test2(i128)