blob: 6c5e57b98bf889162d10301ab00c8af4a201a90d [file]
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -passes=sandbox-vectorizer -sbvec-passes='regions-from-metadata<bundle-vec(bottom-up)>' -S %s | FileCheck %s
; REQUIRES: asserts
; This checks that this IR does not trigger assertion errors.
; The SetUseCB notifier's logic was not aware of the scheduling direction
; and would update the UnscheduledPreds/Succs counters for the non-active
; scheduling direction, which would trigger assertion errors.
define void @foo(ptr %ptr) {
; CHECK-LABEL: define void @foo(
; CHECK-SAME: ptr [[PTR:%.*]]) {
; CHECK-NEXT: [[GEP0:%.*]] = getelementptr i64, ptr [[PTR]], i64 0
; CHECK-NEXT: [[VECL:%.*]] = load <2 x i64>, ptr [[GEP0]], align 4, !sandboxvec [[META0:![0-9]+]]
; CHECK-NEXT: [[UNPACK:%.*]] = extractelement <2 x i64> [[VECL]], i32 0, !sandboxvec [[META0]]
; CHECK-NEXT: [[SUB:%.*]] = sub i64 [[UNPACK]], 0
; CHECK-NEXT: [[PACK:%.*]] = insertelement <2 x i64> poison, i64 [[SUB]], i32 0, !sandboxvec [[META0]]
; CHECK-NEXT: [[PACK1:%.*]] = insertelement <2 x i64> [[PACK]], i64 0, i32 1, !sandboxvec [[META0]]
; CHECK-NEXT: [[VEC:%.*]] = and <2 x i64> [[PACK1]], zeroinitializer, !sandboxvec [[META0]]
; CHECK-NEXT: [[VEC2:%.*]] = or <2 x i64> [[VECL]], [[VEC]], !sandboxvec [[META0]]
; CHECK-NEXT: store <2 x i64> [[VEC2]], ptr [[GEP0]], align 8, !sandboxvec [[META0]]
; CHECK-NEXT: ret void
;
%gep0 = getelementptr i64, ptr %ptr, i64 0
%gep1 = getelementptr i64, ptr %ptr, i64 1
%ld0 = load i64, ptr %gep0
%ld1 = load i64, ptr %gep1
%sub = sub i64 %ld0, 0
%andB0 = and i64 %sub, 0
%andB1 = and i64 0, 0
%or0 = or i64 %ld0, %andB0
%or1 = or i64 %ld1, %andB1
store i64 %or0, ptr %gep0, align 8, !sandboxaux !1, !sandboxvec !0
store i64 %or1, ptr %gep1, align 8, !sandboxaux !2, !sandboxvec !0
ret void
}
!0 = distinct !{!"sandboxregion"}
!1 = !{i32 0}
!2 = !{i32 1}
;.
; CHECK: [[META0]] = distinct !{!"sandboxregion"}
;.