1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/Transforms/InstCombine/fold-vector-zero-inseltpoison.ll
Juneyoung Lee 08ec5d7c6b Precommit transform tests that have poison as insertelement's placeholder
This commit copies existing tests at llvm/Transforms and replaces
'insertelement undef' in those files with 'insertelement poison'.
(see https://reviews.llvm.org/D93586)

Tests listed using this script:

grep -R -E '^[^;]*insertelement <.*> undef,' . | cut -d":" -f1 | uniq |
wc -l

Tests updated:

file_org=llvm/test/Transforms/$1
file=${file_org%.ll}-inseltpoison.ll
cp $file_org $file
sed -i -E 's/^([^;]*)insertelement <(.*)> undef/\1insertelement <\2> poison/g' $file
head -1 $file | grep "Assertions have been autogenerated by utils/update_test_checks.py" -q
if [ "$?" == 1 ]; then
  echo "$file : should be manually updated"
  # I manually updated the script
  exit 1
fi
python3 ./llvm/utils/update_test_checks.py --opt-binary=./build-releaseassert/bin/opt $file
2020-12-24 11:46:17 +09:00

36 lines
1.1 KiB
LLVM

; RUN: opt < %s -instcombine -S | not grep zeroinitializer
define void @foo(i64 %A, i64 %B) {
bb8:
br label %bb30
bb30:
%s0 = phi i64 [ 0, %bb8 ], [ %r21, %bb30 ]
%l0 = phi i64 [ -2222, %bb8 ], [ %r23, %bb30 ]
%r2 = add i64 %s0, %B
%r3 = inttoptr i64 %r2 to <2 x double>*
%r4 = load <2 x double>, <2 x double>* %r3, align 8
%r6 = bitcast <2 x double> %r4 to <2 x i64>
%r7 = bitcast <2 x double> zeroinitializer to <2 x i64>
%r8 = insertelement <2 x i64> poison, i64 9223372036854775807, i32 0
%r9 = insertelement <2 x i64> poison, i64 -9223372036854775808, i32 0
%r10 = insertelement <2 x i64> %r8, i64 9223372036854775807, i32 1
%r11 = insertelement <2 x i64> %r9, i64 -9223372036854775808, i32 1
%r12 = and <2 x i64> %r6, %r10
%r13 = and <2 x i64> %r7, %r11
%r14 = or <2 x i64> %r12, %r13
%r15 = bitcast <2 x i64> %r14 to <2 x double>
%r18 = add i64 %s0, %A
%r19 = inttoptr i64 %r18 to <2 x double>*
store <2 x double> %r15, <2 x double>* %r19, align 8
%r21 = add i64 16, %s0
%r23 = add i64 1, %l0
%r25 = icmp slt i64 %r23, 0
%r26 = zext i1 %r25 to i64
%r27 = icmp ne i64 %r26, 0
br i1 %r27, label %bb30, label %bb5
bb5:
ret void
}