; Check that the #rs_export_reduce node is recognized. ; RUN: llvm-rs-as %s -o %t ; RUN: bcinfo %t | FileCheck %s ; CHECK: exportReduceCount: 8 ; CHECK: exportReduceList[0]: addint - 0x00000001 - 1 - 4 ; CHECK: accumulator(aiAccum) ; CHECK: exportReduceList[1]: mpyint - 0x00000001 - 1 - 4 ; CHECK: initializer(mpyInit) ; CHECK: accumulator(mpyAccum) ; CHECK: exportReduceList[2]: dp - 0x00000001 - 2 - 4 ; CHECK: accumulator(dpAccum) ; CHECK: combiner(dpSum) ; CHECK: exportReduceList[3]: findMinAndMax - 0x00000009 - 1 - 16 ; CHECK: initializer(fMMInit) ; CHECK: accumulator(fMMAccumulator) ; CHECK: combiner(fMMCombiner) ; CHECK: outconverter(fMMOutConverter) ; CHECK: exportReduceList[4]: fz - 0x00000009 - 1 - 4 ; CHECK: initializer(fzInit) ; CHECK: accumulator(fzAccum) ; CHECK: combiner(fzCombine) ; CHECK: halter(fzFound) ; CHECK: exportReduceList[5]: fz2 - 0x00000019 - 1 - 8 ; CHECK: initializer(fz2Init) ; CHECK: accumulator(fz2Accum) ; CHECK: combiner(fz2Combine) ; CHECK: halter(fz2Found) ; CHECK: exportReduceList[6]: histogram - 0x00000001 - 1 - 1024 ; CHECK: accumulator(hsgAccum) ; CHECK: combiner(hsgCombine) ; CHECK: exportReduceList[7]: mode - 0x00000001 - 1 - 1024 ; CHECK: accumulator(hsgAccum) ; CHECK: combiner(hsgCombine) ; CHECK: outconverter(modeOutConvert) ; ModuleID = 'reduce_general_examples.bc' target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128" target triple = "aarch64-none-linux-gnueabi" %struct.MinAndMax.0 = type { %struct.IndexedVal.1, %struct.IndexedVal.1 } %struct.IndexedVal.1 = type { float, i32 } @fMMInit.r = internal unnamed_addr constant %struct.MinAndMax.0 { %struct.IndexedVal.1 { float 0.000000e+00, i32 -1 }, %struct.IndexedVal.1 { float -0.000000e+00, i32 -1 } }, align 4 @llvm.used = appending global [20 x i8*] [i8* bitcast (void (<2 x i32>*)* @fz2Init to i8*), i8* bitcast (void ([256 x i32]*, [256 x i32]*)* @hsgCombine to i8*), i8* bitcast (i1 (<2 x i32>*)* @fz2Found to i8*), i8* bitcast (void (i32*, i32)* @mpyAccum to i8*), i8* bitcast (void (%struct.MinAndMax.0*)* @fMMInit to i8*), i8* bitcast (void (float*, float, float)* @dpAccum to i8*), i8* bitcast (void (<2 x i32>*, [256 x i32]*)* @modeOutConvert to i8*), i8* bitcast (void ([256 x i32]*, i8)* @hsgAccum to i8*), i8* bitcast (void (i32*)* @mpyInit to i8*), i8* bitcast (void (%struct.MinAndMax.0*, float, i32)* @fMMAccumulator to i8*), i8* bitcast (void (float*, float*)* @dpSum to i8*), i8* bitcast (void (%struct.MinAndMax.0*, %struct.MinAndMax.0*)* @fMMCombiner to i8*), i8* bitcast (void (i32*, i32*)* @fzCombine to i8*), i8* bitcast (void (i32*, i32)* @aiAccum to i8*), i8* bitcast (void (i32*)* @fzInit to i8*), i8* bitcast (void (i32*, i32, i32)* @fzAccum to i8*), i8* bitcast (i1 (i32*)* @fzFound to i8*), i8* bitcast (void (<2 x i32>*, i32, i32, i32)* @fz2Accum to i8*), i8* bitcast (void (<2 x i32>*, %struct.MinAndMax.0*)* @fMMOutConverter to i8*), i8* bitcast (void (<2 x i32>*, <2 x i32>*)* @fz2Combine to i8*)], section "llvm.metadata" ; Function Attrs: nounwind define internal void @aiAccum(i32* nocapture %accum, i32 %val) #0 { %1 = load i32, i32* %accum, align 4, !tbaa !18 %2 = add nsw i32 %1, %val store i32 %2, i32* %accum, align 4, !tbaa !18 ret void } ; Function Attrs: nounwind define internal void @mpyInit(i32* nocapture %accum) #0 { store i32 1, i32* %accum, align 4, !tbaa !18 ret void } ; Function Attrs: nounwind define internal void @mpyAccum(i32* nocapture %accum, i32 %val) #0 { %1 = load i32, i32* %accum, align 4, !tbaa !18 %2 = mul nsw i32 %1, %val store i32 %2, i32* %accum, align 4, !tbaa !18 ret void } ; Function Attrs: nounwind define internal void @dpAccum(float* nocapture %accum, float %in1, float %in2) #0 { %1 = fmul float %in1, %in2 %2 = load float, float* %accum, align 4, !tbaa !22 %3 = fadd float %1, %2 store float %3, float* %accum, align 4, !tbaa !22 ret void } ; Function Attrs: nounwind define internal void @dpSum(float* nocapture %accum, float* nocapture %val) #0 { %1 = load float, float* %val, align 4, !tbaa !22 %2 = load float, float* %accum, align 4, !tbaa !22 %3 = fadd float %1, %2 store float %3, float* %accum, align 4, !tbaa !22 ret void } ; Function Attrs: nounwind define internal void @fMMInit(%struct.MinAndMax.0* nocapture %accum) #0 { %1 = bitcast %struct.MinAndMax.0* %accum to i8* tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.MinAndMax.0* @fMMInit.r to i8*), i64 16, i32 4, i1 false), !tbaa.struct !24 ret void } ; Function Attrs: nounwind declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #0 ; Function Attrs: nounwind define internal void @fMMAccumulator(%struct.MinAndMax.0* nocapture %accum, float %in, i32 %x) #0 { %1 = getelementptr inbounds %struct.MinAndMax.0, %struct.MinAndMax.0* %accum, i64 0, i32 0, i32 0 %2 = load float, float* %1, align 4, !tbaa !22 %3 = fcmp ogt float %2, %in br i1 %3, label %4, label %6 ;