<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Mikhail,<div class=""><br class=""></div><div class="">I think I found the problem and it boils down to: we want to reapply this piece of code:</div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-    // We have to sign-extend even if Extension == EK_ZeroExt as we can't</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-    // decompose a sign extension (i.e. zext(x - 1) != zext(x) - zext(-1)).</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-    Offset = Offset.sext(OldWidth);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">+    Offset = Offset.zext(OldWidth);</div><div><br class=""></div><div>I.e., we want to do the sext, not the zext.</div><div>The problem is that we zext -1 on i32 and get INT_MAX, which did not translate to -1 on i64.</div><div><br class=""></div><div>@Hal, Nick, does this sound like the right thing to fix to you?</div><div><br class=""></div><div>Cheers,</div><div>-Quentin<br class=""><blockquote type="cite" class=""><div class="">On Aug 25, 2015, at 5:39 PM, Quentin Colombet via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hi Mikhail,<br class=""><br class="">Thanks for the test case, I am looking into it.<br class=""><br class="">Cheers,<br class="">-Quentin<br class=""><blockquote type="cite" class="">On Aug 25, 2015, at 5:18 PM, Mikhail Zolotukhin <<a href="mailto:mzolotukhin@apple.com" class="">mzolotukhin@apple.com</a>> wrote:<br class=""><br class="">Hi Quentin,<br class=""><br class="">I just found that this revert causes some failures - probably because the original patch also contained a fix for some issue. Could you please take a look at this? (if you don't have time, I'll try to do that a bit later). The attached test case shows the problem:<br class=""><br class=""><r245394.ll><br class="">(reduced from a real test case - after r245394 we erroneously report NoAlias instead of MustAlias in this case.)<br class=""><br class="">Also, since it has gotten to 3.7 already, we might need a fix for this issue there too.<br class=""><br class="">Thanks,<br class="">Michael<br class=""><br class=""><br class=""><blockquote type="cite" class="">On Aug 18, 2015, at 5:07 PM, Quentin Colombet via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""><br class="">Author: qcolombet<br class="">Date: Tue Aug 18 19:07:20 2015<br class="">New Revision: 245394<br class=""><br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D245394-26view-3Drev&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=JPD1d_NPvshcGEeCbKCVLmlnWxyLhuJD4Am1p-lQVLw&s=uN7xVO3PMr7Ex7x-tHgTpdWAdesokk9Fc62u8-7eqt8&e=" class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D245394-26view-3Drev&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=JPD1d_NPvshcGEeCbKCVLmlnWxyLhuJD4Am1p-lQVLw&s=uN7xVO3PMr7Ex7x-tHgTpdWAdesokk9Fc62u8-7eqt8&e=</a> <br class="">Log:<br class="">[BasicAA] Revert r221876 because it can produce incorrect aliasing<br class="">information: see PR24468.<br class=""><br class="">Removed:<br class="">  llvm/trunk/test/Analysis/BasicAA/zext.ll<br class="">Modified:<br class="">  llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp<br class="">  llvm/trunk/test/Analysis/BasicAA/phi-aa.ll<br class=""><br class="">Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Analysis_BasicAliasAnalysis.cpp-3Frev-3D245394-26r1-3D245393-26r2-3D245394-26view-3Ddiff&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=JPD1d_NPvshcGEeCbKCVLmlnWxyLhuJD4Am1p-lQVLw&s=kwy7CBCC60PY0_h45LQtQxHRIlCgsdD1nak_oWT7xAs&e=" class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Analysis_BasicAliasAnalysis.cpp-3Frev-3D245394-26r1-3D245393-26r2-3D245394-26view-3Ddiff&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=JPD1d_NPvshcGEeCbKCVLmlnWxyLhuJD4Am1p-lQVLw&s=kwy7CBCC60PY0_h45LQtQxHRIlCgsdD1nak_oWT7xAs&e=</a> <br class="">==============================================================================<br class="">--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)<br class="">+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Aug 18 19:07:20 2015<br class="">@@ -190,14 +190,6 @@ static bool isObjectSize(const Value *V,<br class="">   return V;<br class=""> }<br class=""><br class="">-  if (ConstantInt *Const = dyn_cast<ConstantInt>(V)) {<br class="">-    // if it's a constant, just convert it to an offset<br class="">-    // and remove the variable.<br class="">-    Offset += Const->getValue();<br class="">-    assert(Scale == 0 && "Constant values don't have a scale");<br class="">-    return V;<br class="">-  }<br class="">-<br class=""> if (BinaryOperator *BOp = dyn_cast<BinaryOperator>(V)) {<br class="">   if (ConstantInt *RHSC = dyn_cast<ConstantInt>(BOp->getOperand(1))) {<br class="">     switch (BOp->getOpcode()) {<br class="">@@ -246,10 +238,7 @@ static bool isObjectSize(const Value *V,<br class="">   Value *Result = GetLinearExpression(CastOp, Scale, Offset, Extension, DL,<br class="">                                       Depth + 1, AC, DT);<br class="">   Scale = Scale.zext(OldWidth);<br class="">-<br class="">-    // We have to sign-extend even if Extension == EK_ZeroExt as we can't<br class="">-    // decompose a sign extension (i.e. zext(x - 1) != zext(x) - zext(-1)).<br class="">-    Offset = Offset.sext(OldWidth);<br class="">+    Offset = Offset.zext(OldWidth);<br class=""><br class="">   return Result;<br class=""> }<br class="">@@ -959,42 +948,12 @@ AliasResult BasicAliasAnalysis::aliasGEP<br class="">   }<br class=""> }<br class=""><br class="">+  // Try to distinguish something like &A[i][1] against &A[42][0].<br class="">+  // Grab the least significant bit set in any of the scales.<br class=""> if (!GEP1VariableIndices.empty()) {<br class="">   uint64_t Modulo = 0;<br class="">-    bool AllPositive = true;<br class="">-    for (unsigned i = 0, e = GEP1VariableIndices.size(); i != e; ++i) {<br class="">-<br class="">-      // Try to distinguish something like &A[i][1] against &A[42][0].<br class="">-      // Grab the least significant bit set in any of the scales. We<br class="">-      // don't need std::abs here (even if the scale's negative) as we'll<br class="">-      // be ^'ing Modulo with itself later.<br class="">+    for (unsigned i = 0, e = GEP1VariableIndices.size(); i != e; ++i)<br class="">     Modulo |= (uint64_t)GEP1VariableIndices[i].Scale;<br class="">-<br class="">-      if (AllPositive) {<br class="">-        // If the Value could change between cycles, then any reasoning about<br class="">-        // the Value this cycle may not hold in the next cycle. We'll just<br class="">-        // give up if we can't determine conditions that hold for every cycle:<br class="">-        const Value *V = GEP1VariableIndices[i].V;<br class="">-<br class="">-        bool SignKnownZero, SignKnownOne;<br class="">-        ComputeSignBit(const_cast<Value *>(V), SignKnownZero, SignKnownOne, *DL,<br class="">-                       0, AC1, nullptr, DT);<br class="">-<br class="">-        // Zero-extension widens the variable, and so forces the sign<br class="">-        // bit to zero.<br class="">-        bool IsZExt = GEP1VariableIndices[i].Extension == EK_ZeroExt;<br class="">-        SignKnownZero |= IsZExt;<br class="">-        SignKnownOne &= !IsZExt;<br class="">-<br class="">-        // If the variable begins with a zero then we know it's<br class="">-        // positive, regardless of whether the value is signed or<br class="">-        // unsigned.<br class="">-        int64_t Scale = GEP1VariableIndices[i].Scale;<br class="">-        AllPositive =<br class="">-            (SignKnownZero && Scale >= 0) || (SignKnownOne && Scale < 0);<br class="">-      }<br class="">-    }<br class="">-<br class="">   Modulo = Modulo ^ (Modulo & (Modulo - 1));<br class=""><br class="">   // We can compute the difference between the two addresses<br class="">@@ -1005,12 +964,6 @@ AliasResult BasicAliasAnalysis::aliasGEP<br class="">       V2Size != MemoryLocation::UnknownSize && ModOffset >= V2Size &&<br class="">       V1Size <= Modulo - ModOffset)<br class="">     return NoAlias;<br class="">-<br class="">-    // If we know all the variables are positive, then GEP1 >= GEP1BasePtr.<br class="">-    // If GEP1BasePtr > V2 (GEP1BaseOffset > 0) then we know the pointers<br class="">-    // don't alias if V2Size can fit in the gap between V2 and GEP1BasePtr.<br class="">-    if (AllPositive && GEP1BaseOffset > 0 && V2Size <= (uint64_t)GEP1BaseOffset)<br class="">-      return NoAlias;<br class=""> }<br class=""><br class=""> // Statically, we can see that the base objects are the same, but the<br class=""><br class="">Modified: llvm/trunk/test/Analysis/BasicAA/phi-aa.ll<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_test_Analysis_BasicAA_phi-2Daa.ll-3Frev-3D245394-26r1-3D245393-26r2-3D245394-26view-3Ddiff&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=JPD1d_NPvshcGEeCbKCVLmlnWxyLhuJD4Am1p-lQVLw&s=cehKOdzc-AApufyxhgLw_vGfRZjjrQELvwb9VtQhG6Y&e=" class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_test_Analysis_BasicAA_phi-2Daa.ll-3Frev-3D245394-26r1-3D245393-26r2-3D245394-26view-3Ddiff&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=JPD1d_NPvshcGEeCbKCVLmlnWxyLhuJD4Am1p-lQVLw&s=cehKOdzc-AApufyxhgLw_vGfRZjjrQELvwb9VtQhG6Y&e=</a> <br class="">==============================================================================<br class="">--- llvm/trunk/test/Analysis/BasicAA/phi-aa.ll (original)<br class="">+++ llvm/trunk/test/Analysis/BasicAA/phi-aa.ll Tue Aug 18 19:07:20 2015<br class="">@@ -39,7 +39,6 @@ return:<br class=""><br class="">; CHECK-LABEL: pr18068<br class="">; CHECK: MayAlias: i32* %0, i32* %arrayidx5<br class="">-; CHECK: NoAlias: i32* %arrayidx13, i32* %arrayidx5<br class=""><br class="">define i32 @pr18068(i32* %jj7, i32* %j) {<br class="">entry:<br class=""><br class="">Removed: llvm/trunk/test/Analysis/BasicAA/zext.ll<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_test_Analysis_BasicAA_zext.ll-3Frev-3D245393-26view-3Dauto&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=JPD1d_NPvshcGEeCbKCVLmlnWxyLhuJD4Am1p-lQVLw&s=wdYogyNitYplNTvO10DlNZoWUJYAlarw-Tep_HnkBAc&e=" class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_test_Analysis_BasicAA_zext.ll-3Frev-3D245393-26view-3Dauto&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=JPD1d_NPvshcGEeCbKCVLmlnWxyLhuJD4Am1p-lQVLw&s=wdYogyNitYplNTvO10DlNZoWUJYAlarw-Tep_HnkBAc&e=</a> <br class="">==============================================================================<br class="">--- llvm/trunk/test/Analysis/BasicAA/zext.ll (original)<br class="">+++ llvm/trunk/test/Analysis/BasicAA/zext.ll (removed)<br class="">@@ -1,209 +0,0 @@<br class="">-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s<br class="">-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"<br class="">-target triple = "x86_64-unknown-linux-gnu"<br class="">-<br class="">-; CHECK-LABEL: test_with_zext<br class="">-; CHECK:  NoAlias: i8* %a, i8* %b<br class="">-<br class="">-define void @test_with_zext() {<br class="">-  %1 = tail call i8* @malloc(i64 120)<br class="">-  %a = getelementptr inbounds i8, i8* %1, i64 8<br class="">-  %2 = getelementptr inbounds i8, i8* %1, i64 16<br class="">-  %3 = zext i32 3 to i64<br class="">-  %b = getelementptr inbounds i8, i8* %2, i64 %3<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; CHECK-LABEL: test_with_lshr<br class="">-; CHECK:  NoAlias: i8* %a, i8* %b<br class="">-<br class="">-define void @test_with_lshr(i64 %i) {<br class="">-  %1 = tail call i8* @malloc(i64 120)<br class="">-  %a = getelementptr inbounds i8, i8* %1, i64 8<br class="">-  %2 = getelementptr inbounds i8, i8* %1, i64 16<br class="">-  %3 = lshr i64 %i, 2<br class="">-  %b = getelementptr inbounds i8, i8* %2, i64 %3<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; CHECK-LABEL: test_with_a_loop<br class="">-; CHECK:  NoAlias: i8* %a, i8* %b<br class="">-<br class="">-define void @test_with_a_loop(i8* %mem) {<br class="">-  br label %for.loop<br class="">-<br class="">-for.loop:<br class="">-  %i = phi i32 [ 0, %0 ], [ %i.plus1, %for.loop ]<br class="">-  %a = getelementptr inbounds i8, i8* %mem, i64 8<br class="">-  %a.plus1 = getelementptr inbounds i8, i8* %mem, i64 16<br class="">-  %i.64 = zext i32 %i to i64<br class="">-  %b = getelementptr inbounds i8, i8* %a.plus1, i64 %i.64<br class="">-  %i.plus1 = add nuw nsw i32 %i, 1<br class="">-  %cmp = icmp eq i32 %i.plus1, 10<br class="">-  br i1 %cmp, label %for.loop.exit, label %for.loop<br class="">-<br class="">-for.loop.exit:<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; CHECK-LABEL: test_with_varying_base_pointer_in_loop<br class="">-; CHECK:  NoAlias: i8* %a, i8* %b<br class="">-<br class="">-define void @test_with_varying_base_pointer_in_loop(i8* %mem.orig) {<br class="">-  br label %for.loop<br class="">-<br class="">-for.loop:<br class="">-  %mem = phi i8* [ %mem.orig, %0 ], [ %mem.plus1, %for.loop ]<br class="">-  %i = phi i32 [ 0, %0 ], [ %i.plus1, %for.loop ]<br class="">-  %a = getelementptr inbounds i8, i8* %mem, i64 8<br class="">-  %a.plus1 = getelementptr inbounds i8, i8* %mem, i64 16<br class="">-  %i.64 = zext i32 %i to i64<br class="">-  %b = getelementptr inbounds i8, i8* %a.plus1, i64 %i.64<br class="">-  %i.plus1 = add nuw nsw i32 %i, 1<br class="">-  %mem.plus1 = getelementptr inbounds i8, i8* %mem, i64 8<br class="">-  %cmp = icmp eq i32 %i.plus1, 10<br class="">-  br i1 %cmp, label %for.loop.exit, label %for.loop<br class="">-<br class="">-for.loop.exit:<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; CHECK-LABEL: test_sign_extension<br class="">-; CHECK:  PartialAlias: i64* %b.i64, i8* %a<br class="">-<br class="">-define void @test_sign_extension(i32 %p) {<br class="">-  %1 = tail call i8* @malloc(i64 120)<br class="">-  %p.64 = zext i32 %p to i64<br class="">-  %a = getelementptr inbounds i8, i8* %1, i64 %p.64<br class="">-  %p.minus1 = add i32 %p, -1<br class="">-  %p.minus1.64 = zext i32 %p.minus1 to i64<br class="">-  %b.i8 = getelementptr inbounds i8, i8* %1, i64 %p.minus1.64<br class="">-  %b.i64 = bitcast i8* %b.i8 to i64*<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; CHECK-LABEL: test_fe_tools<br class="">-; CHECK:  PartialAlias: i32* %a, i32* %b<br class="">-<br class="">-define void @test_fe_tools([8 x i32]* %values) {<br class="">-  br label %reorder<br class="">-<br class="">-for.loop:<br class="">-  %i = phi i32 [ 0, %reorder ], [ %i.next, %for.loop ]<br class="">-  %idxprom = zext i32 %i to i64<br class="">-  %b = getelementptr inbounds [8 x i32], [8 x i32]* %values, i64 0, i64 %idxprom<br class="">-  %i.next = add nuw nsw i32 %i, 1<br class="">-  %1 = icmp eq i32 %i.next, 10<br class="">-  br i1 %1, label %for.loop.exit, label %for.loop<br class="">-<br class="">-reorder:<br class="">-  %a = getelementptr inbounds [8 x i32], [8 x i32]* %values, i64 0, i64 1<br class="">-  br label %for.loop<br class="">-<br class="">-for.loop.exit:<br class="">-  ret void<br class="">-}<br class="">-<br class="">-@b = global i32 0, align 4<br class="">-@d = global i32 0, align 4<br class="">-<br class="">-; CHECK-LABEL: test_spec2006<br class="">-; CHECK:  PartialAlias: i32** %x, i32** %y<br class="">-<br class="">-define void @test_spec2006() {<br class="">-  %h = alloca [1 x [2 x i32*]], align 16<br class="">-  %d.val = load i32, i32* @d, align 4<br class="">-  %d.promoted = sext i32 %d.val to i64<br class="">-  %1 = icmp slt i32 %d.val, 2<br class="">-  br i1 %1, label %.lr.ph, label %3<br class="">-<br class="">-.lr.ph:                                           ; preds = %0<br class="">-  br label %2<br class="">-<br class="">-; <label>:2                                       ; preds = %.lr.ph, %2<br class="">-  %i = phi i32 [ %d.val, %.lr.ph ], [ %i.plus1, %2 ]<br class="">-  %i.promoted = sext i32 %i to i64<br class="">-  %x = getelementptr inbounds [1 x [2 x i32*]], [1 x [2 x i32*]]* %h, i64 0, i64 %d.promoted, i64 %i.promoted<br class="">-  %i.plus1 = add nsw i32 %i, 1<br class="">-  %cmp = icmp slt i32 %i.plus1, 2<br class="">-  br i1 %cmp, label %2, label %3<br class="">-<br class="">-; <label>:3                                      ; preds = %._crit_edge, %0<br class="">-  %y = getelementptr inbounds [1 x [2 x i32*]], [1 x [2 x i32*]]* %h, i64 0, i64 0, i64 1<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; CHECK-LABEL: test_modulo_analysis_easy_case<br class="">-; CHECK:  NoAlias: i32** %x, i32** %y<br class="">-<br class="">-define void @test_modulo_analysis_easy_case(i64 %i) {<br class="">-  %h = alloca [1 x [2 x i32*]], align 16<br class="">-  %x = getelementptr inbounds [1 x [2 x i32*]], [1 x [2 x i32*]]* %h, i64 0, i64 %i, i64 0<br class="">-  %y = getelementptr inbounds [1 x [2 x i32*]], [1 x [2 x i32*]]* %h, i64 0, i64 0, i64 1<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; CHECK-LABEL: test_modulo_analysis_in_loop<br class="">-; CHECK:  NoAlias: i32** %x, i32** %y<br class="">-<br class="">-define void @test_modulo_analysis_in_loop() {<br class="">-  %h = alloca [1 x [2 x i32*]], align 16<br class="">-  br label %for.loop<br class="">-<br class="">-for.loop:<br class="">-  %i = phi i32 [ 0, %0 ], [ %i.plus1, %for.loop ]<br class="">-  %i.promoted = sext i32 %i to i64<br class="">-  %x = getelementptr inbounds [1 x [2 x i32*]], [1 x [2 x i32*]]* %h, i64 0, i64 %i.promoted, i64 0<br class="">-  %y = getelementptr inbounds [1 x [2 x i32*]], [1 x [2 x i32*]]* %h, i64 0, i64 0, i64 1<br class="">-  %i.plus1 = add nsw i32 %i, 1<br class="">-  %cmp = icmp slt i32 %i.plus1, 2<br class="">-  br i1 %cmp, label %for.loop, label %for.loop.exit<br class="">-<br class="">-for.loop.exit:<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; CHECK-LABEL: test_modulo_analysis_with_global<br class="">-; CHECK:  PartialAlias: i32** %x, i32** %y<br class="">-<br class="">-define void @test_modulo_analysis_with_global() {<br class="">-  %h = alloca [1 x [2 x i32*]], align 16<br class="">-  %b = load i32, i32* @b, align 4<br class="">-  %b.promoted = sext i32 %b to i64<br class="">-  br label %for.loop<br class="">-<br class="">-for.loop:<br class="">-  %i = phi i32 [ 0, %0 ], [ %i.plus1, %for.loop ]<br class="">-  %i.promoted = sext i32 %i to i64<br class="">-  %x = getelementptr inbounds [1 x [2 x i32*]], [1 x [2 x i32*]]* %h, i64 0, i64 %i.promoted, i64 %b.promoted<br class="">-  %y = getelementptr inbounds [1 x [2 x i32*]], [1 x [2 x i32*]]* %h, i64 0, i64 0, i64 1<br class="">-  %i.plus1 = add nsw i32 %i, 1<br class="">-  %cmp = icmp slt i32 %i.plus1, 2<br class="">-  br i1 %cmp, label %for.loop, label %for.loop.exit<br class="">-<br class="">-for.loop.exit:<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; CHECK-LABEL: test_const_eval<br class="">-; CHECK: NoAlias: i8* %a, i8* %b<br class="">-define void @test_const_eval(i8* %ptr, i64 %offset) {<br class="">-  %a = getelementptr inbounds i8, i8* %ptr, i64 %offset<br class="">-  %a.dup = getelementptr inbounds i8, i8* %ptr, i64 %offset<br class="">-  %three = zext i32 3 to i64<br class="">-  %b = getelementptr inbounds i8, i8* %a.dup, i64 %three<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; CHECK-LABEL: test_const_eval_scaled<br class="">-; CHECK: MustAlias: i8* %a, i8* %b<br class="">-define void @test_const_eval_scaled(i8* %ptr) {<br class="">-  %three = zext i32 3 to i64<br class="">-  %six = mul i64 %three, 2<br class="">-  %a = getelementptr inbounds i8, i8* %ptr, i64 %six<br class="">-  %b = getelementptr inbounds i8, i8* %ptr, i64 6<br class="">-  ret void<br class="">-}<br class="">-<br class="">-; Function Attrs: nounwind<br class="">-declare noalias i8* @malloc(i64)<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=JPD1d_NPvshcGEeCbKCVLmlnWxyLhuJD4Am1p-lQVLw&s=74NySL8HBVdU7pCMgLoXJd5ey2Q9XzSAFwFv2CvUmu4&e= <br class=""></blockquote><br class=""></blockquote><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=Kar_gr4lUTX9iRgFLHyIPCR7VD3VlB3-02h_Q5v9oWk&m=_1-7k6xSn_u2VS4UNsm5yYCeB5SusIf_iRLLcW7iFM0&s=e446Had8KnR1Q5LZKXN_YSltrXEuynEwvC04rOPUiYc&e= <br class=""></div></blockquote></div><br class=""></div></body></html>