[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-09-15 Thread Cheng Shao via cfe-commits
TerrorJack wrote: This breaks wasm codegen: https://github.com/llvm/llvm-project/issues/108770 https://github.com/llvm/llvm-project/pull/105496 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-09-04 Thread Nikita Popov via cfe-commits
nikic wrote: This should be ready to re-apply now. https://github.com/llvm/llvm-project/pull/105496 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread Nikita Popov via cfe-commits
nikic wrote: I don't think we need to revert it. Without this patch it's mostly harmless. I've been working on a fix for this issue. I think we need to track NUW through LinearExpression using something along these lines: https://gist.github.com/nikic/d6986bb62539bba048ced15dd497a4fb https://

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread Hari Limaye via cfe-commits
hazzlim wrote: > @mikaelholmen Thanks for the reproducer, this makes the issue clear. BasicAA > is incorrectly returning NoAlias for the pointers due to #98608. > > The issue is that the `add` gets decomposed, but we preserve the nuw flag, > effectively making it an `add nuw i16 n, -1`. Thank

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread Nikita Popov via cfe-commits
nikic wrote: @mikaelholmen Thanks for the reproducer, this makes the issue clear. BasicAA is incorrectly returning NoAlias for the pointers due to https://github.com/llvm/llvm-project/pull/98608. The issue is that the `add` gets decomposed, but we preserve the nuw flag, effectively making it

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread via cfe-commits
zmodem wrote: We're seeing many test failures in Chromium after this change as well: https://crbug.com/362522336 https://github.com/llvm/llvm-project/pull/105496 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Maybe the patch introduced some miscompile? The patch affects only clang, but failing tests are LLVM, but tools compiled with patched clang with UBSAN enabled. Also there are branches checking sanitizers. https://github.com/llvm/llvm-project/pull/105496 __

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread David Sherwood via cfe-commits
david-arm wrote: > > > This patch breaks: > > > https://lab.llvm.org/buildbot/#/builders/25/builds/1952 > > > https://lab.llvm.org/buildbot/#/builders/52/builds/1775 > > > > > > From the buildbot run I can see 12 or 13 changes in the build that failed. > > Just out of curiosity how did you f

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > > This patch breaks: https://lab.llvm.org/buildbot/#/builders/25/builds/1952 > > https://lab.llvm.org/buildbot/#/builders/52/builds/1775 > > From the buildbot run I can see 12 or 13 changes in the build that failed. > Just out of curiosity how did you find out it was this p

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread David Sherwood via cfe-commits
david-arm wrote: > This patch breaks: https://lab.llvm.org/buildbot/#/builders/25/builds/1952 > https://lab.llvm.org/buildbot/#/builders/52/builds/1775 >From the buildbot run I can see 12 or 13 changes in the build that failed. >Just out of curiosity how did you find out it was this patch that

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-28 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: This patch breaks: https://lab.llvm.org/buildbot/#/builders/25/builds/1952 https://lab.llvm.org/buildbot/#/builders/52/builds/1775 https://github.com/llvm/llvm-project/pull/105496 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-27 Thread Hari Limaye via cfe-commits
https://github.com/hazzlim closed https://github.com/llvm/llvm-project/pull/105496 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-26 Thread Hari Limaye via cfe-commits
hazzlim wrote: I plan to land this patch later today, unless there are any objections / further comments. Thanks for reviewing @nikic @efriedma-quic https://github.com/llvm/llvm-project/pull/105496 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-21 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM; the approach here seems appropriate. (The EmitCheckedInBoundsGEP API could probably use a refactor so we don't have calls to isSignedOverflowDefined() scattered all over the place, but that's a separate issue.) https://github.

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-21 Thread Hari Limaye via cfe-commits
@@ -7,13 +7,6 @@ struct X { int a[2]; }; extern int bar(); -//. -// CHECK: @test.i23 = internal global i32 4, align 4 -// CHECK: @i = global i32 4, align 4 -// CHECK: @Arr = global [100 x i32] zeroinitializer, align 16 -// CHECK: @foo2.X = internal global ptr getelementptr (i8

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Hari Limaye (hazzlim) Changes Add nuw attribute to inbounds GEPs where the expression used to form the GEP is an addition of unsigned indices. --- Patch is 576.17 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Hari Limaye (hazzlim) Changes Add nuw attribute to inbounds GEPs where the expression used to form the GEP is an addition of unsigned indices. --- Patch is 576.17 KiB, truncated to 20.00 KiB below, full version: https://github.c

[clang] [clang] Add nuw attribute to GEPs (PR #105496)

2024-08-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Hari Limaye (hazzlim) Changes Add nuw attribute to inbounds GEPs where the expression used to form the GEP is an addition of unsigned indices. --- Patch is 576.17 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/l