mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
2996b9a3c7
The test case is based on the example from the post-commit thread for: https://reviews.llvm.org/rGc9171bd0a955 This replaces the x86-specific simple-type check from: rL367766 with a check in the DAGCombiner. Adding the check isn't strictly necessary after the fix from: rL367768 ...but it seems likely that we're heading for trouble if we are creating weird types in this transform. I combined the earlier legality check into the initial clause to simplify the code. So we should only try the trunc/sext transform at the earliest combine stage, but we limit the transform to simple types anyway because the TLI hook is probably too lax about what it considers a free truncate. llvm-svn: 367834
51 lines
1.8 KiB
LLVM
51 lines
1.8 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc < %s -mtriple=x86_64-- -mattr=avx512bw | FileCheck %s
|
|
|
|
; This would infinite loop by trying to truncate to i16 and then promote back to i32.
|
|
|
|
define i16 @PR40793(<8 x i16> %t1) {
|
|
; CHECK-LABEL: PR40793:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: vpextrw $5, %xmm0, %ecx
|
|
; CHECK-NEXT: andb $15, %cl
|
|
; CHECK-NEXT: movl $32733, %eax # imm = 0x7FDD
|
|
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
|
|
; CHECK-NEXT: shrl %cl, %eax
|
|
; CHECK-NEXT: # kill: def $ax killed $ax killed $eax
|
|
; CHECK-NEXT: retq
|
|
%t2 = and <8 x i16> %t1, <i16 15, i16 15, i16 15, i16 15, i16 15, i16 15, i16 15, i16 15>
|
|
%t3 = lshr <8 x i16> <i16 25156, i16 -14844, i16 -26779, i16 -16956, i16 -13978, i16 32733, i16 -24894, i16 18530>, %t2
|
|
%t4 = bitcast <8 x i16> %t3 to <2 x double>
|
|
%t5 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %t4)
|
|
%t6 = bitcast <2 x double> %t5 to <8 x i16>
|
|
%t7 = extractelement <8 x i16> %t6, i64 5
|
|
ret i16 %t7
|
|
}
|
|
|
|
declare <2 x double> @llvm.fabs.v2f64(<2 x double>)
|
|
|
|
; This would infinite loop by trying to truncate and any_extend.
|
|
|
|
%struct.anon = type { [9 x i8], [3 x i8] }
|
|
|
|
@b = common local_unnamed_addr global %struct.anon zeroinitializer, align 4
|
|
|
|
define i32 @d() {
|
|
; CHECK-LABEL: d:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: movzbl b+{{.*}}(%rip), %ecx
|
|
; CHECK-NEXT: andl $7, %ecx
|
|
; CHECK-NEXT: movl $d, %eax
|
|
; CHECK-NEXT: addl %ecx, %eax
|
|
; CHECK-NEXT: # kill: def $eax killed $eax killed $rax
|
|
; CHECK-NEXT: retq
|
|
%bf.load = load i72, i72* bitcast (%struct.anon* @b to i72*), align 4
|
|
%bf.lshr = lshr i72 %bf.load, 64
|
|
%t0 = trunc i72 %bf.lshr to i64
|
|
%bf.cast = and i64 %t0, 7
|
|
%add.ptr = getelementptr i8, i8* bitcast (i32 ()* @d to i8*), i64 %bf.cast
|
|
%t1 = ptrtoint i8* %add.ptr to i64
|
|
%t2 = trunc i64 %t1 to i32
|
|
ret i32 %t2
|
|
}
|