[llvm] 27ccc88 - [LV] Add tests with ephemeral values that are widened.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 8 05:16:08 PDT 2024
Author: Florian Hahn
Date: 2024-07-08T13:15:39+01:00
New Revision: 27ccc8835e5163484234549fa6128eeb00d7432d
URL: https://github.com/llvm/llvm-project/commit/27ccc8835e5163484234549fa6128eeb00d7432d
DIFF: https://github.com/llvm/llvm-project/commit/27ccc8835e5163484234549fa6128eeb00d7432d.diff
LOG: [LV] Add tests with ephemeral values that are widened.
Add tests with loops with ephemeral values that are widened.
After 29b8b72117, @ephemeral_load_and_compare_another_load_used_outside
is vectorized even though the only vector values that are generated are
ephemeral.
Added:
llvm/test/Transforms/LoopVectorize/X86/ephemeral-recipes.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LoopVectorize/X86/ephemeral-recipes.ll b/llvm/test/Transforms/LoopVectorize/X86/ephemeral-recipes.ll
new file mode 100644
index 0000000000000..5b250c33a45fb
--- /dev/null
+++ b/llvm/test/Transforms/LoopVectorize/X86/ephemeral-recipes.ll
@@ -0,0 +1,453 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -p loop-vectorize -S %s | FileCheck %s
+
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx"
+
+define i32 @ephemeral_load_and_compare_iv_used_outside(ptr %start, ptr %end) #0 {
+; CHECK-LABEL: define i32 @ephemeral_load_and_compare_iv_used_outside(
+; CHECK-SAME: ptr [[START:%.*]], ptr [[END:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*]]:
+; CHECK-NEXT: [[END2:%.*]] = ptrtoint ptr [[END]] to i64
+; CHECK-NEXT: [[START1:%.*]] = ptrtoint ptr [[START]] to i64
+; CHECK-NEXT: [[TMP0:%.*]] = sub i64 [[START1]], [[END2]]
+; CHECK-NEXT: [[TMP1:%.*]] = lshr i64 [[TMP0]], 3
+; CHECK-NEXT: [[TMP2:%.*]] = add nuw nsw i64 [[TMP1]], 1
+; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[TMP2]], 128
+; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
+; CHECK: [[VECTOR_PH]]:
+; CHECK-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[TMP2]], 128
+; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[TMP2]], [[N_MOD_VF]]
+; CHECK-NEXT: [[TMP3:%.*]] = mul i64 [[N_VEC]], -8
+; CHECK-NEXT: [[IND_END:%.*]] = getelementptr i8, ptr [[START]], i64 [[TMP3]]
+; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
+; CHECK: [[VECTOR_BODY]]:
+; CHECK-NEXT: [[POINTER_PHI:%.*]] = phi ptr [ [[START]], %[[VECTOR_PH]] ], [ [[PTR_IND:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = getelementptr i8, ptr [[POINTER_PHI]], <32 x i64> <i64 0, i64 -8, i64 -16, i64 -24, i64 -32, i64 -40, i64 -48, i64 -56, i64 -64, i64 -72, i64 -80, i64 -88, i64 -96, i64 -104, i64 -112, i64 -120, i64 -128, i64 -136, i64 -144, i64 -152, i64 -160, i64 -168, i64 -176, i64 -184, i64 -192, i64 -200, i64 -208, i64 -216, i64 -224, i64 -232, i64 -240, i64 -248>
+; CHECK-NEXT: [[TMP5:%.*]] = getelementptr i8, ptr [[POINTER_PHI]], <32 x i64> <i64 -256, i64 -264, i64 -272, i64 -280, i64 -288, i64 -296, i64 -304, i64 -312, i64 -320, i64 -328, i64 -336, i64 -344, i64 -352, i64 -360, i64 -368, i64 -376, i64 -384, i64 -392, i64 -400, i64 -408, i64 -416, i64 -424, i64 -432, i64 -440, i64 -448, i64 -456, i64 -464, i64 -472, i64 -480, i64 -488, i64 -496, i64 -504>
+; CHECK-NEXT: [[TMP6:%.*]] = getelementptr i8, ptr [[POINTER_PHI]], <32 x i64> <i64 -512, i64 -520, i64 -528, i64 -536, i64 -544, i64 -552, i64 -560, i64 -568, i64 -576, i64 -584, i64 -592, i64 -600, i64 -608, i64 -616, i64 -624, i64 -632, i64 -640, i64 -648, i64 -656, i64 -664, i64 -672, i64 -680, i64 -688, i64 -696, i64 -704, i64 -712, i64 -720, i64 -728, i64 -736, i64 -744, i64 -752, i64 -760>
+; CHECK-NEXT: [[TMP7:%.*]] = getelementptr i8, ptr [[POINTER_PHI]], <32 x i64> <i64 -768, i64 -776, i64 -784, i64 -792, i64 -800, i64 -808, i64 -816, i64 -824, i64 -832, i64 -840, i64 -848, i64 -856, i64 -864, i64 -872, i64 -880, i64 -888, i64 -896, i64 -904, i64 -912, i64 -920, i64 -928, i64 -936, i64 -944, i64 -952, i64 -960, i64 -968, i64 -976, i64 -984, i64 -992, i64 -1000, i64 -1008, i64 -1016>
+; CHECK-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <32 x i32> @llvm.masked.gather.v32i32.v32p0(<32 x ptr> [[TMP4]], i32 4, <32 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <32 x i32> poison)
+; CHECK-NEXT: [[WIDE_MASKED_GATHER3:%.*]] = call <32 x i32> @llvm.masked.gather.v32i32.v32p0(<32 x ptr> [[TMP5]], i32 4, <32 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <32 x i32> poison)
+; CHECK-NEXT: [[WIDE_MASKED_GATHER4:%.*]] = call <32 x i32> @llvm.masked.gather.v32i32.v32p0(<32 x ptr> [[TMP6]], i32 4, <32 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <32 x i32> poison)
+; CHECK-NEXT: [[WIDE_MASKED_GATHER5:%.*]] = call <32 x i32> @llvm.masked.gather.v32i32.v32p0(<32 x ptr> [[TMP7]], i32 4, <32 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <32 x i32> poison)
+; CHECK-NEXT: [[TMP8:%.*]] = icmp ne <32 x i32> [[WIDE_MASKED_GATHER]], zeroinitializer
+; CHECK-NEXT: [[TMP9:%.*]] = icmp ne <32 x i32> [[WIDE_MASKED_GATHER3]], zeroinitializer
+; CHECK-NEXT: [[TMP10:%.*]] = icmp ne <32 x i32> [[WIDE_MASKED_GATHER4]], zeroinitializer
+; CHECK-NEXT: [[TMP11:%.*]] = icmp ne <32 x i32> [[WIDE_MASKED_GATHER5]], zeroinitializer
+; CHECK-NEXT: [[TMP12:%.*]] = extractelement <32 x i1> [[TMP8]], i32 0
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP12]])
+; CHECK-NEXT: [[TMP13:%.*]] = extractelement <32 x i1> [[TMP8]], i32 1
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP13]])
+; CHECK-NEXT: [[TMP14:%.*]] = extractelement <32 x i1> [[TMP8]], i32 2
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP14]])
+; CHECK-NEXT: [[TMP15:%.*]] = extractelement <32 x i1> [[TMP8]], i32 3
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP15]])
+; CHECK-NEXT: [[TMP16:%.*]] = extractelement <32 x i1> [[TMP8]], i32 4
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP16]])
+; CHECK-NEXT: [[TMP17:%.*]] = extractelement <32 x i1> [[TMP8]], i32 5
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP17]])
+; CHECK-NEXT: [[TMP18:%.*]] = extractelement <32 x i1> [[TMP8]], i32 6
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP18]])
+; CHECK-NEXT: [[TMP19:%.*]] = extractelement <32 x i1> [[TMP8]], i32 7
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP19]])
+; CHECK-NEXT: [[TMP20:%.*]] = extractelement <32 x i1> [[TMP8]], i32 8
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP20]])
+; CHECK-NEXT: [[TMP21:%.*]] = extractelement <32 x i1> [[TMP8]], i32 9
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP21]])
+; CHECK-NEXT: [[TMP22:%.*]] = extractelement <32 x i1> [[TMP8]], i32 10
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP22]])
+; CHECK-NEXT: [[TMP23:%.*]] = extractelement <32 x i1> [[TMP8]], i32 11
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP23]])
+; CHECK-NEXT: [[TMP24:%.*]] = extractelement <32 x i1> [[TMP8]], i32 12
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP24]])
+; CHECK-NEXT: [[TMP25:%.*]] = extractelement <32 x i1> [[TMP8]], i32 13
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP25]])
+; CHECK-NEXT: [[TMP26:%.*]] = extractelement <32 x i1> [[TMP8]], i32 14
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP26]])
+; CHECK-NEXT: [[TMP27:%.*]] = extractelement <32 x i1> [[TMP8]], i32 15
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP27]])
+; CHECK-NEXT: [[TMP28:%.*]] = extractelement <32 x i1> [[TMP8]], i32 16
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP28]])
+; CHECK-NEXT: [[TMP29:%.*]] = extractelement <32 x i1> [[TMP8]], i32 17
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP29]])
+; CHECK-NEXT: [[TMP30:%.*]] = extractelement <32 x i1> [[TMP8]], i32 18
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP30]])
+; CHECK-NEXT: [[TMP31:%.*]] = extractelement <32 x i1> [[TMP8]], i32 19
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP31]])
+; CHECK-NEXT: [[TMP32:%.*]] = extractelement <32 x i1> [[TMP8]], i32 20
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP32]])
+; CHECK-NEXT: [[TMP33:%.*]] = extractelement <32 x i1> [[TMP8]], i32 21
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP33]])
+; CHECK-NEXT: [[TMP34:%.*]] = extractelement <32 x i1> [[TMP8]], i32 22
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP34]])
+; CHECK-NEXT: [[TMP35:%.*]] = extractelement <32 x i1> [[TMP8]], i32 23
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP35]])
+; CHECK-NEXT: [[TMP36:%.*]] = extractelement <32 x i1> [[TMP8]], i32 24
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP36]])
+; CHECK-NEXT: [[TMP37:%.*]] = extractelement <32 x i1> [[TMP8]], i32 25
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP37]])
+; CHECK-NEXT: [[TMP38:%.*]] = extractelement <32 x i1> [[TMP8]], i32 26
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP38]])
+; CHECK-NEXT: [[TMP39:%.*]] = extractelement <32 x i1> [[TMP8]], i32 27
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP39]])
+; CHECK-NEXT: [[TMP40:%.*]] = extractelement <32 x i1> [[TMP8]], i32 28
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP40]])
+; CHECK-NEXT: [[TMP41:%.*]] = extractelement <32 x i1> [[TMP8]], i32 29
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP41]])
+; CHECK-NEXT: [[TMP42:%.*]] = extractelement <32 x i1> [[TMP8]], i32 30
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP42]])
+; CHECK-NEXT: [[TMP43:%.*]] = extractelement <32 x i1> [[TMP8]], i32 31
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP43]])
+; CHECK-NEXT: [[TMP44:%.*]] = extractelement <32 x i1> [[TMP9]], i32 0
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP44]])
+; CHECK-NEXT: [[TMP45:%.*]] = extractelement <32 x i1> [[TMP9]], i32 1
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP45]])
+; CHECK-NEXT: [[TMP46:%.*]] = extractelement <32 x i1> [[TMP9]], i32 2
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP46]])
+; CHECK-NEXT: [[TMP47:%.*]] = extractelement <32 x i1> [[TMP9]], i32 3
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP47]])
+; CHECK-NEXT: [[TMP48:%.*]] = extractelement <32 x i1> [[TMP9]], i32 4
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP48]])
+; CHECK-NEXT: [[TMP49:%.*]] = extractelement <32 x i1> [[TMP9]], i32 5
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP49]])
+; CHECK-NEXT: [[TMP50:%.*]] = extractelement <32 x i1> [[TMP9]], i32 6
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP50]])
+; CHECK-NEXT: [[TMP51:%.*]] = extractelement <32 x i1> [[TMP9]], i32 7
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP51]])
+; CHECK-NEXT: [[TMP52:%.*]] = extractelement <32 x i1> [[TMP9]], i32 8
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP52]])
+; CHECK-NEXT: [[TMP53:%.*]] = extractelement <32 x i1> [[TMP9]], i32 9
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP53]])
+; CHECK-NEXT: [[TMP54:%.*]] = extractelement <32 x i1> [[TMP9]], i32 10
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP54]])
+; CHECK-NEXT: [[TMP55:%.*]] = extractelement <32 x i1> [[TMP9]], i32 11
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP55]])
+; CHECK-NEXT: [[TMP56:%.*]] = extractelement <32 x i1> [[TMP9]], i32 12
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP56]])
+; CHECK-NEXT: [[TMP57:%.*]] = extractelement <32 x i1> [[TMP9]], i32 13
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP57]])
+; CHECK-NEXT: [[TMP58:%.*]] = extractelement <32 x i1> [[TMP9]], i32 14
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP58]])
+; CHECK-NEXT: [[TMP59:%.*]] = extractelement <32 x i1> [[TMP9]], i32 15
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP59]])
+; CHECK-NEXT: [[TMP60:%.*]] = extractelement <32 x i1> [[TMP9]], i32 16
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP60]])
+; CHECK-NEXT: [[TMP61:%.*]] = extractelement <32 x i1> [[TMP9]], i32 17
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP61]])
+; CHECK-NEXT: [[TMP62:%.*]] = extractelement <32 x i1> [[TMP9]], i32 18
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP62]])
+; CHECK-NEXT: [[TMP63:%.*]] = extractelement <32 x i1> [[TMP9]], i32 19
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP63]])
+; CHECK-NEXT: [[TMP64:%.*]] = extractelement <32 x i1> [[TMP9]], i32 20
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP64]])
+; CHECK-NEXT: [[TMP65:%.*]] = extractelement <32 x i1> [[TMP9]], i32 21
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP65]])
+; CHECK-NEXT: [[TMP66:%.*]] = extractelement <32 x i1> [[TMP9]], i32 22
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP66]])
+; CHECK-NEXT: [[TMP67:%.*]] = extractelement <32 x i1> [[TMP9]], i32 23
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP67]])
+; CHECK-NEXT: [[TMP68:%.*]] = extractelement <32 x i1> [[TMP9]], i32 24
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP68]])
+; CHECK-NEXT: [[TMP69:%.*]] = extractelement <32 x i1> [[TMP9]], i32 25
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP69]])
+; CHECK-NEXT: [[TMP70:%.*]] = extractelement <32 x i1> [[TMP9]], i32 26
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP70]])
+; CHECK-NEXT: [[TMP71:%.*]] = extractelement <32 x i1> [[TMP9]], i32 27
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP71]])
+; CHECK-NEXT: [[TMP72:%.*]] = extractelement <32 x i1> [[TMP9]], i32 28
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP72]])
+; CHECK-NEXT: [[TMP73:%.*]] = extractelement <32 x i1> [[TMP9]], i32 29
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP73]])
+; CHECK-NEXT: [[TMP74:%.*]] = extractelement <32 x i1> [[TMP9]], i32 30
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP74]])
+; CHECK-NEXT: [[TMP75:%.*]] = extractelement <32 x i1> [[TMP9]], i32 31
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP75]])
+; CHECK-NEXT: [[TMP76:%.*]] = extractelement <32 x i1> [[TMP10]], i32 0
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP76]])
+; CHECK-NEXT: [[TMP77:%.*]] = extractelement <32 x i1> [[TMP10]], i32 1
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP77]])
+; CHECK-NEXT: [[TMP78:%.*]] = extractelement <32 x i1> [[TMP10]], i32 2
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP78]])
+; CHECK-NEXT: [[TMP79:%.*]] = extractelement <32 x i1> [[TMP10]], i32 3
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP79]])
+; CHECK-NEXT: [[TMP80:%.*]] = extractelement <32 x i1> [[TMP10]], i32 4
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP80]])
+; CHECK-NEXT: [[TMP81:%.*]] = extractelement <32 x i1> [[TMP10]], i32 5
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP81]])
+; CHECK-NEXT: [[TMP82:%.*]] = extractelement <32 x i1> [[TMP10]], i32 6
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP82]])
+; CHECK-NEXT: [[TMP83:%.*]] = extractelement <32 x i1> [[TMP10]], i32 7
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP83]])
+; CHECK-NEXT: [[TMP84:%.*]] = extractelement <32 x i1> [[TMP10]], i32 8
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP84]])
+; CHECK-NEXT: [[TMP85:%.*]] = extractelement <32 x i1> [[TMP10]], i32 9
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP85]])
+; CHECK-NEXT: [[TMP86:%.*]] = extractelement <32 x i1> [[TMP10]], i32 10
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP86]])
+; CHECK-NEXT: [[TMP87:%.*]] = extractelement <32 x i1> [[TMP10]], i32 11
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP87]])
+; CHECK-NEXT: [[TMP88:%.*]] = extractelement <32 x i1> [[TMP10]], i32 12
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP88]])
+; CHECK-NEXT: [[TMP89:%.*]] = extractelement <32 x i1> [[TMP10]], i32 13
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP89]])
+; CHECK-NEXT: [[TMP90:%.*]] = extractelement <32 x i1> [[TMP10]], i32 14
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP90]])
+; CHECK-NEXT: [[TMP91:%.*]] = extractelement <32 x i1> [[TMP10]], i32 15
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP91]])
+; CHECK-NEXT: [[TMP92:%.*]] = extractelement <32 x i1> [[TMP10]], i32 16
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP92]])
+; CHECK-NEXT: [[TMP93:%.*]] = extractelement <32 x i1> [[TMP10]], i32 17
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP93]])
+; CHECK-NEXT: [[TMP94:%.*]] = extractelement <32 x i1> [[TMP10]], i32 18
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP94]])
+; CHECK-NEXT: [[TMP95:%.*]] = extractelement <32 x i1> [[TMP10]], i32 19
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP95]])
+; CHECK-NEXT: [[TMP96:%.*]] = extractelement <32 x i1> [[TMP10]], i32 20
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP96]])
+; CHECK-NEXT: [[TMP97:%.*]] = extractelement <32 x i1> [[TMP10]], i32 21
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP97]])
+; CHECK-NEXT: [[TMP98:%.*]] = extractelement <32 x i1> [[TMP10]], i32 22
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP98]])
+; CHECK-NEXT: [[TMP99:%.*]] = extractelement <32 x i1> [[TMP10]], i32 23
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP99]])
+; CHECK-NEXT: [[TMP100:%.*]] = extractelement <32 x i1> [[TMP10]], i32 24
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP100]])
+; CHECK-NEXT: [[TMP101:%.*]] = extractelement <32 x i1> [[TMP10]], i32 25
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP101]])
+; CHECK-NEXT: [[TMP102:%.*]] = extractelement <32 x i1> [[TMP10]], i32 26
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP102]])
+; CHECK-NEXT: [[TMP103:%.*]] = extractelement <32 x i1> [[TMP10]], i32 27
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP103]])
+; CHECK-NEXT: [[TMP104:%.*]] = extractelement <32 x i1> [[TMP10]], i32 28
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP104]])
+; CHECK-NEXT: [[TMP105:%.*]] = extractelement <32 x i1> [[TMP10]], i32 29
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP105]])
+; CHECK-NEXT: [[TMP106:%.*]] = extractelement <32 x i1> [[TMP10]], i32 30
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP106]])
+; CHECK-NEXT: [[TMP107:%.*]] = extractelement <32 x i1> [[TMP10]], i32 31
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP107]])
+; CHECK-NEXT: [[TMP108:%.*]] = extractelement <32 x i1> [[TMP11]], i32 0
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP108]])
+; CHECK-NEXT: [[TMP109:%.*]] = extractelement <32 x i1> [[TMP11]], i32 1
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP109]])
+; CHECK-NEXT: [[TMP110:%.*]] = extractelement <32 x i1> [[TMP11]], i32 2
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP110]])
+; CHECK-NEXT: [[TMP111:%.*]] = extractelement <32 x i1> [[TMP11]], i32 3
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP111]])
+; CHECK-NEXT: [[TMP112:%.*]] = extractelement <32 x i1> [[TMP11]], i32 4
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP112]])
+; CHECK-NEXT: [[TMP113:%.*]] = extractelement <32 x i1> [[TMP11]], i32 5
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP113]])
+; CHECK-NEXT: [[TMP114:%.*]] = extractelement <32 x i1> [[TMP11]], i32 6
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP114]])
+; CHECK-NEXT: [[TMP115:%.*]] = extractelement <32 x i1> [[TMP11]], i32 7
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP115]])
+; CHECK-NEXT: [[TMP116:%.*]] = extractelement <32 x i1> [[TMP11]], i32 8
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP116]])
+; CHECK-NEXT: [[TMP117:%.*]] = extractelement <32 x i1> [[TMP11]], i32 9
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP117]])
+; CHECK-NEXT: [[TMP118:%.*]] = extractelement <32 x i1> [[TMP11]], i32 10
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP118]])
+; CHECK-NEXT: [[TMP119:%.*]] = extractelement <32 x i1> [[TMP11]], i32 11
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP119]])
+; CHECK-NEXT: [[TMP120:%.*]] = extractelement <32 x i1> [[TMP11]], i32 12
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP120]])
+; CHECK-NEXT: [[TMP121:%.*]] = extractelement <32 x i1> [[TMP11]], i32 13
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP121]])
+; CHECK-NEXT: [[TMP122:%.*]] = extractelement <32 x i1> [[TMP11]], i32 14
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP122]])
+; CHECK-NEXT: [[TMP123:%.*]] = extractelement <32 x i1> [[TMP11]], i32 15
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP123]])
+; CHECK-NEXT: [[TMP124:%.*]] = extractelement <32 x i1> [[TMP11]], i32 16
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP124]])
+; CHECK-NEXT: [[TMP125:%.*]] = extractelement <32 x i1> [[TMP11]], i32 17
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP125]])
+; CHECK-NEXT: [[TMP126:%.*]] = extractelement <32 x i1> [[TMP11]], i32 18
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP126]])
+; CHECK-NEXT: [[TMP127:%.*]] = extractelement <32 x i1> [[TMP11]], i32 19
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP127]])
+; CHECK-NEXT: [[TMP128:%.*]] = extractelement <32 x i1> [[TMP11]], i32 20
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP128]])
+; CHECK-NEXT: [[TMP129:%.*]] = extractelement <32 x i1> [[TMP11]], i32 21
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP129]])
+; CHECK-NEXT: [[TMP130:%.*]] = extractelement <32 x i1> [[TMP11]], i32 22
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP130]])
+; CHECK-NEXT: [[TMP131:%.*]] = extractelement <32 x i1> [[TMP11]], i32 23
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP131]])
+; CHECK-NEXT: [[TMP132:%.*]] = extractelement <32 x i1> [[TMP11]], i32 24
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP132]])
+; CHECK-NEXT: [[TMP133:%.*]] = extractelement <32 x i1> [[TMP11]], i32 25
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP133]])
+; CHECK-NEXT: [[TMP134:%.*]] = extractelement <32 x i1> [[TMP11]], i32 26
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP134]])
+; CHECK-NEXT: [[TMP135:%.*]] = extractelement <32 x i1> [[TMP11]], i32 27
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP135]])
+; CHECK-NEXT: [[TMP136:%.*]] = extractelement <32 x i1> [[TMP11]], i32 28
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP136]])
+; CHECK-NEXT: [[TMP137:%.*]] = extractelement <32 x i1> [[TMP11]], i32 29
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP137]])
+; CHECK-NEXT: [[TMP138:%.*]] = extractelement <32 x i1> [[TMP11]], i32 30
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP138]])
+; CHECK-NEXT: [[TMP139:%.*]] = extractelement <32 x i1> [[TMP11]], i32 31
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP139]])
+; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 128
+; CHECK-NEXT: [[PTR_IND]] = getelementptr i8, ptr [[POINTER_PHI]], i64 -1024
+; CHECK-NEXT: [[TMP140:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
+; CHECK-NEXT: br i1 [[TMP140]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
+; CHECK: [[MIDDLE_BLOCK]]:
+; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[TMP2]], [[N_VEC]]
+; CHECK-NEXT: [[CMO:%.*]] = sub i64 [[N_VEC]], 1
+; CHECK-NEXT: [[TMP141:%.*]] = mul i64 [[CMO]], -8
+; CHECK-NEXT: [[IND_ESCAPE:%.*]] = getelementptr i8, ptr [[START]], i64 [[TMP141]]
+; CHECK-NEXT: br i1 [[CMP_N]], label %[[EXIT:.*]], label %[[SCALAR_PH]]
+; CHECK: [[SCALAR_PH]]:
+; CHECK-NEXT: [[BC_RESUME_VAL:%.*]] = phi ptr [ [[IND_END]], %[[MIDDLE_BLOCK]] ], [ [[START]], %[[ENTRY]] ]
+; CHECK-NEXT: br label %[[LOOP:.*]]
+; CHECK: [[LOOP]]:
+; CHECK-NEXT: [[IV:%.*]] = phi ptr [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ]
+; CHECK-NEXT: [[IV_NEXT]] = getelementptr nusw i8, ptr [[IV]], i64 -8
+; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[IV]], align 4
+; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[L1]], 0
+; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
+; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq ptr [[IV]], [[END]]
+; CHECK-NEXT: br i1 [[CMP_NOT]], label %[[EXIT]], label %[[LOOP]], !llvm.loop [[LOOP3:![0-9]+]]
+; CHECK: [[EXIT]]:
+; CHECK-NEXT: [[IV_LCSSA:%.*]] = phi ptr [ [[IV]], %[[LOOP]] ], [ [[IND_ESCAPE]], %[[MIDDLE_BLOCK]] ]
+; CHECK-NEXT: [[FINAL_LOAD:%.*]] = load i32, ptr [[IV_LCSSA]], align 4
+; CHECK-NEXT: ret i32 [[FINAL_LOAD]]
+;
+entry:
+ br label %loop
+
+loop:
+ %iv = phi ptr [ %start, %entry ],[ %iv.next, %loop ]
+ %iv.next = getelementptr nusw i8, ptr %iv, i64 -8
+ %l1 = load i32, ptr %iv, align 4
+ %cmp = icmp ne i32 %l1, 0
+ call void @llvm.assume(i1 %cmp)
+ %cmp.not = icmp eq ptr %iv, %end
+ br i1 %cmp.not, label %exit, label %loop
+
+exit:
+ %final.load = load i32, ptr %iv, align 4
+ ret i32 %final.load
+}
+
+; FIXME: shouldn't be vectorized, as the only vector values generated are
+; ephemeral.
+define i32 @ephemeral_load_and_compare_another_load_used_outside(ptr %start, ptr %end) #0 {
+; CHECK-LABEL: define i32 @ephemeral_load_and_compare_another_load_used_outside(
+; CHECK-SAME: ptr [[START:%.*]], ptr [[END:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT: [[ENTRY:.*]]:
+; CHECK-NEXT: [[END2:%.*]] = ptrtoint ptr [[END]] to i64
+; CHECK-NEXT: [[START1:%.*]] = ptrtoint ptr [[START]] to i64
+; CHECK-NEXT: [[TMP0:%.*]] = sub i64 [[START1]], [[END2]]
+; CHECK-NEXT: [[TMP1:%.*]] = lshr i64 [[TMP0]], 3
+; CHECK-NEXT: [[TMP2:%.*]] = add nuw nsw i64 [[TMP1]], 1
+; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[TMP2]], 16
+; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
+; CHECK: [[VECTOR_PH]]:
+; CHECK-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[TMP2]], 16
+; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[TMP2]], [[N_MOD_VF]]
+; CHECK-NEXT: [[TMP3:%.*]] = mul i64 [[N_VEC]], -8
+; CHECK-NEXT: [[IND_END:%.*]] = getelementptr i8, ptr [[START]], i64 [[TMP3]]
+; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
+; CHECK: [[VECTOR_BODY]]:
+; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = load ptr, ptr [[END]], align 8
+; CHECK-NEXT: [[BROADCAST_SPLATINSERT9:%.*]] = insertelement <4 x ptr> poison, ptr [[TMP4]], i64 0
+; CHECK-NEXT: [[BROADCAST_SPLAT10:%.*]] = shufflevector <4 x ptr> [[BROADCAST_SPLATINSERT9]], <4 x ptr> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> [[BROADCAST_SPLAT10]], i32 4, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i32> poison)
+; CHECK-NEXT: [[WIDE_MASKED_GATHER5:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> [[BROADCAST_SPLAT10]], i32 4, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i32> poison)
+; CHECK-NEXT: [[WIDE_MASKED_GATHER8:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> [[BROADCAST_SPLAT10]], i32 4, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i32> poison)
+; CHECK-NEXT: [[WIDE_MASKED_GATHER11:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> [[BROADCAST_SPLAT10]], i32 4, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i32> poison)
+; CHECK-NEXT: [[TMP5:%.*]] = icmp ne <4 x i32> [[WIDE_MASKED_GATHER]], zeroinitializer
+; CHECK-NEXT: [[TMP6:%.*]] = icmp ne <4 x i32> [[WIDE_MASKED_GATHER5]], zeroinitializer
+; CHECK-NEXT: [[TMP7:%.*]] = icmp ne <4 x i32> [[WIDE_MASKED_GATHER8]], zeroinitializer
+; CHECK-NEXT: [[TMP8:%.*]] = icmp ne <4 x i32> [[WIDE_MASKED_GATHER11]], zeroinitializer
+; CHECK-NEXT: [[TMP9:%.*]] = extractelement <4 x i1> [[TMP5]], i32 0
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP9]])
+; CHECK-NEXT: [[TMP10:%.*]] = extractelement <4 x i1> [[TMP5]], i32 1
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP10]])
+; CHECK-NEXT: [[TMP11:%.*]] = extractelement <4 x i1> [[TMP5]], i32 2
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP11]])
+; CHECK-NEXT: [[TMP12:%.*]] = extractelement <4 x i1> [[TMP5]], i32 3
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP12]])
+; CHECK-NEXT: [[TMP13:%.*]] = extractelement <4 x i1> [[TMP6]], i32 0
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP13]])
+; CHECK-NEXT: [[TMP14:%.*]] = extractelement <4 x i1> [[TMP6]], i32 1
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP14]])
+; CHECK-NEXT: [[TMP15:%.*]] = extractelement <4 x i1> [[TMP6]], i32 2
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP15]])
+; CHECK-NEXT: [[TMP16:%.*]] = extractelement <4 x i1> [[TMP6]], i32 3
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP16]])
+; CHECK-NEXT: [[TMP17:%.*]] = extractelement <4 x i1> [[TMP7]], i32 0
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP17]])
+; CHECK-NEXT: [[TMP18:%.*]] = extractelement <4 x i1> [[TMP7]], i32 1
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP18]])
+; CHECK-NEXT: [[TMP19:%.*]] = extractelement <4 x i1> [[TMP7]], i32 2
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP19]])
+; CHECK-NEXT: [[TMP20:%.*]] = extractelement <4 x i1> [[TMP7]], i32 3
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP20]])
+; CHECK-NEXT: [[TMP21:%.*]] = extractelement <4 x i1> [[TMP8]], i32 0
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP21]])
+; CHECK-NEXT: [[TMP22:%.*]] = extractelement <4 x i1> [[TMP8]], i32 1
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP22]])
+; CHECK-NEXT: [[TMP23:%.*]] = extractelement <4 x i1> [[TMP8]], i32 2
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP23]])
+; CHECK-NEXT: [[TMP24:%.*]] = extractelement <4 x i1> [[TMP8]], i32 3
+; CHECK-NEXT: call void @llvm.assume(i1 [[TMP24]])
+; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 16
+; CHECK-NEXT: [[TMP25:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
+; CHECK-NEXT: br i1 [[TMP25]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP4:![0-9]+]]
+; CHECK: [[MIDDLE_BLOCK]]:
+; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[TMP2]], [[N_VEC]]
+; CHECK-NEXT: br i1 [[CMP_N]], label %[[EXIT:.*]], label %[[SCALAR_PH]]
+; CHECK: [[SCALAR_PH]]:
+; CHECK-NEXT: [[BC_RESUME_VAL:%.*]] = phi ptr [ [[IND_END]], %[[MIDDLE_BLOCK]] ], [ [[START]], %[[ENTRY]] ]
+; CHECK-NEXT: br label %[[LOOP:.*]]
+; CHECK: [[LOOP]]:
+; CHECK-NEXT: [[IV:%.*]] = phi ptr [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT2:%.*]], %[[LOOP]] ]
+; CHECK-NEXT: [[IV_NEXT2]] = getelementptr nusw i8, ptr [[IV]], i64 -8
+; CHECK-NEXT: [[L1:%.*]] = load ptr, ptr [[END]], align 8
+; CHECK-NEXT: [[L2:%.*]] = load i32, ptr [[L1]], align 4
+; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[L2]], 0
+; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
+; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq ptr [[IV]], [[END]]
+; CHECK-NEXT: br i1 [[CMP_NOT]], label %[[EXIT]], label %[[LOOP]], !llvm.loop [[LOOP5:![0-9]+]]
+; CHECK: [[EXIT]]:
+; CHECK-NEXT: [[L1_LCSSA:%.*]] = phi ptr [ [[L1]], %[[LOOP]] ], [ [[TMP4]], %[[MIDDLE_BLOCK]] ]
+; CHECK-NEXT: [[FINAL_LOAD:%.*]] = load i32, ptr [[L1_LCSSA]], align 4
+; CHECK-NEXT: ret i32 [[FINAL_LOAD]]
+;
+entry:
+ br label %loop
+
+loop:
+ %iv = phi ptr [ %start, %entry ], [ %iv.next2, %loop ]
+ %iv.next2 = getelementptr nusw i8, ptr %iv, i64 -8
+ %l1 = load ptr, ptr %end, align 8
+ %l2 = load i32, ptr %l1, align 4
+ %cmp = icmp ne i32 %l2, 0
+ call void @llvm.assume(i1 %cmp)
+ %cmp.not = icmp eq ptr %iv, %end
+ br i1 %cmp.not, label %exit, label %loop
+
+exit:
+ %final.load = load i32, ptr %l1, align 4
+ ret i32 %final.load
+}
+
+declare void @llvm.assume(i1 noundef)
+
+attributes #0 = { "target-cpu"="skylake-avx512" }
+;.
+; CHECK: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]], [[META2:![0-9]+]]}
+; CHECK: [[META1]] = !{!"llvm.loop.isvectorized", i32 1}
+; CHECK: [[META2]] = !{!"llvm.loop.unroll.runtime.disable"}
+; CHECK: [[LOOP3]] = distinct !{[[LOOP3]], [[META2]], [[META1]]}
+; CHECK: [[LOOP4]] = distinct !{[[LOOP4]], [[META1]], [[META2]]}
+; CHECK: [[LOOP5]] = distinct !{[[LOOP5]], [[META2]], [[META1]]}
+;.
More information about the llvm-commits
mailing list