35 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: %if x86-registered-target %{ opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux < %s | FileCheck %s %}3; RUN: %if aarch64-registered-target %{ opt -S --passes=slp-vectorizer -mtriple=aarch64-unknown-linux < %s | FileCheck %s %}4 5; SLP doesn't currently support sub reductions6define i64 @reduction_sub(ptr %ptr) {7; CHECK-LABEL: define i64 @reduction_sub(8; CHECK-SAME: ptr [[PTR:%.*]]) {9; CHECK-NEXT: [[ENTRY:.*:]]10; CHECK-NEXT: [[LD0:%.*]] = load i64, ptr [[PTR]], align 811; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i64, ptr [[PTR]], i64 112; CHECK-NEXT: [[LD1:%.*]] = load i64, ptr [[GEP]], align 813; CHECK-NEXT: [[SUB_1:%.*]] = sub nuw nsw i64 [[LD0]], [[LD1]]14; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds i64, ptr [[PTR]], i64 215; CHECK-NEXT: [[LD2:%.*]] = load i64, ptr [[GEP_1]], align 816; CHECK-NEXT: [[SUB_2:%.*]] = sub nuw nsw i64 [[SUB_1]], [[LD2]]17; CHECK-NEXT: [[GEP_2:%.*]] = getelementptr inbounds i64, ptr [[PTR]], i64 318; CHECK-NEXT: [[LD3:%.*]] = load i64, ptr [[GEP_2]], align 819; CHECK-NEXT: [[SUB_3:%.*]] = sub nuw nsw i64 [[SUB_2]], [[LD3]]20; CHECK-NEXT: ret i64 [[SUB_3]]21;22entry:23 %ld0 = load i64, ptr %ptr24 %gep = getelementptr inbounds i64, ptr %ptr, i64 125 %ld1 = load i64, ptr %gep26 %sub.1 = sub nuw nsw i64 %ld0, %ld127 %gep.1 = getelementptr inbounds i64, ptr %ptr, i64 228 %ld2 = load i64, ptr %gep.129 %sub.2 = sub nuw nsw i64 %sub.1, %ld230 %gep.2 = getelementptr inbounds i64, ptr %ptr, i64 331 %ld3 = load i64, ptr %gep.232 %sub.3 = sub nuw nsw i64 %sub.2, %ld333 ret i64 %sub.334}35