[clang] [NFC] Remove redundant conditions (PR #159349)

2025-09-17 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto approved this pull request. https://github.com/llvm/llvm-project/pull/159349 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove redundant conditions (NFC) (PR #159349)

2025-09-17 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/159349 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove redundant conditions (NFC) (PR #159349)

2025-09-17 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto closed https://github.com/llvm/llvm-project/pull/159349 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [IR][clang][CodeGen] Introduce `!llvm.errno.tbaa` for errno alias disambiguation (PR #125258)

2025-09-15 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: Tests updated w/ new TBAA check lines, hopefully should be on track. https://github.com/llvm/llvm-project/pull/125258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [clang] Regenerate test checks including TBAA semantics (NFC) (PR #154347)

2025-09-12 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto closed https://github.com/llvm/llvm-project/pull/154347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Regenerate test checks including TBAA semantics (NFC) (PR #154347)

2025-09-12 Thread Antonio Frighetto via cfe-commits
@@ -1,15 +1,17 @@ -// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6 // RUN: %clang_cc1 -O3 -triple powerpc64le-unknown-unknown -target-cpu future \

[clang] [llvm] [clang] Regenerate test checks including TBAA semantics (NFC) (PR #154347)

2025-09-12 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: As NFC changes, will be merging these follow-ups soon, if there are no further concerns. https://github.com/llvm/llvm-project/pull/154347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [llvm] [IR][clang][CodeGen] Introduce `!llvm.errno.tbaa` for errno alias disambiguation (PR #125258)

2025-09-08 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: > It would probably be best to split up the LLVM and the Clang changes. Thank you, moved AA changes separately, addressed reviews. Updated this PR as well, pending an update on tests due to https://github.com/llvm/llvm-project/pull/147670. > (I do wonder whether we sho

[clang] [llvm] [IR][clang][CodeGen] Introduce `!llvm.errno.tbaa` for errno alias disambiguation (PR #125258)

2025-09-08 Thread Antonio Frighetto via cfe-commits
@@ -0,0 +1,90 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 +; RUN: opt -S -passes=instcombine < %s | FileCheck %s + +; sinf clobbering errno, but %p cannot alias errno per C/C++ strict aliasing rules via TBAA. +; Hence, can

[clang] [llvm] [IR][clang][CodeGen] Introduce `!llvm.errno.tbaa` for errno alias disambiguation (PR #125258)

2025-09-08 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/125258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Regenerate test checks including TBAA semantics (NFC) (PR #154347)

2025-08-19 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/154347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Support folding intrinsics into phis (PR #151115)

2025-07-29 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/151115 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Support folding intrinsics into phis (PR #151115)

2025-07-29 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto approved this pull request. LG. From https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2617, it seems like this might not fully subsume https://github.com/llvm/llvm-project/pull/149858; though, this looks an independent improvement regardless (if fine with

[clang] [clang][CodeGen] Set `dead_on_return` when passing arguments indirectly (PR #148159)

2025-07-18 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto closed https://github.com/llvm/llvm-project/pull/148159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Set `dead_on_return` when passing arguments indirectly (PR #148159)

2025-07-18 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/148159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Set `dead_on_return` when passing arguments indirectly (PR #148159)

2025-07-18 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/148159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Set `dead_on_return` on indirect pointer arguments (PR #148159)

2025-07-15 Thread Antonio Frighetto via cfe-commits
@@ -2852,8 +2852,21 @@ void CodeGenModule::ConstructAttributeList(StringRef Name, if (AI.getInReg()) Attrs.addAttribute(llvm::Attribute::InReg); - if (AI.getIndirectByVal()) + // Depending on the ABI, this may be either a byval or a dead_on_return +

[clang] [clang][CodeGen] Set `dead_on_return` on indirect pointer arguments (PR #148159)

2025-07-15 Thread Antonio Frighetto via cfe-commits
@@ -2852,8 +2852,17 @@ void CodeGenModule::ConstructAttributeList(StringRef Name, if (AI.getInReg()) Attrs.addAttribute(llvm::Attribute::InReg); - if (AI.getIndirectByVal()) + // Depending on the ABI, this may be either a byval or a dead_on_return +

[clang] [clang][CodeGen] Set `dead_on_return` on indirect pointer arguments (PR #148159)

2025-07-14 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: Updated, thanks, not sure how I overlooked that; hopefully should be on track. https://github.com/llvm/llvm-project/pull/148159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang][CodeGen] Set `dead_on_return` on indirect pointer arguments (PR #148159)

2025-07-11 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: Experiencing some ASan failures, I suspect we are adding the attribute on arguments where we shouldn't (possibly C++ destructors). https://github.com/llvm/llvm-project/pull/148159 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [llvm] [clang][CodeGen][AA] Introduce `!llvm.errno.tbaa` for errno alias disambiguation (PR #125258)

2025-05-29 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: > > Oh, sorry for not providing context earlier. The reasoning behind is to > > allow certain optimizations involving errno-writing libcalls (marked as > > `memory(errnomem: write)`) to occur, if we are able to prove the involved > > memory location does not alias errno

[clang] [llvm] [clang][CodeGen][AA] Introduce `!llvm.errno.tbaa` for errno alias disambiguation (PR #125258)

2025-05-29 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/125258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen][AA] Introduce `!llvm.errno.tbaa` for errno alias disambiguation (PR #125258)

2025-05-29 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/125258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen][AA] Add `!llvm.errno.tbaa` gathering int-compatible TBAA nodes (PR #125258)

2025-05-28 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: > Sorry, can you back up and explain the root problem you're trying to solve? > You have a platform where we're emitting accesses to `errno` as if it weren't > an `int`? What does it look like in source? Oh, sorry for not providing context earlier. The reasoning behind

[clang] [llvm] [clang][CodeGen][AA] Add `!llvm.errno.tbaa` gathering int-compatible TBAA nodes (PR #125258)

2025-05-26 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: Gentle ping, would be nice moving this forward. https://github.com/llvm/llvm-project/pull/125258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen][AA] Add `!llvm.errno.tbaa` gathering int-compatible TBAA nodes (PR #125258)

2025-04-25 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: Kind ping. https://github.com/llvm/llvm-project/pull/125258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] e9988c3 - [clang][Sema] Propagate qualifiers during derived-to-base conversion

2025-03-19 Thread Antonio Frighetto via cfe-commits
Author: Antonio Frighetto Date: 2025-03-19T09:04:29+01:00 New Revision: e9988c36ed788b2d1ce00b028bed51169bd8b02c URL: https://github.com/llvm/llvm-project/commit/e9988c36ed788b2d1ce00b028bed51169bd8b02c DIFF: https://github.com/llvm/llvm-project/commit/e9988c36ed788b2d1ce00b028bed51169bd8b02c.d

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-03-19 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto closed https://github.com/llvm/llvm-project/pull/127824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-03-19 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/127824 >From e9988c36ed788b2d1ce00b028bed51169bd8b02c Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 19 Mar 2025 09:04:29 +0100 Subject: [PATCH] [clang][Sema] Propagate qualifiers during derived-t

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-03-11 Thread Antonio Frighetto via cfe-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -ast-dump %s | FileCheck %s + +// Ensure volatile is preserved during derived-to-base conversion. antoniofrighetto wrote: Added, thanks! `__ptrauth` is in the process of being upstreamed, whereas `_A

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-03-11 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/127824 >From 47fc0c9fb963cef24a32078bc52232e69a93c211 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 19 Feb 2025 16:47:18 +0100 Subject: [PATCH] [clang][Sema] Propagate qualifiers during derived-t

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-02-27 Thread Antonio Frighetto via cfe-commits
@@ -3107,8 +3107,12 @@ Sema::PerformObjectMemberConversion(Expr *From, /*IgnoreAccess=*/true)) return ExprError(); - return ImpCastExprToType(From, DestType, CK_UncheckedDerivedToBase, - VK, &BasePath); + Quali

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-02-27 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/127824 >From aebd5455e9cf583b9f5a29c68d5217f49c7a49b5 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 19 Feb 2025 16:47:18 +0100 Subject: [PATCH 1/3] [clang][Sema] Propagate qualifiers during deriv

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-02-22 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/127824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-02-22 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/127824 >From aebd5455e9cf583b9f5a29c68d5217f49c7a49b5 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 19 Feb 2025 16:47:18 +0100 Subject: [PATCH 1/2] [clang][Sema] Propagate qualifiers during deriv

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-02-22 Thread Antonio Frighetto via cfe-commits
@@ -3107,8 +3107,11 @@ Sema::PerformObjectMemberConversion(Expr *From, /*IgnoreAccess=*/true)) return ExprError(); - return ImpCastExprToType(From, DestType, CK_UncheckedDerivedToBase, - VK, &BasePath); + if (F

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-02-22 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/127824 >From aebd5455e9cf583b9f5a29c68d5217f49c7a49b5 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 19 Feb 2025 16:47:18 +0100 Subject: [PATCH 1/2] [clang][Sema] Propagate qualifiers during deriv

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-02-22 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/127824 >From aebd5455e9cf583b9f5a29c68d5217f49c7a49b5 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 19 Feb 2025 16:47:18 +0100 Subject: [PATCH 1/2] [clang][Sema] Propagate qualifiers during deriv

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-02-22 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/127824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)

2025-02-22 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/127824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Propagate `volatile` during derived-to-base conversion (PR #127824)

2025-02-22 Thread Antonio Frighetto via cfe-commits
@@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -ast-dump %s | FileCheck %s antoniofrighetto wrote: Added a test in CodeGen too, thanks! https://github.com/llvm/llvm-project/pull/127824 ___ cfe-commits ma

[clang] [clang][Sema] Propagate `volatile` during derived-to-base conversion (PR #127824)

2025-02-22 Thread Antonio Frighetto via cfe-commits
@@ -3107,8 +3107,11 @@ Sema::PerformObjectMemberConversion(Expr *From, /*IgnoreAccess=*/true)) return ExprError(); - return ImpCastExprToType(From, DestType, CK_UncheckedDerivedToBase, - VK, &BasePath); + if (F

[clang] [clang][Sema] Propagate `volatile` during derived-to-base conversion (PR #127824)

2025-02-22 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/127824 >From aebd5455e9cf583b9f5a29c68d5217f49c7a49b5 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 19 Feb 2025 16:47:18 +0100 Subject: [PATCH] [clang][Sema] Propagate qualifiers during derived-t

[clang] [llvm] [clang][CodeGen][AA] Add `!llvm.errno.tbaa` gathering int-compatible TBAA nodes (PR #125258)

2025-02-21 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: > > so IIUC !llvm.errno.tbaa should just be a module-level list of > > int-compatible TBAA nodes. > > Yes, exactly. It should be a module level MD node, not on individual > instructions. Thank you, I'm updating this. I've been contemplating this, and thought originall

[clang] [llvm] [clang][CodeGen][AA] Add `!llvm.errno.tbaa` gathering int-compatible TBAA nodes (PR #125258)

2025-02-21 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/125258 >From 25e79b19581d47924c4b1a56d954031a09600b8f Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Tue, 18 Feb 2025 16:36:12 +0100 Subject: [PATCH 1/3] [GVN] Introduce test for PR125258 (NFC) --- .

[clang] [clang][Sema] Propagate `volatile` during derived-to-base conversion (PR #127824)

2025-02-20 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: > Should the result type of the ImplicitCastExpr be volatile in the AST? Definitely, updated, thanks! https://github.com/llvm/llvm-project/pull/127824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [clang][Sema] Propagate `volatile` during derived-to-base conversion (PR #127824)

2025-02-20 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/127824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Propagate `volatile` during derived-to-base conversion (PR #127824)

2025-02-20 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/127824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Propagate `volatile` qualifier in derived-to-base conversion (PR #127824)

2025-02-20 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/127824 >From 1c7357a3279322ba469c1293d49bfba67b0565b5 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 19 Feb 2025 16:47:18 +0100 Subject: [PATCH] [clang][Sema] Propagate `volatile` during derived-t

[clang] [clang][CodeGen] Propagate `volatile` qualifier in derived-to-base conversion (PR #127824)

2025-02-19 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto created https://github.com/llvm/llvm-project/pull/127824 A miscompilation issue has been addressed with improved handling. Fixes: https://github.com/llvm/llvm-project/issues/127683. >From fd06a833ba56f812693d89e19f594ed3f238fea4 Mon Sep 17 00:00:00 2001 From

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-02-05 Thread Antonio Frighetto via cfe-commits
@@ -82,7 +82,7 @@ define void @test_store(ptr %p) { @G = external global ptr define i8 @test_store_capture(ptr %p) { -; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: read, inaccessiblemem: none) +; FNATTRS: Functio

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-02-05 Thread Antonio Frighetto via cfe-commits
@@ -82,7 +82,7 @@ define void @test_store(ptr %p) { @G = external global ptr define i8 @test_store_capture(ptr %p) { -; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: read, inaccessiblemem: none) +; FNATTRS: Functio

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-02-05 Thread Antonio Frighetto via cfe-commits
@@ -82,7 +82,7 @@ define void @test_store(ptr %p) { @G = external global ptr define i8 @test_store_capture(ptr %p) { -; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: read, inaccessiblemem: none) +; FNATTRS: Functio

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-02-04 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/120783 >From 196421e40425290aa1296f63c8fd9fbf205ea4b9 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Fri, 20 Dec 2024 19:30:59 +0100 Subject: [PATCH] [IR][ModRef] Introduce `errno` memory location Mod

[clang] [llvm] [mlir] [clang][CodeGen][AA] Add `!llvm.errno.tbaa` gathering int-compatible TBAA nodes (PR #125258)

2025-01-31 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: @nikic Mind glancing over the draft quickly? !llvm.errno.tbaa is being attached to individual load/store accessing errno, although I just realized that this information is already embedded in TBAA, so IIUC !llvm.errno.tbaa should just be a module-level list of int-compa

[clang] [llvm] [mlir] [InferAttrs] Mark errnomem-setting libcalls as such (PR #124742)

2025-01-31 Thread Antonio Frighetto via cfe-commits
@@ -672,13 +703,15 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F, Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 0); Changed |= setOnlyReadsMemory(F, 0); +Changed |= setOnlyAccessesErrnoMemory(F); antoniofrighetto wrote

[clang] [llvm] [mlir] [InferAttrs] Mark errnomem-setting libcalls as such (PR #124742)

2025-01-31 Thread Antonio Frighetto via cfe-commits
@@ -128,6 +128,15 @@ static void addLocAccess(MemoryEffects &ME, const MemoryLocation &Loc, ME |= MemoryEffects::argMemOnly(MR); return; } + // TODO: This should be refined to use upcoming Loc.TBAAErrno for errno + // memory, rather than manually inspecting the und

[clang] [llvm] [mlir] [InferAttrs] Mark errnomem-setting libcalls as such (PR #124742)

2025-01-31 Thread Antonio Frighetto via cfe-commits
@@ -554,6 +579,7 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F, Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 0); Changed |= setOnlyReadsMemory(F, 0); +Changed |= setOnlyAccessesErrnoMemory(F); antoniofrighetto wrote:

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-01-28 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/120783 >From 54d3ac991abaa341dd4798bbf6aeb3ede4441d64 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Fri, 20 Dec 2024 19:30:59 +0100 Subject: [PATCH 1/2] [IR][ModRef] Introduce `errno` memory location

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-01-22 Thread Antonio Frighetto via cfe-commits
@@ -11610,9 +11610,10 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, bool TakingCandidateAddress) { TemplateParameter Param = DeductionFailure.getTemplateParameter(); NamedDecl *ParamD; - (ParamD = Param.dy

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-01-22 Thread Antonio Frighetto via cfe-commits
@@ -11714,13 +11715,52 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, return; } - case TemplateDeductionResult::InvalidExplicitArguments: + case TemplateDeductionResult::InvalidExplicitArguments: { assert(ParamD && "no parameter f

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-01-22 Thread Antonio Frighetto via cfe-commits
@@ -11714,13 +11715,52 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, return; } - case TemplateDeductionResult::InvalidExplicitArguments: + case TemplateDeductionResult::InvalidExplicitArguments: { assert(ParamD && "no parameter f

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-01-22 Thread Antonio Frighetto via cfe-commits
@@ -11610,9 +11610,10 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, bool TakingCandidateAddress) { TemplateParameter Param = DeductionFailure.getTemplateParameter(); NamedDecl *ParamD; - (ParamD = Param.dy

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-01-20 Thread Antonio Frighetto via cfe-commits
@@ -82,7 +82,7 @@ define void @test_store(ptr %p) { @G = external global ptr define i8 @test_store_capture(ptr %p) { -; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: read, inaccessiblemem: none) +; FNATTRS: Functio

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-01-20 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/120783 >From 54d3ac991abaa341dd4798bbf6aeb3ede4441d64 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Fri, 20 Dec 2024 19:30:59 +0100 Subject: [PATCH] [IR][ModRef] Introduce `errno` memory location Mod

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-01-15 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/122754 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2025-01-09 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: Kind ping for correct direction. https://github.com/llvm/llvm-project/pull/120783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

2024-12-22 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/120783 >From 81c1e35fc28f43c2f23df328244de0528f4bf1d0 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Fri, 20 Dec 2024 19:30:59 +0100 Subject: [PATCH 1/2] [IR][ModRef] Introduce `errno` memory location

[clang] [llvm] [CVP] Add `samesign` flag to `icmp` (PR #115642)

2024-11-10 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/115642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CVP] #114820 add 'samesign' for 'icmp' (PR #115642)

2024-11-10 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto closed https://github.com/llvm/llvm-project/pull/115642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CVP] #114820 add 'samesign' for 'icmp' (PR #115642)

2024-11-10 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto approved this pull request. https://github.com/llvm/llvm-project/pull/115642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Instrumentation] Move out to Utils (NFC) (PR #108532)

2024-09-13 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/108532 >From 4518980e2698b76825d9650373df7414f61062d9 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Fri, 13 Sep 2024 11:43:30 +0200 Subject: [PATCH] [Instrumentation] Move out to Utils (NFC) Utility

[clang] [llvm] [Instrumentation] Move out to Utils (NFC) (PR #108532)

2024-09-13 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto created https://github.com/llvm/llvm-project/pull/108532 Utility functions have been moved out to Utils. Minor opportunity to drop the header where not needed. >From 42fef89fcc75d7f1f869c70d5357fcf3a0d410e1 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto D

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-07-05 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto commented: I think this makes sense. https://github.com/llvm/llvm-project/pull/91101 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ThreadSafety] Skip past implicit cast in `translateAttrExpr` (PR #92277)

2024-05-18 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto closed https://github.com/llvm/llvm-project/pull/92277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 2c2e050 - [clang][ThreadSafety] Skip past implicit cast in `translateAttrExpr`

2024-05-18 Thread Antonio Frighetto via cfe-commits
Author: Antonio Frighetto Date: 2024-05-18T09:49:10+02:00 New Revision: 2c2e0507e92bdb77a01828f899ff59e44492b537 URL: https://github.com/llvm/llvm-project/commit/2c2e0507e92bdb77a01828f899ff59e44492b537 DIFF: https://github.com/llvm/llvm-project/commit/2c2e0507e92bdb77a01828f899ff59e44492b537.d

[clang] [clang][ThreadSafety] Skip past implicit cast in `translateAttrExpr` (PR #92277)

2024-05-18 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/92277 >From 2c2e0507e92bdb77a01828f899ff59e44492b537 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 15 May 2024 17:03:02 +0200 Subject: [PATCH] [clang][ThreadSafety] Skip past implicit cast in `t

[clang] [clang][ThreadSafety] Skip past implicit cast in `translateAttrExpr` (PR #92277)

2024-05-15 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto created https://github.com/llvm/llvm-project/pull/92277 Ignore `ImplicitCastExpr` when building `AttrExp` for capability attribute diagnostics. Fixes: https://github.com/llvm/llvm-project/issues/92118. >From fb668a484553f1a62e2461e8cd2bb1484792eb6d Mon Sep

[clang] [llvm] [IR] Add getelementptr nusw and nuw flags (PR #90824)

2024-05-02 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: Are the TODOs encompassing all the cases? Why we don't want to set the flags in `PHITransAddr` as well? https://github.com/llvm/llvm-project/pull/90824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-23 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: @tstellar Yes, thanks (I opened a new PR for that: https://github.com/llvm/llvm-project/pull/86106). https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] b433076 - [clang][CodeGen] Allow `memcpy` replace with trivial auto var init

2024-03-21 Thread Antonio Frighetto via cfe-commits
Author: Antonio Frighetto Date: 2024-03-21T09:55:04+01:00 New Revision: b433076fcbacba8a3b91446390bbea5843322bcd URL: https://github.com/llvm/llvm-project/commit/b433076fcbacba8a3b91446390bbea5843322bcd DIFF: https://github.com/llvm/llvm-project/commit/b433076fcbacba8a3b91446390bbea5843322bcd.d

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-21 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto closed https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-21 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/84230 >From b433076fcbacba8a3b91446390bbea5843322bcd Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Thu, 7 Mar 2024 07:49:40 +0100 Subject: [PATCH] [clang][CodeGen] Allow `memcpy` replace with trivial

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-21 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/84230 >From bfc29a350458e9b8d20d7398595c3f36503e2d72 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Thu, 7 Mar 2024 07:49:40 +0100 Subject: [PATCH] [clang][CodeGen] Allow `memcpy` replace with trivial

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-15 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: @nikic, updated PR description as well, thanks. https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-15 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-15 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: @efriedma-quic, comment updated, thanks. https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-15 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/84230 >From 3c006a4fbec11e7e8ccaadbf347484077597894f Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 6 Mar 2024 23:49:40 +0100 Subject: [PATCH] [clang][CodeGen] Allow `memcpy` replace with trivial

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-15 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/84230 >From 869f015ac440ff1885caf44abffe28cd6ebf0f13 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 6 Mar 2024 23:49:40 +0100 Subject: [PATCH] [clang][CodeGen] Allow `memcpy` replace with trivial

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-07 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-07 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: Fixed `auto-var-init.cpp` test failures, believe now it should be aligned with the original intent. https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-07 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/84230 >From e5af3e3242b34811eb56d91597bfc58e89f9e2db Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 6 Mar 2024 23:49:40 +0100 Subject: [PATCH] [clang][CodeGen] Allow memcpy replace with trivial au

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-06 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: I think manually checking if `TrivialAutoVarInit` is set (to `Pattern`?) may be a better fix, as there was only [one codepath](https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGDecl.cpp#L1972-L1974) in which we were not checking this. https://github.co

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-06 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto edited https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[clang] Avoid memcopy for small structure with padding under … (PR #84230)

2024-03-06 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/84230 >From 91ca7b2e5c98a7caa8a97f05f57e84f68d861fa3 Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Wed, 6 Mar 2024 23:49:40 +0100 Subject: [PATCH] [clang][CodeGen] Allow memcpy replace with trivial au

[clang] Revert "[clang] Avoid memcopy for small structure with padding under … (PR #84230)

2024-03-06 Thread Antonio Frighetto via cfe-commits
https://github.com/antoniofrighetto created https://github.com/llvm/llvm-project/pull/84230 …-ftrivial-auto-var-init (#71677)" This reverts commit afe8b93ffdfef5d8879e1894b9d7dda40dee2b8d. Fixes regression: https://github.com/llvm/llvm-project/issues/84178. >From bb22eccc90d0e8cb02be5d4c47a08

[clang] 8c6e96d - [clang][Dataflow] Fix unnecessary copy in `initializeFieldsWithValues` (NFC)

2024-02-13 Thread Antonio Frighetto via cfe-commits
Author: Antonio Frighetto Date: 2024-02-13T11:05:26+01:00 New Revision: 8c6e96d9eb35849762fa3ab4d3cc9517c4e14e74 URL: https://github.com/llvm/llvm-project/commit/8c6e96d9eb35849762fa3ab4d3cc9517c4e14e74 DIFF: https://github.com/llvm/llvm-project/commit/8c6e96d9eb35849762fa3ab4d3cc9517c4e14e74.d

[llvm] [mlir] [flang] [clang-tools-extra] [libcxx] [openmp] [lldb] [compiler-rt] [libc] [clang] [lld] fix issue 73559. (PR #74926)

2023-12-16 Thread Antonio Frighetto via cfe-commits
antoniofrighetto wrote: Could you kindly squash everything into one commit and provide a meaningful git commit title and git message description? For example: ``` [clang][Parse] `TryAnnotateCXXScopeToken` to be called only when parsing C++ Assume `TryAnnotateCXXScopeToken` to be parsing C++ cod

[clang] [llvm] [clang-tools-extra] [AArch64] Add an AArch64 pass for loop idiom transformations (PR #72273)

2023-12-13 Thread Antonio Frighetto via cfe-commits
@@ -0,0 +1,726 @@ + +//===- AArch64LoopIdiomTransform.cpp - Loop idiom recognition -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang] [llvm] [AArch64] Add an AArch64 pass for loop idiom transformations (PR #72273)

2023-12-13 Thread Antonio Frighetto via cfe-commits
@@ -0,0 +1,726 @@ + +//===- AArch64LoopIdiomTransform.cpp - Loop idiom recognition -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

  1   2   >