Files
clang-p2996/llvm/test/Transforms/SLPVectorizer/AMDGPU/round-inseltpoison.ll
Juneyoung Lee db7a2f347f 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

39 lines
1.5 KiB
LLVM

; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -slp-vectorizer %s | FileCheck -check-prefixes=GCN,GFX7 %s
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -slp-vectorizer %s | FileCheck -check-prefixes=GCN,GFX8 %s
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -slp-vectorizer %s | FileCheck -check-prefixes=GCN,GFX8 %s
; GCN-LABEL: @round_v2f16(
; GFX7: call half @llvm.round.f16(
; GFX7: call half @llvm.round.f16(
; GFX8: call <2 x half> @llvm.round.v2f16(
define <2 x half> @round_v2f16(<2 x half> %arg) {
bb:
%tmp = extractelement <2 x half> %arg, i64 0
%tmp1 = tail call half @llvm.round.half(half %tmp)
%tmp2 = insertelement <2 x half> poison, half %tmp1, i64 0
%tmp3 = extractelement <2 x half> %arg, i64 1
%tmp4 = tail call half @llvm.round.half(half %tmp3)
%tmp5 = insertelement <2 x half> %tmp2, half %tmp4, i64 1
ret <2 x half> %tmp5
}
; GCN-LABEL: @round_v2f32(
; GCN: call float @llvm.round.f32(
; GCN: call float @llvm.round.f32(
define <2 x float> @round_v2f32(<2 x float> %arg) {
bb:
%tmp = extractelement <2 x float> %arg, i64 0
%tmp1 = tail call float @llvm.round.f32(float %tmp)
%tmp2 = insertelement <2 x float> poison, float %tmp1, i64 0
%tmp3 = extractelement <2 x float> %arg, i64 1
%tmp4 = tail call float @llvm.round.f32(float %tmp3)
%tmp5 = insertelement <2 x float> %tmp2, float %tmp4, i64 1
ret <2 x float> %tmp5
}
declare half @llvm.round.half(half) #0
declare float @llvm.round.f32(float) #0
attributes #0 = { nounwind readnone speculatable willreturn }