xref: /llvm-project/llvm/test/Transforms/SLPVectorizer/X86/reduce-with-folded-to-consts.ll (revision 22165071711a3b4506487212fe7e0fa1fb0ba6a5)
1*22165071SAlexey Bataev; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2*22165071SAlexey Bataev; RUN: opt -passes=slp-vectorizer -S < %s -o - -mtriple=x86_64-unknown-linux-gnu -mattr=+avx | FileCheck %s
3*22165071SAlexey Bataev
4*22165071SAlexey Bataevdefine void @test() {
5*22165071SAlexey Bataev; CHECK-LABEL: define void @test
6*22165071SAlexey Bataev; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
7*22165071SAlexey Bataev; CHECK-NEXT:  bb:
8*22165071SAlexey Bataev; CHECK-NEXT:    [[TMP0:%.*]] = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> zeroinitializer)
9*22165071SAlexey Bataev; CHECK-NEXT:    [[OP_RDX2:%.*]] = add i32 0, [[TMP0]]
10*22165071SAlexey Bataev; CHECK-NEXT:    store i32 [[OP_RDX2]], ptr null, align 4
11*22165071SAlexey Bataev; CHECK-NEXT:    ret void
12*22165071SAlexey Bataev;
13*22165071SAlexey Bataevbb:
14*22165071SAlexey Bataev  %shl183 = shl i32 0, 0
15*22165071SAlexey Bataev  %shl187 = shl i32 0, 0
16*22165071SAlexey Bataev  %or188 = or i32 %shl183, 0
17*22165071SAlexey Bataev  %add189 = add i32 %or188, %shl183
18*22165071SAlexey Bataev  %add190 = add i32 0, %add189
19*22165071SAlexey Bataev  %shl191 = shl i32 0, 0
20*22165071SAlexey Bataev  %or192 = or i32 %shl187, 0
21*22165071SAlexey Bataev  %add193 = add i32 %or192, %shl187
22*22165071SAlexey Bataev  %add194 = add i32 %add190, %add193
23*22165071SAlexey Bataev  %or196 = or i32 %shl191, 0
24*22165071SAlexey Bataev  %add198 = add i32 %add194, %or196
25*22165071SAlexey Bataev  %shl199 = shl i32 0, 0
26*22165071SAlexey Bataev  %or203 = or i32 %shl199, 0
27*22165071SAlexey Bataev  %add205 = add i32 %add198, %or203
28*22165071SAlexey Bataev  store i32 %add205, ptr null, align 4
29*22165071SAlexey Bataev  ret void
30*22165071SAlexey Bataev}
31