llvm/llvm/test/Transforms/SLPVectorizer/X86/reduce-with-folded-to-consts.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
; RUN: opt -passes=slp-vectorizer -S < %s -o - -mtriple=x86_64-unknown-linux-gnu -mattr=+avx | FileCheck %s

define void @test() {
; CHECK-LABEL: define void @test
; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
; CHECK-NEXT:  bb:
; CHECK-NEXT:    [[TMP0:%.*]] = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> zeroinitializer)
; CHECK-NEXT:    [[OP_RDX2:%.*]] = add i32 0, [[TMP0]]
; CHECK-NEXT:    store i32 [[OP_RDX2]], ptr null, align 4
; CHECK-NEXT:    ret void
;
bb:
  %shl183 = shl i32 0, 0
  %shl187 = shl i32 0, 0
  %or188 = or i32 %shl183, 0
  %add189 = add i32 %or188, %shl183
  %add190 = add i32 0, %add189
  %shl191 = shl i32 0, 0
  %or192 = or i32 %shl187, 0
  %add193 = add i32 %or192, %shl187
  %add194 = add i32 %add190, %add193
  %or196 = or i32 %shl191, 0
  %add198 = add i32 %add194, %or196
  %shl199 = shl i32 0, 0
  %or203 = or i32 %shl199, 0
  %add205 = add i32 %add198, %or203
  store i32 %add205, ptr null, align 4
  ret void
}