summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AMDGPU/function-args.ll
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-07-15 05:52:59 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-07-15 05:52:59 +0000
commitb34635550a2d0fd3cc559023ce39374c5f99f0d5 (patch)
treedd69cbb4bf5be328d54804c04409f506c5dbd48c /llvm/test/CodeGen/AMDGPU/function-args.ll
parent3c64077c8277b87ee1fa242780676e2d99d255c4 (diff)
downloadbcm5719-llvm-b34635550a2d0fd3cc559023ce39374c5f99f0d5.tar.gz
bcm5719-llvm-b34635550a2d0fd3cc559023ce39374c5f99f0d5.zip
AMDGPU: Return correct type during argument lowering
The type needs to be casted back to the original argument type. Fixes an assert that for some reason is only run when using -debug. Includes an additional combine to avoid test regressions from having conversions mixed with multiple Assert[SZ]ext nodes. On subtargets where i16 is legal, this was producing an i32 register with an i16 AssertZExt, truncated to i16 with another i8 AssertZExt. t2: i32,ch = CopyFromReg t0, Register:i32 %vreg0 t3: i16 = truncate t2 t5: i16 = AssertZext t3, ValueType:ch:i8 t6: i8 = truncate t5 t7: i32 = zero_extend t6 llvm-svn: 308082
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/function-args.ll')
-rw-r--r--llvm/test/CodeGen/AMDGPU/function-args.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/function-args.ll b/llvm/test/CodeGen/AMDGPU/function-args.ll
index 9b1368493ba..6b22cb0b7e2 100644
--- a/llvm/test/CodeGen/AMDGPU/function-args.ll
+++ b/llvm/test/CodeGen/AMDGPU/function-args.ll
@@ -34,6 +34,22 @@ define void @void_func_i1_signext(i1 signext %arg0) #0 {
ret void
}
+; GCN-LABEL: {{^}}i1_arg_i1_use:
+; GCN: v_and_b32_e32 v0, 1, v0
+; GCN: v_cmp_eq_u32_e32 vcc, 1, v0
+; GCN: s_xor_b64 s{{\[[0-9]+:[0-9]+\]}}, vcc, -1
+define void @i1_arg_i1_use(i1 %arg) #0 {
+bb:
+ br i1 %arg, label %bb2, label %bb1
+
+bb1:
+ store volatile i32 0, i32 addrspace(1)* undef
+ br label %bb2
+
+bb2:
+ ret void
+}
+
; GCN-LABEL: {{^}}void_func_i8:
; GCN-NOT: v0
; GCN: buffer_store_byte v0, off
OpenPOWER on IntegriCloud