Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -0,0 +1,15 @@
; RUN: llc -march=hexagon < %s
; Used to fail with "Cannot select: 0x17300f0: v2i32 = any_extend"
; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout =
"e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-a0:0-n32"
target triple = "hexagon-unknown-linux-gnu"
define void @foo() nounwind {
entry:
%_p_vec_full48 = load <4 x i8>, <4 x i8>* undef, align 8
%0 = zext <4 x i8> %_p_vec_full48 to <4 x i32>
store <4 x i32> %0, <4 x i32>* undef, align 8
unreachable
}

View File

@@ -0,0 +1,27 @@
; RUN: llc -march=hexagon < %s
; Used to fail with "Invalid APInt Truncate request".
; Used to fail with "Cannot select: 0x596010: v2i32 = sign_extend_inreg".
; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-a0:0-n32"
target triple = "hexagon-unknown-linux-gnu"
define void @foo() nounwind {
entry:
br label %polly.loop_header
polly.loop_after: ; preds = %polly.loop_header
unreachable
polly.loop_header: ; preds = %polly.loop_body, %entry
%0 = icmp sle i32 undef, 63
br i1 %0, label %polly.loop_body, label %polly.loop_after
polly.loop_body: ; preds = %polly.loop_header
%_p_vec_full = load <4 x i8>, <4 x i8>* undef, align 8
%1 = sext <4 x i8> %_p_vec_full to <4 x i32>
%p_vec = mul <4 x i32> %1, <i32 3, i32 3, i32 3, i32 3>
%mulp_vec = add <4 x i32> %p_vec, <i32 21, i32 21, i32 21, i32 21>
store <4 x i32> %mulp_vec, <4 x i32>* undef, align 8
br label %polly.loop_header
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,68 @@
; RUN: llc -march=hexagon < %s
; REQUIRES: asserts
; Used to fail with: Assertion `VT.getSizeInBits() == Operand.getValueType().getSizeInBits() && "Cannot BITCAST between types of different sizes!"' failed.
target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-a0:0-n32"
target triple = "hexagon-unknown-linux-gnu"
define void @foo() nounwind {
entry:
br label %while.body
while.body: ; preds = %if.then155, %if.then12, %entry
%cmp.i = icmp eq i8* undef, null
br i1 %cmp.i, label %lab_ci.exit, label %if.end.i
if.end.i: ; preds = %while.body
unreachable
lab_ci.exit: ; preds = %while.body
br i1 false, label %if.then, label %if.else
if.then: ; preds = %lab_ci.exit
unreachable
if.else: ; preds = %lab_ci.exit
br i1 undef, label %if.then12, label %if.else17
if.then12: ; preds = %if.else
br label %while.body
if.else17: ; preds = %if.else
br i1 false, label %if.then22, label %if.else35
if.then22: ; preds = %if.else17
unreachable
if.else35: ; preds = %if.else17
br i1 false, label %if.then40, label %if.else83
if.then40: ; preds = %if.else35
unreachable
if.else83: ; preds = %if.else35
br i1 false, label %if.then88, label %if.else150
if.then88: ; preds = %if.else83
unreachable
if.else150: ; preds = %if.else83
%cmp154 = icmp eq i32 undef, 0
br i1 %cmp154, label %if.then155, label %if.else208
if.then155: ; preds = %if.else150
%call191 = call i32 @strtol() nounwind
%conv192 = trunc i32 %call191 to i16
%_p_splat_one = insertelement <1 x i16> undef, i16 %conv192, i32 0
%_p_splat = shufflevector <1 x i16> %_p_splat_one, <1 x i16> undef, <2 x i32> zeroinitializer
%0 = sext <2 x i16> %_p_splat to <2 x i32>
%mul198p_vec = shl <2 x i32> %0, <i32 2, i32 2>
%1 = extractelement <2 x i32> %mul198p_vec, i32 0
store i32 %1, i32* null, align 4
br label %while.body
if.else208: ; preds = %if.else150
unreachable
}
declare i32 @strtol() nounwind

View File

@@ -0,0 +1,56 @@
; RUN: llc -march=hexagon < %s
; REQUIRES: asserts
; Used to fail with "Cannot BITCAST between types of different sizes!"
target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
target triple = "hexagon"
define void @foo() nounwind {
entry:
br label %while.body
while.body: ; preds = %if.then155, %if.then12, %if.then, %entry
br i1 undef, label %if.then, label %if.else
if.then: ; preds = %while.body
br label %while.body
if.else: ; preds = %while.body
br i1 undef, label %if.then12, label %if.else17
if.then12: ; preds = %if.else
br label %while.body
if.else17: ; preds = %if.else
br i1 false, label %if.then22, label %if.else35
if.then22: ; preds = %if.else17
unreachable
if.else35: ; preds = %if.else17
br i1 false, label %if.then40, label %if.else83
if.then40: ; preds = %if.else35
unreachable
if.else83: ; preds = %if.else35
br i1 false, label %if.then88, label %if.else150
if.then88: ; preds = %if.else83
unreachable
if.else150: ; preds = %if.else83
%cmp154 = icmp eq i32 undef, 0
br i1 %cmp154, label %if.then155, label %if.else208
if.then155: ; preds = %if.else150
%_p_splat.1 = shufflevector <1 x i16> zeroinitializer, <1 x i16> undef, <2 x i32> zeroinitializer
%0 = sext <2 x i16> %_p_splat.1 to <2 x i32>
%mul198p_vec.1 = mul <2 x i32> %0, <i32 4, i32 4>
%1 = extractelement <2 x i32> %mul198p_vec.1, i32 0
store i32 %1, i32* undef, align 4
br label %while.body
if.else208: ; preds = %if.else150
unreachable
}

View File

@@ -0,0 +1,32 @@
; XFAIL: *
; Extract selecting of a constant into a generic utility function.
;
; RUN: llc -march=hexagon -mcpu=hexagonv5 -disable-hsdr < %s | FileCheck %s
; This one should generate a combine with two immediates.
; CHECK: combine(#7,#7)
@B = common global [400 x i32] zeroinitializer, align 8
@A = common global [400 x i32] zeroinitializer, align 8
@C = common global [400 x i32] zeroinitializer, align 8
define void @run() nounwind {
entry:
br label %polly.loop_body
polly.loop_after: ; preds = %polly.loop_body
ret void
polly.loop_body: ; preds = %entry, %polly.loop_body
%polly.loopiv23 = phi i32 [ 0, %entry ], [ %polly.next_loopiv, %polly.loop_body ]
%polly.next_loopiv = add nsw i32 %polly.loopiv23, 4
%p_arrayidx1 = getelementptr [400 x i32], [400 x i32]* @A, i32 0, i32 %polly.loopiv23
%p_arrayidx = getelementptr [400 x i32], [400 x i32]* @B, i32 0, i32 %polly.loopiv23
%vector_ptr = bitcast i32* %p_arrayidx to <4 x i32>*
%_p_vec_full = load <4 x i32>, <4 x i32>* %vector_ptr, align 8
%mulp_vec = mul <4 x i32> %_p_vec_full, <i32 7, i32 7, i32 7, i32 7>
%vector_ptr12 = bitcast i32* %p_arrayidx1 to <4 x i32>*
%_p_vec_full13 = load <4 x i32>, <4 x i32>* %vector_ptr12, align 8
%addp_vec = add <4 x i32> %_p_vec_full13, %mulp_vec
store <4 x i32> %addp_vec, <4 x i32>* %vector_ptr12, align 8
%0 = icmp slt i32 %polly.next_loopiv, 400
br i1 %0, label %polly.loop_body, label %polly.loop_after
}

View File

@@ -0,0 +1,30 @@
; RUN: llc -march=hexagon -mcpu=hexagonv5 < %s | FileCheck %s
; Make sure we can build the constant vector <1, 2, 3, 4>
; CHECK-DAG: ##B
; CHECK-DAG: ##A
@B = common global [400 x i8] zeroinitializer, align 8
@A = common global [400 x i8] zeroinitializer, align 8
@C = common global [400 x i8] zeroinitializer, align 8
define void @run() nounwind {
entry:
br label %polly.loop_body
polly.loop_after: ; preds = %polly.loop_body
ret void
polly.loop_body: ; preds = %entry, %polly.loop_body
%polly.loopiv25 = phi i32 [ 0, %entry ], [ %polly.next_loopiv, %polly.loop_body ]
%polly.next_loopiv = add i32 %polly.loopiv25, 4
%p_arrayidx1 = getelementptr [400 x i8], [400 x i8]* @A, i32 0, i32 %polly.loopiv25
%p_arrayidx = getelementptr [400 x i8], [400 x i8]* @B, i32 0, i32 %polly.loopiv25
%vector_ptr = bitcast i8* %p_arrayidx to <4 x i8>*
%_p_vec_full = load <4 x i8>, <4 x i8>* %vector_ptr, align 8
%mulp_vec = mul <4 x i8> %_p_vec_full, <i8 1, i8 2, i8 3, i8 4>
%vector_ptr14 = bitcast i8* %p_arrayidx1 to <4 x i8>*
%_p_vec_full15 = load <4 x i8>, <4 x i8>* %vector_ptr14, align 8
%addp_vec = add <4 x i8> %_p_vec_full15, %mulp_vec
store <4 x i8> %addp_vec, <4 x i8>* %vector_ptr14, align 8
%0 = icmp slt i32 %polly.next_loopiv, 400
br i1 %0, label %polly.loop_body, label %polly.loop_after
}

View File

@@ -0,0 +1,29 @@
; RUN: llc -march=hexagon < %s | FileCheck %s
; Make sure we can build the constant vector <7, 7, 7, 7>
; CHECK: vaddub
@B = common global [400 x i8] zeroinitializer, align 8
@A = common global [400 x i8] zeroinitializer, align 8
@C = common global [400 x i8] zeroinitializer, align 8
define void @run() nounwind {
entry:
br label %polly.loop_body
polly.loop_after: ; preds = %polly.loop_body
ret void
polly.loop_body: ; preds = %entry, %polly.loop_body
%polly.loopiv25 = phi i32 [ 0, %entry ], [ %polly.next_loopiv, %polly.loop_body ]
%polly.next_loopiv = add i32 %polly.loopiv25, 4
%p_arrayidx1 = getelementptr [400 x i8], [400 x i8]* @A, i32 0, i32 %polly.loopiv25
%p_arrayidx = getelementptr [400 x i8], [400 x i8]* @B, i32 0, i32 %polly.loopiv25
%vector_ptr = bitcast i8* %p_arrayidx to <4 x i8>*
%_p_vec_full = load <4 x i8>, <4 x i8>* %vector_ptr, align 8
%mulp_vec = mul <4 x i8> %_p_vec_full, <i8 7, i8 7, i8 7, i8 7>
%vector_ptr14 = bitcast i8* %p_arrayidx1 to <4 x i8>*
%_p_vec_full15 = load <4 x i8>, <4 x i8>* %vector_ptr14, align 8
%addp_vec = add <4 x i8> %_p_vec_full15, %mulp_vec
store <4 x i8> %addp_vec, <4 x i8>* %vector_ptr14, align 8
%0 = icmp slt i32 %polly.next_loopiv, 400
br i1 %0, label %polly.loop_body, label %polly.loop_after
}

View File

@@ -0,0 +1,14 @@
; RUN: llc -march=hexagon -debug-only=isel < %s 2>/dev/null
; REQUIRES: asserts
; Make sure that this doesn't crash. Debug option enabled a failing assertion
; about type mismatch in formal arguments.
; CHECK: vaddub
define i1 @t_i4x8(<4 x i8> %a, <4 x i8> %b) nounwind {
entry:
%0 = add <4 x i8> %a, %b
%1 = bitcast <4 x i8> %0 to <32 x i1>
%2 = extractelement <32 x i1> %1, i32 0
ret i1 %2
}

View File

@@ -0,0 +1,9 @@
; RUN: llc -march=hexagon < %s
define i1 @t_i4x8(<4 x i8> %a, <4 x i8> %b) nounwind {
entry:
%0 = add <4 x i8> %a, %b
%1 = bitcast <4 x i8> %0 to <32 x i1>
%2 = extractelement <32 x i1> %1, i32 0
ret i1 %2
}

View File

@@ -0,0 +1,96 @@
; RUN: llc -march=hexagon -mcpu=hexagonv5 < %s | FileCheck %s
; Check that we do not generate extract.
; CHECK-NOT: extractu
target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
target triple = "hexagon"
define void @foo(i32 %N, i32* nocapture %C, i16* nocapture %A, i16 signext %val) #0 {
entry:
%cmp14 = icmp eq i32 %N, 0
br i1 %cmp14, label %for.end11, label %for.cond1.preheader.single_entry.preheader
for.cond1.preheader.single_entry.preheader: ; preds = %entry
%0 = add i32 %N, -1
%leftover_lb = and i32 %0, -2
%p_conv4 = sext i16 %val to i32
br label %for.cond1.preheader.single_entry
for.cond1.preheader.single_entry: ; preds = %for.inc9, %for.cond1.preheader.single_entry.preheader
%indvar = phi i32 [ %indvar.next, %for.inc9 ], [ 0, %for.cond1.preheader.single_entry.preheader ]
%1 = mul i32 %indvar, %N
%.not = icmp slt i32 %N, 2
%.not41 = icmp slt i32 %leftover_lb, 1
%brmerge = or i1 %.not, %.not41
%.mux = select i1 %.not, i32 0, i32 %leftover_lb
br i1 %brmerge, label %polly.loop_header26.preheader, label %polly.loop_body.lr.ph
for.inc9.loopexit: ; preds = %polly.stmt.for.body331
br label %for.inc9
for.inc9: ; preds = %for.inc9.loopexit, %polly.loop_header26.preheader
%indvar.next = add i32 %indvar, 1
%exitcond40 = icmp eq i32 %indvar.next, %N
br i1 %exitcond40, label %for.end11.loopexit, label %for.cond1.preheader.single_entry
for.end11.loopexit: ; preds = %for.inc9
br label %for.end11
for.end11: ; preds = %for.end11.loopexit, %entry
ret void
polly.loop_body.lr.ph: ; preds = %for.cond1.preheader.single_entry
%2 = call i64 @llvm.hexagon.A2.combinew(i32 %1, i32 %1)
%3 = bitcast i64 %2 to <2 x i32>
%4 = extractelement <2 x i32> %3, i32 0
%5 = call i64 @llvm.hexagon.A2.combinew(i32 %p_conv4, i32 %p_conv4)
%6 = bitcast i64 %5 to <2 x i32>
%p_arrayidx8.gep = getelementptr i32, i32* %C, i32 %4
%p_arrayidx.gep = getelementptr i16, i16* %A, i32 %4
br label %polly.loop_body
polly.loop_body: ; preds = %polly.loop_body.lr.ph, %polly.loop_body
%p_arrayidx8.phi = phi i32* [ %p_arrayidx8.gep, %polly.loop_body.lr.ph ], [ %p_arrayidx8.inc, %polly.loop_body ]
%p_arrayidx.phi = phi i16* [ %p_arrayidx.gep, %polly.loop_body.lr.ph ], [ %p_arrayidx.inc, %polly.loop_body ]
%polly.loopiv38 = phi i32 [ 0, %polly.loop_body.lr.ph ], [ %polly.next_loopiv, %polly.loop_body ]
%polly.next_loopiv = add nsw i32 %polly.loopiv38, 2
%vector_ptr = bitcast i16* %p_arrayidx.phi to <2 x i16>*
%_p_vec_full = load <2 x i16>, <2 x i16>* %vector_ptr, align 2
%7 = sext <2 x i16> %_p_vec_full to <2 x i32>
%mul5p_vec = mul <2 x i32> %7, %6
%vector_ptr21 = bitcast i32* %p_arrayidx8.phi to <2 x i32>*
store <2 x i32> %mul5p_vec, <2 x i32>* %vector_ptr21, align 4
%8 = icmp slt i32 %polly.next_loopiv, %leftover_lb
%p_arrayidx8.inc = getelementptr i32, i32* %p_arrayidx8.phi, i32 2
%p_arrayidx.inc = getelementptr i16, i16* %p_arrayidx.phi, i32 2
br i1 %8, label %polly.loop_body, label %polly.loop_header26.preheader.loopexit
polly.loop_header26.preheader.loopexit: ; preds = %polly.loop_body
br label %polly.loop_header26.preheader
polly.loop_header26.preheader: ; preds = %polly.loop_header26.preheader.loopexit, %for.cond1.preheader.single_entry
%polly.loopiv29.ph = phi i32 [ %.mux, %for.cond1.preheader.single_entry ], [ %leftover_lb, %polly.loop_header26.preheader.loopexit ]
%9 = icmp slt i32 %polly.loopiv29.ph, %N
br i1 %9, label %polly.stmt.for.body331.preheader, label %for.inc9
polly.stmt.for.body331.preheader: ; preds = %polly.loop_header26.preheader
br label %polly.stmt.for.body331
polly.stmt.for.body331: ; preds = %polly.stmt.for.body331.preheader, %polly.stmt.for.body331
%polly.loopiv2939 = phi i32 [ %polly.next_loopiv30, %polly.stmt.for.body331 ], [ %polly.loopiv29.ph, %polly.stmt.for.body331.preheader ]
%polly.next_loopiv30 = add nsw i32 %polly.loopiv2939, 1
%p_32 = add i32 %polly.loopiv2939, %1
%p_arrayidx833 = getelementptr i32, i32* %C, i32 %p_32
%p_arrayidx34 = getelementptr i16, i16* %A, i32 %p_32
%_p_scalar_ = load i16, i16* %p_arrayidx34, align 2
%p_conv = sext i16 %_p_scalar_ to i32
%p_mul5 = mul nsw i32 %p_conv, %p_conv4
store i32 %p_mul5, i32* %p_arrayidx833, align 4
%exitcond = icmp eq i32 %polly.next_loopiv30, %N
br i1 %exitcond, label %for.inc9.loopexit, label %polly.stmt.for.body331
}
declare i64 @llvm.hexagon.A2.combinew(i32, i32) #1
attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }

View File

@@ -0,0 +1,26 @@
; RUN: llc -march=hexagon -mcpu=hexagonv5 < %s
; REQUIRES: asserts
; Used to fail with "SplitVectorResult #0: 0x16cbe60: v4f64 = fma"
; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-a0:0-n32"
target triple = "hexagon-unknown-linux-gnu"
define void @run() nounwind {
entry:
br label %polly.loop_header
polly.loop_after: ; preds = %polly.loop_header
ret void
polly.loop_header: ; preds = %polly.loop_body, %entry
%0 = icmp sle i32 undef, 399
br i1 %0, label %polly.loop_body, label %polly.loop_after
polly.loop_body: ; preds = %polly.loop_header
%_p_vec_full = load <4 x double>, <4 x double>* undef, align 8
%mulp_vec = fmul <4 x double> %_p_vec_full, <double 7.000000e+00, double 7.000000e+00, double 7.000000e+00, double 7.000000e+00>
%addp_vec = fadd <4 x double> undef, %mulp_vec
store <4 x double> %addp_vec, <4 x double>* undef, align 8
br label %polly.loop_header
}

View File

@@ -0,0 +1,50 @@
; RUN: llc -march=hexagon < %s
; REQUIRES: asserts
; Used to fail with "Unexpected illegal type!"
; Used to fail with "Cannot select: ch = store x,x,x,<ST4[undef](align=8), trunc to v4i8>"
; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-a0:0-n32"
target triple = "hexagon-unknown-linux-gnu"
define void @foo() nounwind {
entry:
br label %for.body
for.body: ; preds = %for.body, %entry
br i1 undef, label %for.end, label %for.body
for.end: ; preds = %for.body
br label %for.body71
for.body71: ; preds = %for.body71, %for.end
br i1 undef, label %for.end96, label %for.body71
for.end96: ; preds = %for.body71
switch i32 undef, label %sw.epilog [
i32 1, label %for.cond375.preheader
i32 8, label %for.cond591
]
for.cond375.preheader: ; preds = %for.end96
br label %polly.loop_header228
for.cond591: ; preds = %for.end96
br label %for.body664
for.body664: ; preds = %for.body664, %for.cond591
br i1 undef, label %for.end670, label %for.body664
for.end670: ; preds = %for.body664
br label %sw.epilog
sw.epilog: ; preds = %for.end670, %for.end96
ret void
polly.loop_header228: ; preds = %polly.loop_header228, %for.cond375.preheader
%_p_splat_one = load <1 x i16>, <1 x i16>* undef, align 8
%_p_splat = shufflevector <1 x i16> %_p_splat_one, <1 x i16> %_p_splat_one, <4 x i32> zeroinitializer
%0 = trunc <4 x i16> %_p_splat to <4 x i8>
store <4 x i8> %0, <4 x i8>* undef, align 8
br label %polly.loop_header228
}

View File

@@ -0,0 +1,10 @@
; Extracted from test/CodeGen/Generic/vector-casts.ll: used to loop indefinitely.
; RUN: llc -march=hexagon < %s | FileCheck %s
; CHECK: convert_df2w
define void @a(<2 x double>* %p, <2 x i8>* %q) {
%t = load <2 x double>, <2 x double>* %p
%r = fptosi <2 x double> %t to <2 x i8>
store <2 x i8> %r, <2 x i8>* %q
ret void
}

View File

@@ -0,0 +1,71 @@
; RUN: llc -march=hexagon < %s
; Used to fail with an infinite recursion in the insn selection.
target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
target triple = "hexagon-unknown-linux-gnu"
%struct.elt = type { [2 x [4 x %struct.block]] }
%struct.block = type { [2 x i16] }
define void @foo(%struct.elt* noalias nocapture %p0, %struct.elt* noalias nocapture %p1) nounwind {
entry:
%arrayidx1 = getelementptr inbounds %struct.elt, %struct.elt* %p1, i32 0, i32 0, i32 0, i32 3
%arrayidx4 = getelementptr inbounds %struct.elt, %struct.elt* %p1, i32 0, i32 0, i32 0, i32 2
%arrayidx7 = getelementptr inbounds %struct.elt, %struct.elt* %p0, i32 0, i32 0, i32 0, i32 3
%0 = bitcast %struct.block* %arrayidx7 to i32*
%1 = bitcast %struct.block* %arrayidx4 to i32*
%2 = load i32, i32* %0, align 4
store i32 %2, i32* %1, align 4
%3 = bitcast %struct.block* %arrayidx1 to i32*
store i32 %2, i32* %3, align 4
%arrayidx10 = getelementptr inbounds %struct.elt, %struct.elt* %p1, i32 0, i32 0, i32 0, i32 1
%arrayidx16 = getelementptr inbounds %struct.elt, %struct.elt* %p0, i32 0, i32 0, i32 0, i32 2
%4 = bitcast %struct.block* %arrayidx16 to i32*
%5 = bitcast %struct.elt* %p1 to i32*
%6 = load i32, i32* %4, align 4
store i32 %6, i32* %5, align 4
%7 = bitcast %struct.block* %arrayidx10 to i32*
store i32 %6, i32* %7, align 4
%p_arrayidx26 = getelementptr %struct.elt, %struct.elt* %p0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1
%p_arrayidx2632 = getelementptr %struct.elt, %struct.elt* %p0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1
%p_arrayidx2633 = getelementptr %struct.elt, %struct.elt* %p0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 1
%p_arrayidx2634 = getelementptr %struct.elt, %struct.elt* %p0, i32 0, i32 0, i32 0, i32 3, i32 0, i32 1
%p_arrayidx20 = getelementptr %struct.elt, %struct.elt* %p1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1
%p_arrayidx2035 = getelementptr %struct.elt, %struct.elt* %p1, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1
%p_arrayidx2036 = getelementptr %struct.elt, %struct.elt* %p1, i32 0, i32 0, i32 0, i32 2, i32 0, i32 1
%p_arrayidx2037 = getelementptr %struct.elt, %struct.elt* %p1, i32 0, i32 0, i32 0, i32 3, i32 0, i32 1
%8 = lshr i32 %6, 16
%9 = trunc i32 %8 to i16
%_p_vec_ = insertelement <4 x i16> undef, i16 %9, i32 0
%_p_vec_39 = insertelement <4 x i16> %_p_vec_, i16 %9, i32 1
%10 = lshr i32 %2, 16
%11 = trunc i32 %10 to i16
%_p_vec_41 = insertelement <4 x i16> %_p_vec_39, i16 %11, i32 2
%_p_vec_43 = insertelement <4 x i16> %_p_vec_41, i16 %11, i32 3
%shlp_vec = shl <4 x i16> %_p_vec_43, <i16 1, i16 1, i16 1, i16 1>
%12 = extractelement <4 x i16> %shlp_vec, i32 0
store i16 %12, i16* %p_arrayidx20, align 2
%13 = extractelement <4 x i16> %shlp_vec, i32 1
store i16 %13, i16* %p_arrayidx2035, align 2
%14 = extractelement <4 x i16> %shlp_vec, i32 2
store i16 %14, i16* %p_arrayidx2036, align 2
%15 = extractelement <4 x i16> %shlp_vec, i32 3
store i16 %15, i16* %p_arrayidx2037, align 2
%_p_scalar_44 = load i16, i16* %p_arrayidx26, align 2
%_p_vec_45 = insertelement <4 x i16> undef, i16 %_p_scalar_44, i32 0
%_p_scalar_46 = load i16, i16* %p_arrayidx2632, align 2
%_p_vec_47 = insertelement <4 x i16> %_p_vec_45, i16 %_p_scalar_46, i32 1
%_p_scalar_48 = load i16, i16* %p_arrayidx2633, align 2
%_p_vec_49 = insertelement <4 x i16> %_p_vec_47, i16 %_p_scalar_48, i32 2
%_p_scalar_50 = load i16, i16* %p_arrayidx2634, align 2
%_p_vec_51 = insertelement <4 x i16> %_p_vec_49, i16 %_p_scalar_50, i32 3
%shl28p_vec = shl <4 x i16> %_p_vec_51, <i16 1, i16 1, i16 1, i16 1>
%16 = extractelement <4 x i16> %shl28p_vec, i32 0
store i16 %16, i16* %p_arrayidx26, align 2
%17 = extractelement <4 x i16> %shl28p_vec, i32 1
store i16 %17, i16* %p_arrayidx2632, align 2
%18 = extractelement <4 x i16> %shl28p_vec, i32 2
store i16 %18, i16* %p_arrayidx2633, align 2
%19 = extractelement <4 x i16> %shl28p_vec, i32 3
store i16 %19, i16* %p_arrayidx2634, align 2
ret void
}

View File

@@ -0,0 +1,25 @@
; RUN: llc -march=hexagon < %s
;
; Used to fail with "Cannot select: v2i32,ch = load 0x16c5890, 0x16f76e0, 0x16f76e0<LD2[undef](align=8), sext from v2i8>"
target triple = "hexagon-unknown-linux-gnu"
define void @foo(<2 x i8>* %p) nounwind {
entry:
br label %polly.loop_header
polly.loop_after: ; preds = %polly.loop_header
unreachable
polly.loop_header: ; preds = %polly.loop_body, %entry
%0 = icmp sle i32 undef, 63
br i1 %0, label %polly.loop_body, label %polly.loop_after
polly.loop_body: ; preds = %polly.loop_header
%_p_vec_full = load <2 x i8>, <2 x i8>* %p, align 8
%1 = sext <2 x i8> %_p_vec_full to <2 x i32>
%p_vec = mul <2 x i32> %1, <i32 3, i32 3>
%mulp_vec = add <2 x i32> %p_vec, <i32 21, i32 21>
store <2 x i32> %mulp_vec, <2 x i32>* undef, align 8
br label %polly.loop_header
}

View File

@@ -0,0 +1,23 @@
; RUN: llc -march=hexagon -O0 < %s | FileCheck %s
; CHECK-LABEL: danny:
; CHECK-DAG: [[T0:r[0-9]+]] = memuh(r0+#0)
; CHECK-DAG: [[T1:r[0-9]+]] = memuh(r0+#2)
; CHECK: [[T0]] |= asl([[T1]],#16)
; CHECK-DAG: [[T2:r[0-9]+]] = memuh(r0+#4)
; CHECK-DAG: [[T3:r[0-9]+]] = memuh(r0+#6)
; CHECK: [[T2]] |= asl([[T3]],#16)
; CHECK: combine([[T2]],[[T0]])
define <4 x i16> @danny(<4 x i16>* %p) {
%t0 = load <4 x i16>, <4 x i16>* %p, align 2
ret <4 x i16> %t0
}
; CHECK-LABEL: sammy:
; CHECK-DAG: [[T0:r[0-9]+]] = memw(r0+#0)
; CHECK-DAG: [[T1:r[0-9]+]] = memw(r0+#4)
; CHECK: combine([[T1]],[[T0]])
define <4 x i16> @sammy(<4 x i16>* %p) {
%t0 = load <4 x i16>, <4 x i16>* %p, align 4
ret <4 x i16> %t0
}

View File

@@ -0,0 +1,76 @@
; RUN: llc -march=hexagon < %s
; Used to fail with "Cannot select: 0x16cf370: v2i16,ch = load"
; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-a0:0-n32"
target triple = "hexagon-unknown-linux-gnu"
%struct.ext_hdrs.10.65.142.274.307.318.329.681.692.703.714.725.736.758.791.802.846.857.868.879.890.901.945.956.958 = type { i8, i8, i8, i8, i8, i8, i16, i32, [8 x %struct.hcdc_ext_vec.9.64.141.273.306.317.328.680.691.702.713.724.735.757.790.801.845.856.867.878.889.900.944.955.957] }
%struct.hcdc_ext_vec.9.64.141.273.306.317.328.680.691.702.713.724.735.757.790.801.845.856.867.878.889.900.944.955.957 = type { i8, i8, i16 }
define void @foo(%struct.ext_hdrs.10.65.142.274.307.318.329.681.692.703.714.725.736.758.791.802.846.857.868.879.890.901.945.956.958* %hc_ext_info) nounwind {
entry:
br i1 undef, label %if.end, label %if.then
if.then: ; preds = %entry
unreachable
if.end: ; preds = %entry
br i1 undef, label %if.end5, label %if.then3
if.then3: ; preds = %if.end
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%add.ptr = getelementptr inbounds %struct.ext_hdrs.10.65.142.274.307.318.329.681.692.703.714.725.736.758.791.802.846.857.868.879.890.901.945.956.958, %struct.ext_hdrs.10.65.142.274.307.318.329.681.692.703.714.725.736.758.791.802.846.857.868.879.890.901.945.956.958* %hc_ext_info, i32 0, i32 8, i32 0
%add.ptr22 = getelementptr inbounds %struct.ext_hdrs.10.65.142.274.307.318.329.681.692.703.714.725.736.758.791.802.846.857.868.879.890.901.945.956.958, %struct.ext_hdrs.10.65.142.274.307.318.329.681.692.703.714.725.736.758.791.802.846.857.868.879.890.901.945.956.958* null, i32 0, i32 8, i32 undef
br label %while.cond
while.cond: ; preds = %if.end419, %if.end5
%gre_chksum.0 = phi <2 x i8> [ undef, %if.end5 ], [ %gre_chksum.2, %if.end419 ]
%cmp23 = icmp ult %struct.hcdc_ext_vec.9.64.141.273.306.317.328.680.691.702.713.724.735.757.790.801.845.856.867.878.889.900.944.955.957* null, %add.ptr
%cmp25 = icmp ult %struct.hcdc_ext_vec.9.64.141.273.306.317.328.680.691.702.713.724.735.757.790.801.845.856.867.878.889.900.944.955.957* null, %add.ptr22
%sel1 = and i1 %cmp23, %cmp25
br i1 %sel1, label %while.body, label %while.end422
while.body: ; preds = %while.cond
switch i8 undef, label %if.end419 [
i8 5, label %if.then70
i8 3, label %if.then70
i8 2, label %if.then70
i8 1, label %if.then70
i8 0, label %if.then70
i8 4, label %if.then93
i8 6, label %if.then195
]
if.then70: ; preds = %while.body, %while.body, %while.body, %while.body, %while.body
unreachable
if.then93: ; preds = %while.body
unreachable
if.then195: ; preds = %while.body
br i1 undef, label %if.end274, label %if.then202
if.then202: ; preds = %if.then195
br label %while.body222
while.body222: ; preds = %while.body222, %if.then202
br i1 undef, label %if.end240, label %while.body222
if.end240: ; preds = %while.body222
%_p_vec_full100 = load <2 x i8>, <2 x i8>* undef, align 8
br label %if.end274
if.end274: ; preds = %if.end240, %if.then195
%gre_chksum.1 = phi <2 x i8> [ %gre_chksum.0, %if.then195 ], [ %_p_vec_full100, %if.end240 ]
br label %if.end419
if.end419: ; preds = %if.end274, %while.body
%gre_chksum.2 = phi <2 x i8> [ %gre_chksum.0, %while.body ], [ %gre_chksum.1, %if.end274 ]
br label %while.cond
while.end422: ; preds = %while.cond
ret void
}

View File

@@ -0,0 +1,9 @@
; RUN: llc -march=hexagon < %s | FileCheck %s
; CHECK: vmpyh
; CHECK: vtrunewh
define <2 x i16> @t_i2x16(<2 x i16> %a, <2 x i16> %b) nounwind {
entry:
%0 = mul <2 x i16> %a, %b
ret <2 x i16> %0
}

View File

@@ -0,0 +1,9 @@
; RUN: llc -march=hexagon < %s | FileCheck %s
; CHECK: mpyi
; CHECK: mpyi
define <2 x i32> @t_i2x32(<2 x i32> %a, <2 x i32> %b) nounwind {
entry:
%0 = mul <2 x i32> %a, %b
ret <2 x i32> %0
}

Some files were not shown because too many files have changed in this diff Show More