59 lines · plain
1; This produced masked gather that we are not yet handling2; REQUIRES: asserts3; RUN: opt -march=hexagon -passes=loop-vectorize -hexagon-autohvx -mattr=+hvx-length128b,+hvxv68,+v68,+hvx-ieee-fp,-long-calls,-packets -debug-only=loop-vectorize -S < %s 2>&1 | FileCheck %s4 5; Original C++6; clang -c -Os -mhvx -mhvx-ieee-fp -fvectorize -mno-packets -fno-strict-aliasing -Os -mhvx -mhvx-ieee-fp -mno-packets -mv687;typedef struct poptContext_s * poptContext;8;typedef struct { unsigned int bits[1]; } pbm_set;9;struct poptContext_s { pbm_set * arg_strip; };10;11;int poptStrippedArgv(poptContext con, int argc, char ** argv) {12; int numargs = argc;13; for (int i = 1; i < argc; i++) {14; if (((((con->arg_strip)->bits)[((i) / (8 * sizeof (unsigned int)))] & ((unsigned int) 1 << ((i) % (8 * sizeof (unsigned int))))) != 0))15; numargs--;16; }17; return numargs;18;}19 20; CHECK-NOT: masked_gather21 22target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"23target triple = "hexagon-unknown-unknown-elf"24 25; Function Attrs: nofree norecurse nosync nounwind optsize memory(read, inaccessiblemem: none)26define dso_local i32 @poptStrippedArgv(ptr noundef readonly captures(none) %con, i32 noundef %argc, ptr noundef readnone captures(none) %argv) local_unnamed_addr #0 {27entry:28 %cmp8 = icmp sgt i32 %argc, 129 br i1 %cmp8, label %for.body.lr.ph, label %for.cond.cleanup30 31for.body.lr.ph: ; preds = %entry32 %0 = load ptr, ptr %con, align 433 br label %for.body34 35for.cond.cleanup.loopexit: ; preds = %for.body36 %spec.select.lcssa = phi i32 [ %spec.select, %for.body ]37 br label %for.cond.cleanup38 39for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry40 %numargs.0.lcssa = phi i32 [ %argc, %entry ], [ %spec.select.lcssa, %for.cond.cleanup.loopexit ]41 ret i32 %numargs.0.lcssa42 43for.body: ; preds = %for.body.lr.ph, %for.body44 %i.010 = phi i32 [ 1, %for.body.lr.ph ], [ %inc, %for.body ]45 %numargs.09 = phi i32 [ %argc, %for.body.lr.ph ], [ %spec.select, %for.body ]46 %div7 = lshr i32 %i.010, 547 %arrayidx = getelementptr inbounds nuw [1 x i32], ptr %0, i32 0, i32 %div748 %1 = load i32, ptr %arrayidx, align 449 %rem = and i32 %i.010, 3150 %shl = shl nuw i32 1, %rem51 %and = and i32 %1, %shl52 %cmp1.not = icmp ne i32 %and, 053 %dec = sext i1 %cmp1.not to i3254 %spec.select = add nsw i32 %numargs.09, %dec55 %inc = add nuw nsw i32 %i.010, 156 %exitcond.not = icmp eq i32 %inc, %argc57 br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body58}59