Need to consider the length of the original vector for extractelements, not the length, matched number of the scalars. It fixes 2 issues: 1) improves cost estimation; 2) Fixes crashes after D158449.
22 lines
783 B
LLVM
22 lines
783 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
|
|
; RUN: opt -S --passes=slp-vectorizer < %s | FileCheck %s
|
|
|
|
define void @test() {
|
|
; CHECK-LABEL: define void @test() {
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[TMP0:%.*]] = extractelement <1 x i64> zeroinitializer, i64 0
|
|
; CHECK-NEXT: [[BF_VALUE:%.*]] = and i64 [[TMP0]], 0
|
|
; CHECK-NEXT: [[BF_CLEAR:%.*]] = and i64 0, 1
|
|
; CHECK-NEXT: [[BF_SET:%.*]] = or i64 [[BF_CLEAR]], [[BF_VALUE]]
|
|
; CHECK-NEXT: store i64 [[BF_SET]], ptr null, align 8
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
%0 = extractelement <1 x i64> zeroinitializer, i64 0
|
|
%bf.value = and i64 %0, 0
|
|
%bf.clear = and i64 0, 1
|
|
%bf.set = or i64 %bf.clear, %bf.value
|
|
store i64 %bf.set, ptr null, align 8
|
|
ret void
|
|
}
|