[clang] [llvm] [docs] Fix debug and strict aliasing typo (#140071) (PR #154861)

2025-08-22 Thread Florian Hahn via cfe-commits
https://github.com/fhahn approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/154861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-20 Thread Florian Hahn via cfe-commits
fhahn wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/004c67ea257039e4e98abc26dd4ac6e8f3d7a171 https://github.com/llvm/llvm-project/pull/148239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-20 Thread Florian Hahn via cfe-commits
https://github.com/fhahn milestoned https://github.com/llvm/llvm-project/pull/148239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-20 Thread Florian Hahn via cfe-commits
fhahn wrote: /cherry-pick 004c67ea257039e4e98abc26dd4ac6e8f3d7a171 https://github.com/llvm/llvm-project/pull/148239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/148239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
fhahn wrote: Fixed the PR the remove various changes added by accident. https://github.com/llvm/llvm-project/pull/148239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -652,3 +652,146 @@ void VPlanTransforms::attachCheckBlock(VPlan &Plan, Value *Cond, Term->addMetadata(LLVMContext::MD_prof, BranchWeights); } } + +bool VPlanTransforms::handleMaxMinNumReductionsWithoutFastMath(VPlan &Plan) { + VPRegionBlock *LoopRegion = Plan.getVect

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -941,10 +941,32 @@ RecurrenceDescriptor::InstDesc RecurrenceDescriptor::isRecurrenceInstr( m_Intrinsic(m_Value(), m_Value())) || match(I, m_Intrinsic(m_Value(), m_Value())); }; -if (isIntMinMaxRecurrenceKind(Kind) || -(HasRequir

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -103,6 +103,12 @@ struct VPlanTransforms { /// not valid. static bool adjustFixedOrderRecurrences(VPlan &Plan, VPBuilder &Builder); + /// Check if \p Plan contains any FMaxNumNoFMFs or FMinNumNoFMFs reductions. fhahn wrote: Updated thanks! https://gi

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -652,3 +652,146 @@ void VPlanTransforms::attachCheckBlock(VPlan &Plan, Value *Cond, Term->addMetadata(LLVMContext::MD_prof, BranchWeights); } } + +bool VPlanTransforms::handleMaxMinNumReductionsWithoutFastMath(VPlan &Plan) { + VPRegionBlock *LoopRegion = Plan.getVect

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -941,10 +941,32 @@ RecurrenceDescriptor::InstDesc RecurrenceDescriptor::isRecurrenceInstr( m_Intrinsic(m_Value(), m_Value())) || match(I, m_Intrinsic(m_Value(), m_Value())); }; -if (isIntMinMaxRecurrenceKind(Kind) || -(HasRequir

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -941,10 +941,32 @@ RecurrenceDescriptor::InstDesc RecurrenceDescriptor::isRecurrenceInstr( m_Intrinsic(m_Value(), m_Value())) || match(I, m_Intrinsic(m_Value(), m_Value())); }; -if (isIntMinMaxRecurrenceKind(Kind) || -(HasRequir

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -652,3 +652,146 @@ void VPlanTransforms::attachCheckBlock(VPlan &Plan, Value *Cond, Term->addMetadata(LLVMContext::MD_prof, BranchWeights); } } + +bool VPlanTransforms::handleMaxMinNumReductionsWithoutFastMath(VPlan &Plan) { + VPRegionBlock *LoopRegion = Plan.getVect

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -652,3 +652,146 @@ void VPlanTransforms::attachCheckBlock(VPlan &Plan, Value *Cond, Term->addMetadata(LLVMContext::MD_prof, BranchWeights); } } + +bool VPlanTransforms::handleMaxMinNumReductionsWithoutFastMath(VPlan &Plan) { + VPRegionBlock *LoopRegion = Plan.getVect

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -652,3 +652,140 @@ void VPlanTransforms::attachCheckBlock(VPlan &Plan, Value *Cond, Term->addMetadata(LLVMContext::MD_prof, BranchWeights); } } + +bool VPlanTransforms::handleMaxMinNumReductionsWithoutFastMath(VPlan &Plan) { + VPRegionBlock *LoopRegion = Plan.getVect

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -652,3 +652,146 @@ void VPlanTransforms::attachCheckBlock(VPlan &Plan, Value *Cond, Term->addMetadata(LLVMContext::MD_prof, BranchWeights); } } + +bool VPlanTransforms::handleMaxMinNumReductionsWithoutFastMath(VPlan &Plan) { + VPRegionBlock *LoopRegion = Plan.getVect

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -652,3 +652,146 @@ void VPlanTransforms::attachCheckBlock(VPlan &Plan, Value *Cond, Term->addMetadata(LLVMContext::MD_prof, BranchWeights); } } + +bool VPlanTransforms::handleMaxMinNumReductionsWithoutFastMath(VPlan &Plan) { + VPRegionBlock *LoopRegion = Plan.getVect

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -42,18 +42,60 @@ define float @fmaxnum(ptr %src, i64 %n) { ; CHECK-LABEL: define float @fmaxnum( ; CHECK-SAME: ptr [[SRC:%.*]], i64 [[N:%.*]]) { ; CHECK-NEXT: [[ENTRY:.*]]: +; CHECK-NEXT:[[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[N]], 8 +; CHECK-NEXT:br i1 [[MIN_ITERS

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -1096,7 +1100,8 @@ Value *llvm::createMinMaxOp(IRBuilderBase &Builder, RecurKind RK, Value *Left, Value *Right) { Type *Ty = Left->getType(); if (Ty->isIntOrIntVectorTy() || - (RK == RecurKind::FMinimum || RK == RecurKind::FMaximum || +

[clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

2025-07-18 Thread Florian Hahn via cfe-commits
@@ -941,10 +941,32 @@ RecurrenceDescriptor::InstDesc RecurrenceDescriptor::isRecurrenceInstr( m_Intrinsic(m_Value(), m_Value())) || match(I, m_Intrinsic(m_Value(), m_Value())); }; -if (isIntMinMaxRecurrenceKind(Kind) || -(HasRequir

[clang] [lld] [llvm] [Clang][AArch64] Remove redundant tune args to the backend (PR #146896)

2025-07-04 Thread Florian Hahn via cfe-commits
https://github.com/fhahn approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/146896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [Clang][AArch64] Remove redundant tune args to the backend (PR #146896)

2025-07-04 Thread Florian Hahn via cfe-commits
@@ -163,17 +163,6 @@ getAArch64MicroArchFeaturesFromMtune(const Driver &D, StringRef Mtune, if (!DecodeAArch64Mcpu(D, MtuneLowerCase, Tune, Extensions)) return false; fhahn wrote: ```suggestion return DecodeAArch64Mcpu(D, MtuneLowerCase, Tune, Extensio

[clang] [lld] [llvm] [AArch64] Fix stale +zcm target feature to +zcm-gpr64 (PR #146260)

2025-06-29 Thread Florian Hahn via cfe-commits
https://github.com/fhahn commented: LGTM, thanks https://github.com/llvm/llvm-project/pull/146260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][IRBuilder] Use NUW arithmetic for Create{ElementCount,TypeSize}. (PR #143532)

2025-06-18 Thread Florian Hahn via cfe-commits
https://github.com/fhahn approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/143532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][IRBuilder] Use NUW arithmetic for Create{ElementCount,TypeSize}. (PR #143532)

2025-06-18 Thread Florian Hahn via cfe-commits
@@ -177,16 +177,16 @@ define void @add_unique_ind32(ptr noalias nocapture %a, i64 %n) { ; CHECK-LABEL: @add_unique_ind32( ; CHECK-NEXT: entry: ; CHECK-NEXT:[[TMP0:%.*]] = call i64 @llvm.vscale.i64() -; CHECK-NEXT:[[TMP1:%.*]] = shl i64 [[TMP0]], 2 +; CHECK-NEXT:[[

[clang] [llvm] [LLVM][IRBuilder] Use NUW arithmetic for Create{ElementCount,TypeSize}. (PR #143532)

2025-06-17 Thread Florian Hahn via cfe-commits
@@ -177,16 +177,16 @@ define void @add_unique_ind32(ptr noalias nocapture %a, i64 %n) { ; CHECK-LABEL: @add_unique_ind32( ; CHECK-NEXT: entry: ; CHECK-NEXT:[[TMP0:%.*]] = call i64 @llvm.vscale.i64() -; CHECK-NEXT:[[TMP1:%.*]] = shl i64 [[TMP0]], 2 +; CHECK-NEXT:[[

[clang] [llvm] [LLVM][IRBuilder] Use NUW arithmetic for Create{ElementCount,TypeSize}. (PR #143532)

2025-06-10 Thread Florian Hahn via cfe-commits
@@ -177,16 +177,16 @@ define void @add_unique_ind32(ptr noalias nocapture %a, i64 %n) { ; CHECK-LABEL: @add_unique_ind32( ; CHECK-NEXT: entry: ; CHECK-NEXT:[[TMP0:%.*]] = call i64 @llvm.vscale.i64() -; CHECK-NEXT:[[TMP1:%.*]] = shl i64 [[TMP0]], 2 +; CHECK-NEXT:[[

[clang] [Clang] Add `noalias` to `this` pointer in C++ constructors (PR #136792)

2025-05-15 Thread Florian Hahn via cfe-commits
https://github.com/fhahn commented: > > I just got a case: > > ``` > > class A { > > public: > >class B { > >public: > > B(A *); > > > > // some non static data fields > >}; > > Does this a valid prove that this optimization is not valid ? > > This example is fine

[clang] [IRGen] Mark pointers as noalias when passing trivial types by value. (PR #131885)

2025-05-05 Thread Florian Hahn via cfe-commits
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/131885 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9e5bfbf - [EquivalenceClasses] Update member_begin to take ECValue (NFC).

2025-04-04 Thread Florian Hahn via cfe-commits
Author: Florian Hahn Date: 2025-04-01T09:28:46+01:00 New Revision: 9e5bfbf77db0945f59c0d18012a8e6d43c711b3a URL: https://github.com/llvm/llvm-project/commit/9e5bfbf77db0945f59c0d18012a8e6d43c711b3a DIFF: https://github.com/llvm/llvm-project/commit/9e5bfbf77db0945f59c0d18012a8e6d43c711b3a.diff

[clang] [llvm] [EquivalenceClasses] Use SmallVector for deterministic iteration order. (PR #134075)

2025-04-03 Thread Florian Hahn via cfe-commits
@@ -138,6 +139,9 @@ class EquivalenceClasses { /// ECValues, it just keeps the key as part of the value. std::set TheMapping; + /// List of all members, used to provide a determinstic iteration order. + SmallVector Members; fhahn wrote: Shared it here h

[clang] [llvm] [EquivalenceClasses] Use SmallVector for deterministic iteration order. (PR #134075)

2025-04-02 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/134075 >From 10afe2fb4743c0fccaad2797fffca174736a0997 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Sat, 29 Mar 2025 20:20:39 + Subject: [PATCH 1/2] [EquivalenceClasses] Use SmallVector for deterministic iterati

[clang] [llvm] [EquivalenceClasses] Use SmallVector for deterministic iteration order. (PR #134075)

2025-04-02 Thread Florian Hahn via cfe-commits
@@ -138,6 +139,9 @@ class EquivalenceClasses { /// ECValues, it just keeps the key as part of the value. std::set TheMapping; + /// List of all members, used to provide a determinstic iteration order. + SmallVector Members; fhahn wrote: This is where th

[clang] [llvm] [EquivalenceClasses] Use SmallVector for deterministic iteration order. (PR #134075)

2025-04-02 Thread Florian Hahn via cfe-commits
https://github.com/fhahn created https://github.com/llvm/llvm-project/pull/134075 Currently iterators over EquivalenceClasses will iterate over std::set, which guarantees the order specified by the comperator. Unfortunately in many cases, EquivalenceClasses are used with pointers, so iterating

[clang] 64d493f - [EquivalenceClasses] Return ECValue directly from insert (NFC).

2025-04-01 Thread Florian Hahn via cfe-commits
Author: Florian Hahn Date: 2025-04-01T08:45:46+01:00 New Revision: 64d493f987dc24b3d7e45daade9b0e8bfa1cc471 URL: https://github.com/llvm/llvm-project/commit/64d493f987dc24b3d7e45daade9b0e8bfa1cc471 DIFF: https://github.com/llvm/llvm-project/commit/64d493f987dc24b3d7e45daade9b0e8bfa1cc471.diff

[clang] 32f2402 - Reapply "[EquivalenceClasses] Replace findValue with contains (NFC)."

2025-03-31 Thread Florian Hahn via cfe-commits
Author: Florian Hahn Date: 2025-03-31T22:27:59+01:00 New Revision: 32f24029c72dae175c9e2cc81f931f065a2ba347 URL: https://github.com/llvm/llvm-project/commit/32f24029c72dae175c9e2cc81f931f065a2ba347 DIFF: https://github.com/llvm/llvm-project/commit/32f24029c72dae175c9e2cc81f931f065a2ba347.diff

[clang] [IRGen] Mark pointers as noalias when passing trivial types by value. (PR #131885)

2025-03-18 Thread Florian Hahn via cfe-commits
https://github.com/fhahn created https://github.com/llvm/llvm-project/pull/131885 None >From fb1120b5a4abd716f6071ce8c7cfc81e725e9030 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Fri, 14 Mar 2025 15:40:47 + Subject: [PATCH] [IRGen] Mark pointers as noalias when passing trivial types

[clang] [clang] Add value_type attr, use it to add noalias when pass-by-value. (PR #95004)

2025-03-17 Thread Florian Hahn via cfe-commits
@@ -9242,3 +9242,15 @@ Declares that a function potentially allocates heap memory, and prevents any pot of ``nonallocating`` by the compiler. }]; } + +def ValueTypeDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``value_type`` attribute can be u

[clang] [clang] Add value_type attr, use it to add noalias when pass-by-value. (PR #95004)

2025-03-15 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/95004 >From c3b6943c236990c9f0ba363b4335b3c0e048ef2c Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 10 Jun 2024 16:54:02 +0100 Subject: [PATCH 1/3] [clang] Add value_type attr, use it to add noalias when pass-by-

[clang] [clang] Add value_type attr, use it to add noalias when pass-by-value. (PR #95004)

2025-03-15 Thread Florian Hahn via cfe-commits
fhahn wrote: Just rebased the PR and > > I feel like this is a property that needs to propagate through types > > You mean, similar to the way trivial_abi works? That makes sense. I am not sure about propagating. I added some documentation to make the spec of the attribute clearer. Specific

[clang] [clang] Add value_type attr, use it to add noalias when pass-by-value. (PR #95004)

2025-03-14 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/95004 >From c3b6943c236990c9f0ba363b4335b3c0e048ef2c Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 10 Jun 2024 16:54:02 +0100 Subject: [PATCH 1/2] [clang] Add value_type attr, use it to add noalias when pass-by-

[clang] [llvm] [MergeFuncs] Don't introduce calls to (linkonce,weak)_odr functions. (PR #125050)

2025-02-25 Thread Florian Hahn via cfe-commits
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/125050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MergeFuncs] Don't introduce calls to (linkonce,weak)_odr functions. (PR #125050)

2025-02-25 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/125050 >From 3133b6bf495e82ec63a29ab639ab91ddd7421464 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Thu, 30 Jan 2025 11:33:12 + Subject: [PATCH 1/7] [MergeFuncs] Don't introduce calls to weak_odr functions. Avoi

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-02-14 Thread Florian Hahn via cfe-commits
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/121789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-02-13 Thread Florian Hahn via cfe-commits
@@ -2761,6 +2761,47 @@ etc.). Query for this feature with ``__has_builtin(__builtin_assume_separate_storage)``. +``__builtin_assume_dereferenceable`` +- + +``__builtin_assume_dereferenceable`` is used to provide the optimizer with the +kno

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-02-13 Thread Florian Hahn via cfe-commits
fhahn wrote: https://github.com/llvm/llvm-project/pull/126117 has landed now which adjusted the semantics of dereferenceable assume bundles and I think it should be safe to go ahead with exposing this in Clang. Unless there are any further concerns I am planning on submitting this soon :) htt

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-02-13 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/121789 >From b7b0a7a8a04e579c512c13bf114613ced56b8fe5 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 6 Jan 2025 13:39:55 + Subject: [PATCH 1/5] [Clang] Add __builtin_assume_dereferenceable to encode deref as

[clang] [Docs] Fix typo in TypeSanitizer.rst "tale" -> "table" (NFC) (PR #126721)

2025-02-11 Thread Florian Hahn via cfe-commits
https://github.com/fhahn commented: Great, thanks for fixing this! https://github.com/llvm/llvm-project/pull/126721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-31 Thread Florian Hahn via cfe-commits
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/122116 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-31 Thread Florian Hahn via cfe-commits
https://github.com/fhahn edited https://github.com/llvm/llvm-project/pull/122116 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-30 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/122116 >From 04ae49a9c6680c6c9f2f9f482fc1f25fffd0d4d5 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 8 Jan 2025 13:07:01 + Subject: [PATCH 1/8] [TBAA] Don't emit pointer-tbaa for void pointers. While there a

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-30 Thread Florian Hahn via cfe-commits
@@ -2489,6 +2489,81 @@ are listed below. $ clang -fuse-ld=lld -Oz -Wl,--icf=safe -fcodegen-data-use code.cc +Strict Aliasing +--- + +The C and C++ standards require accesses to objects in memory to use l-values of +an appropriate type for the object. This is

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-30 Thread Florian Hahn via cfe-commits
@@ -5272,6 +5296,8 @@ The Visual C++ Toolset has a slightly more elaborate mechanism for detection. Restrictions and Limitations compared to Clang -- +.. _clang_cl_strict_aliasing: + Strict Aliasing fhahn wrote: I

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-30 Thread Florian Hahn via cfe-commits
@@ -2489,6 +2489,81 @@ are listed below. $ clang -fuse-ld=lld -Oz -Wl,--icf=safe -fcodegen-data-use code.cc +Strict Aliasing +--- + +The C and C++ standards require accesses to objects in memory to use l-values of +an appropriate type for the object. This is

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-30 Thread Florian Hahn via cfe-commits
@@ -2489,6 +2489,81 @@ are listed below. $ clang -fuse-ld=lld -Oz -Wl,--icf=safe -fcodegen-data-use code.cc +Strict Aliasing +--- + +The C and C++ standards require accesses to objects in memory to use l-values of +an appropriate type for the object. This is

[clang] Fix link to TySan issues page (PR #125052)

2025-01-30 Thread Florian Hahn via cfe-commits
fhahn wrote: > ⚠️ We detected that you are using a GitHub private e-mail address to > contribute to the repo. Please turn off [Keep my email addresses > private](https://github.com/settings/emails) setting in your account. See > [LLVM > Discourse](https://discourse.llvm.org/t/hidden-emails-on

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-29 Thread Florian Hahn via cfe-commits
@@ -2489,6 +2489,30 @@ are listed below. $ clang -fuse-ld=lld -Oz -Wl,--icf=safe -fcodegen-data-use code.cc +Strict Aliasing +--- + +Clang by default applies C/C++'s strict aliasing rules during optimizations. In +cases C and C++ rules diverge, the more conser

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-29 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/122116 >From bac0f4a9dfbf375d876bc84c4474a533cbecec0e Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 8 Jan 2025 13:07:01 + Subject: [PATCH 1/7] [TBAA] Don't emit pointer-tbaa for void pointers. While there a

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-28 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/122116 >From 9a637043f00ad388971cd6d4247510510fca31c8 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 8 Jan 2025 13:07:01 + Subject: [PATCH 1/6] [TBAA] Don't emit pointer-tbaa for void pointers. While there a

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-28 Thread Florian Hahn via cfe-commits
fhahn wrote: I updated the PR to not depend on https://github.com/llvm/llvm-project/pull/123595, if it lands before, I'll add back the reference to the TypeSanitizer doc https://github.com/llvm/llvm-project/pull/122116 ___ cfe-commits mailing list cf

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-28 Thread Florian Hahn via cfe-commits
@@ -2486,6 +2486,23 @@ are listed below. $ clang -fuse-ld=lld -Oz -Wl,--icf=safe -fcodegen-data-use code.cc +Strict Aliasing +--- + +Clang by default applies C/C++'s strict aliasing rules during optimizations. In fhahn wrote: Thanks updated.

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-28 Thread Florian Hahn via cfe-commits
fhahn wrote: > I could add a link to your initial pull request? You have a decent writeup > there on how it works. It's probably better to add a paragraph instead of linking to a PR. Of course the description can be taken from the PR https://github.com/llvm/llvm-project/pull/123595 _

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-28 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/122116 >From adbcc4fc5044d82bd983671ef5442142a3f498fe Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 8 Jan 2025 13:07:01 + Subject: [PATCH 1/5] [TBAA] Don't emit pointer-tbaa for void pointers. While there a

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-28 Thread Florian Hahn via cfe-commits
https://github.com/fhahn approved this pull request. LGTM thanks! I think it would be great to add a paragraph or link to a doc about how it works as suggested by @vitalybuka but this could also be done as follow-up https://github.com/llvm/llvm-project/pull/123595 _

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-28 Thread Florian Hahn via cfe-commits
fhahn wrote: > Okay, so if the ultimate pointee type is `void`, we're basically treating > that as a generic pointer, no matter what the pointer depth is? I guess that > makes sense. > > > What would be a good place to document this? > > Hmm, I was hoping that we would have a section in the m

[clang] [TBAA] Don't emit pointer-tbaa for void pointers. (PR #122116)

2025-01-28 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/122116 >From adbcc4fc5044d82bd983671ef5442142a3f498fe Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 8 Jan 2025 13:07:01 + Subject: [PATCH 1/4] [TBAA] Don't emit pointer-tbaa for void pointers. While there a

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-21 Thread Florian Hahn via cfe-commits
@@ -526,6 +526,11 @@ static AttributeSet getIntrinsicArgAttributeSet(LLVMContext &C, unsigned ID) { )", ID); for (const CodeGenIntrinsic::ArgAttribute &Attr : Attrs) { +if (Attr.Kind == CodeGenIntrinsic::NoCapture) { fhahn wro

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-21 Thread Florian Hahn via cfe-commits
https://github.com/fhahn approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/123181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-21 Thread Florian Hahn via cfe-commits
https://github.com/fhahn edited https://github.com/llvm/llvm-project/pull/123181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-21 Thread Florian Hahn via cfe-commits
@@ -526,6 +526,11 @@ static AttributeSet getIntrinsicArgAttributeSet(LLVMContext &C, unsigned ID) { )", ID); for (const CodeGenIntrinsic::ArgAttribute &Attr : Attrs) { +if (Attr.Kind == CodeGenIntrinsic::NoCapture) { fhahn wro

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-21 Thread Florian Hahn via cfe-commits
@@ -1015,7 +1015,7 @@ struct OperandBundleUse { /// has the attribute A. bool operandHasAttr(unsigned Idx, Attribute::AttrKind A) const { if (isDeoptOperandBundle()) - if (A == Attribute::ReadOnly || A == Attribute::NoCapture) fhahn wrote: This ca

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-21 Thread Florian Hahn via cfe-commits
https://github.com/fhahn commented: Just double checking, do we have a test for the auto-upgrade? https://github.com/llvm/llvm-project/pull/123181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-21 Thread Florian Hahn via cfe-commits
https://github.com/fhahn edited https://github.com/llvm/llvm-project/pull/123181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,153 @@ + +TypeSanitizer + + +.. contents:: + :local: + +Introduction + + +TypeSanitizer is a detector for strict type aliasing violations. It consists of a compiler +instrumentation module and a run-time library. The tool d

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,153 @@ + +TypeSanitizer + + +.. contents:: + :local: + +Introduction + + +TypeSanitizer is a detector for strict type aliasing violations. It consists of a compiler +instrumentation module and a run-time library. The tool d

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,153 @@ + +TypeSanitizer + + +.. contents:: + :local: + +Introduction + + +TypeSanitizer is a detector for strict type aliasing violations. It consists of a compiler +instrumentation module and a run-time library. The tool d

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,153 @@ + +TypeSanitizer + + +.. contents:: + :local: + +Introduction + + +TypeSanitizer is a detector for strict type aliasing violations. It consists of a compiler +instrumentation module and a run-time library. The tool d

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,153 @@ + +TypeSanitizer + + +.. contents:: + :local: + +Introduction + + +TypeSanitizer is a detector for strict type aliasing violations. It consists of a compiler +instrumentation module and a run-time library. The tool d

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,153 @@ + +TypeSanitizer + + +.. contents:: + :local: + +Introduction + + +TypeSanitizer is a detector for strict type aliasing violations. It consists of a compiler +instrumentation module and a run-time library. The tool d

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-20 Thread Florian Hahn via cfe-commits
https://github.com/fhahn edited https://github.com/llvm/llvm-project/pull/123595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,153 @@ + +TypeSanitizer + + +.. contents:: + :local: + +Introduction + + +TypeSanitizer is a detector for strict type aliasing violations. It consists of a compiler +instrumentation module and a run-time library. The tool d

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,153 @@ + +TypeSanitizer + + +.. contents:: + :local: + +Introduction + + +TypeSanitizer is a detector for strict type aliasing violations. It consists of a compiler +instrumentation module and a run-time library. The tool d

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-20 Thread Florian Hahn via cfe-commits
https://github.com/fhahn commented: Thanks for putting this up! https://github.com/llvm/llvm-project/pull/123595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -3391,6 +3391,27 @@ static void findStoresToUninstrumentedArgAllocas( } } +StringRef getAllocaName(AllocaInst *AI) { + // Alloca could have been renamed for uniqueness. Its true name will have been + // recorded as an annotation. + if (AI->hasMetadata(LLVMContext::MD_

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -3391,6 +3391,27 @@ static void findStoresToUninstrumentedArgAllocas( } } +StringRef getAllocaName(AllocaInst *AI) { fhahn wrote: ```suggestion static StringRef getAllocaName(AllocaInst *AI) { ``` https://github.com/llvm/llvm-project/pull/119387 ___

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -3425,12 +3446,14 @@ void FunctionStackPoisoner::processStaticAllocas() { ArgInitInst->moveBefore(InsBefore); // If we have a call to llvm.localescape, keep it in the entry block. - if (LocalEscapeCall) LocalEscapeCall->moveBefore(InsBefore); + if (LocalEscapeCall)

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -134,6 +134,12 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), ArraySize, Name, AllocaInsertPt->getIterator()); + llvm::errs() << "Al

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -3391,6 +3391,27 @@ static void findStoresToUninstrumentedArgAllocas( } } +StringRef getAllocaName(AllocaInst *AI) { + // Alloca could have been renamed for uniqueness. Its true name will have been + // recorded as an annotation. + if (AI->hasMetadata(LLVMContext::MD_

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -3391,6 +3391,27 @@ static void findStoresToUninstrumentedArgAllocas( } } +StringRef getAllocaName(AllocaInst *AI) { + // Alloca could have been renamed for uniqueness. Its true name will have been + // recorded as an annotation. + if (AI->hasMetadata(LLVMContext::MD_

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -3391,6 +3391,27 @@ static void findStoresToUninstrumentedArgAllocas( } } +StringRef getAllocaName(AllocaInst *AI) { + // Alloca could have been renamed for uniqueness. Its true name will have been + // recorded as an annotation. + if (AI->hasMetadata(LLVMContext::MD_

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-20 Thread Florian Hahn via cfe-commits
@@ -3391,6 +3391,27 @@ static void findStoresToUninstrumentedArgAllocas( } } +StringRef getAllocaName(AllocaInst *AI) { + // Alloca could have been renamed for uniqueness. Its true name will have been + // recorded as an annotation. + if (AI->hasMetadata(LLVMContext::MD_

[clang] [llvm] Add the initializes attribute inference (PR #117104)

2025-01-18 Thread Florian Hahn via cfe-commits
fhahn wrote: > Looks like this is causing a crash when building with sanitizers enabled on > macOS > > Reduced reproducer: https://llvm.godbolt.org/z/fn83n4oz4 > > End-to-end crash on GreenDragon: > https://green.lab.llvm.org/job/llvm.org/job/clang-stage2-cmake-RgSan/664/console Looked like

[clang] [llvm] Add the initializes attribute inference (PR #117104)

2025-01-15 Thread Florian Hahn via cfe-commits
fhahn wrote: Looks like this is causing a crash when building with sanitizers enabled on macOS Reduced reproducer: https://llvm.godbolt.org/z/fn83n4oz4 End-to-end crash on GreenDragon: https://green.lab.llvm.org/job/llvm.org/job/clang-stage2-cmake-RgSan/664/console https://github.com/llvm/ll

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-01-10 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/121789 >From efd38085120304c434487bf4a58a025086698180 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 6 Jan 2025 13:39:55 + Subject: [PATCH 1/5] [Clang] Add __builtin_assume_dereferenceable to encode deref as

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-01-09 Thread Florian Hahn via cfe-commits
@@ -2761,6 +2761,41 @@ etc.). Query for this feature with ``__has_builtin(__builtin_assume_separate_storage)``. +``__builtin_assume_dereferenceable`` +- + +``__builtin_assume_derefernceable`` is used to provide the optimizer with the -

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-01-09 Thread Florian Hahn via cfe-commits
@@ -2761,6 +2761,41 @@ etc.). Query for this feature with ``__has_builtin(__builtin_assume_separate_storage)``. +``__builtin_assume_dereferenceable`` +- + +``__builtin_assume_derefernceable`` is used to provide the optimizer with the +know

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-01-09 Thread Florian Hahn via cfe-commits
@@ -2761,6 +2761,41 @@ etc.). Query for this feature with ``__has_builtin(__builtin_assume_separate_storage)``. +``__builtin_assume_dereferenceable`` +- + +``__builtin_assume_derefernceable`` is used to provide the optimizer with the +know

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-01-09 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,36 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s + +// CHECK-LABEL: @test1( +// CHECK-NEXT: entry: +// CHECK-NEXT:[[A_ADDR:%.*]] = alloca ptr,

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-01-09 Thread Florian Hahn via cfe-commits
@@ -839,6 +839,12 @@ def BuiltinAssumeAligned : Builtin { let Prototype = "void*(void const*, size_t, ...)"; } +def BuiltinAssumeDereferenceable : Builtin { + let Spellings = ["__builtin_assume_dereferenceable"]; + let Attributes = [NoThrow, Const, Constexpr];

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-01-09 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/121789 >From 2c7c9bbf17f5c3c78c85dc91540004d75707ebe5 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 6 Jan 2025 13:39:55 + Subject: [PATCH 1/4] [Clang] Add __builtin_assume_dereferenceable to encode deref as

  1   2   3   4   5   6   7   >