mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-05 02:16:46 +00:00
7c9c6ed761
Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
37 lines
1.3 KiB
LLVM
37 lines
1.3 KiB
LLVM
; RUN: llc < %s -march=x86-64 -mattr=+sse2 | FileCheck %s
|
|
|
|
; This test makes sure that the compiler does not crash with an
|
|
; assertion failure when trying to fold a vector shift left
|
|
; by immediate count if the type of the input vector is different
|
|
; to the result type.
|
|
;
|
|
; This happens for example when lowering a shift left of a MVT::v16i8 vector.
|
|
; This is custom lowered into the following sequence:
|
|
; count << 5
|
|
; A = VSHLI(MVT::v8i16, r & (char16)15, 4)
|
|
; B = BITCAST MVT::v16i8, A
|
|
; VSELECT(r, B, count);
|
|
; count += count
|
|
; C = VSHLI(MVT::v8i16, r & (char16)63, 2)
|
|
; D = BITCAST MVT::v16i8, C
|
|
; r = VSELECT(r, C, count);
|
|
; count += count
|
|
; VSELECT(r, r+r, count);
|
|
; count = count << 5;
|
|
;
|
|
; Where 'r' is a vector of type MVT::v16i8, and
|
|
; 'count' is the vector shift count.
|
|
|
|
define <16 x i8> @do_not_crash(i8*, i32*, i64*, i32, i64, i8) {
|
|
entry:
|
|
store i8 %5, i8* %0
|
|
%L5 = load i8, i8* %0
|
|
%I8 = insertelement <16 x i8> <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>, i8 %L5, i32 7
|
|
%B51 = shl <16 x i8> <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>, %I8
|
|
ret <16 x i8> %B51
|
|
}
|
|
|
|
; CHECK-LABEL: do_not_crash
|
|
; CHECK: ret
|
|
|