llvm.org GIT mirror llvm / 6e5862c
R600/SI: Fix assertion on sign extend of 3 vectors This was trying to create an MVT with 3x vectors which created an invalid EVT git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222942 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 5 years ago
2 changed file(s) with 49 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
639639 return BB;
640640 }
641641
642 EVT SITargetLowering::getSetCCResultType(LLVMContext &, EVT VT) const {
642 EVT SITargetLowering::getSetCCResultType(LLVMContext &Ctx, EVT VT) const {
643643 if (!VT.isVector()) {
644644 return MVT::i1;
645645 }
646 return MVT::getVectorVT(MVT::i1, VT.getVectorNumElements());
646 return EVT::getVectorVT(Ctx, MVT::i1, VT.getVectorNumElements());
647647 }
648648
649649 MVT SITargetLowering::getScalarShiftAmountTy(EVT VT) const {
None ;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck --check-prefix=R600 --check-prefix=FUNC %s
1 ;RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
0 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=R600 -check-prefix=FUNC %s
1 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2
3 declare i32 @llvm.r600.read.tidig.x() nounwind readnone
24
35 ; FUNC-LABEL: {{^}}setcc_v2i32:
46 ; R600-DAG: SETE_INT * T{{[0-9]+\.[XYZW]}}, KC0[3].X, KC0[3].Z
342344 store i32 %1, i32 addrspace(1)* %out
343345 ret void
344346 }
347
348 ; FIXME: This does 4 compares
349 ; FUNC-LABEL: {{^}}v3i32_eq:
350 ; SI-DAG: v_cmp_eq_i32
351 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
352 ; SI-DAG: v_cmp_eq_i32
353 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
354 ; SI-DAG: v_cmp_eq_i32
355 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
356 ; SI: s_endpgm
357 define void @v3i32_eq(<3 x i32> addrspace(1)* %out, <3 x i32> addrspace(1)* %ptra, <3 x i32> addrspace(1)* %ptrb) {
358 %tid = call i32 @llvm.r600.read.tidig.x() nounwind readnone
359 %gep.a = getelementptr <3 x i32> addrspace(1)* %ptra, i32 %tid
360 %gep.b = getelementptr <3 x i32> addrspace(1)* %ptrb, i32 %tid
361 %gep.out = getelementptr <3 x i32> addrspace(1)* %out, i32 %tid
362 %a = load <3 x i32> addrspace(1)* %gep.a
363 %b = load <3 x i32> addrspace(1)* %gep.b
364 %cmp = icmp eq <3 x i32> %a, %b
365 %ext = sext <3 x i1> %cmp to <3 x i32>
366 store <3 x i32> %ext, <3 x i32> addrspace(1)* %gep.out
367 ret void
368 }
369
370 ; FUNC-LABEL: {{^}}v3i8_eq:
371 ; SI-DAG: v_cmp_eq_i32
372 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
373 ; SI-DAG: v_cmp_eq_i32
374 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
375 ; SI-DAG: v_cmp_eq_i32
376 ; SI-DAG: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1,
377 ; SI: s_endpgm
378 define void @v3i8_eq(<3 x i8> addrspace(1)* %out, <3 x i8> addrspace(1)* %ptra, <3 x i8> addrspace(1)* %ptrb) {
379 %tid = call i32 @llvm.r600.read.tidig.x() nounwind readnone
380 %gep.a = getelementptr <3 x i8> addrspace(1)* %ptra, i32 %tid
381 %gep.b = getelementptr <3 x i8> addrspace(1)* %ptrb, i32 %tid
382 %gep.out = getelementptr <3 x i8> addrspace(1)* %out, i32 %tid
383 %a = load <3 x i8> addrspace(1)* %gep.a
384 %b = load <3 x i8> addrspace(1)* %gep.b
385 %cmp = icmp eq <3 x i8> %a, %b
386 %ext = sext <3 x i1> %cmp to <3 x i8>
387 store <3 x i8> %ext, <3 x i8> addrspace(1)* %gep.out
388 ret void
389 }