[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
https://github.com/MatzeB edited https://github.com/llvm/llvm-project/pull/86609 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
https://github.com/MatzeB edited https://github.com/llvm/llvm-project/pull/86609 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
@@ -4756,8 +4757,10 @@ void Verifier::visitProfMetadata(Instruction , MDNode *MD) { // Check consistency of !prof branch_weights metadata. if (ProfName.equals("branch_weights")) { +unsigned int Offset = getBranchWeightOffset(I); if (isa()) { -

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
@@ -55,6 +55,20 @@ MDNode *getBranchWeightMDNode(const Instruction ); /// Nullptr otherwise. MDNode *getValidBranchWeightMDNode(const Instruction ); +/// Check if Branch Weight Metadata has an "expected" field from an llvm.expect* +/// intrinsic +bool

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
@@ -55,6 +55,20 @@ MDNode *getBranchWeightMDNode(const Instruction ); /// Nullptr otherwise. MDNode *getValidBranchWeightMDNode(const Instruction ); +/// Check if Branch Weight Metadata has an "expected" field from an llvm.expect* +/// intrinsic +bool

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
@@ -1210,12 +1210,22 @@ Instruction *Instruction::cloneImpl() const { void Instruction::swapProfMetadata() { MDNode *ProfileData = getBranchWeightMDNode(*this); - if (!ProfileData || ProfileData->getNumOperands() != 3) + if (!isBranchWeightMD(ProfileData)) return;

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
@@ -1210,12 +1210,22 @@ Instruction *Instruction::cloneImpl() const { void Instruction::swapProfMetadata() { MDNode *ProfileData = getBranchWeightMDNode(*this); - if (!ProfileData || ProfileData->getNumOperands() != 3) + if (!isBranchWeightMD(ProfileData)) return;

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
@@ -5196,7 +5198,11 @@ void SwitchInstProfUpdateWrapper::init() { if (!ProfileData) return; - if (ProfileData->getNumOperands() != SI.getNumSuccessors() + 1) { + // FIXME: This check belongs in ProfDataUtils. Its almost equivalent to + //

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
@@ -106,6 +104,30 @@ bool hasValidBranchWeightMD(const Instruction ) { return getValidBranchWeightMDNode(I); } +bool hasExpectedProvenance(const Instruction ) { + auto *ProfileData = I.getMetadata(LLVMContext::MD_prof); + return hasExpectedProvenance(ProfileData); +} +

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
@@ -55,6 +55,20 @@ MDNode *getBranchWeightMDNode(const Instruction ); /// Nullptr otherwise. MDNode *getValidBranchWeightMDNode(const Instruction ); +/// Check if Branch Weight Metadata has an "expected" field from an llvm.expect* +/// intrinsic +bool

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
https://github.com/MatzeB commented: I guess this is deliberately designed around a `bool IsExpected` rather than a more generic API. I guess I'm fine with it given the current patch, though I would bet it's just a question of time for someone to add more sources now... (so gotta make sure to

[llvm-branch-commits] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

2024-04-08 Thread Matthias Braun via llvm-branch-commits
https://github.com/MatzeB edited https://github.com/llvm/llvm-project/pull/86609 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] Reland "[compiler-rt] Allow running tests without installing first" (PR #88075)

2024-04-08 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: @mstorsjo It would be great if you could test this on windows. https://github.com/llvm/llvm-project/pull/88075 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] Reland "[compiler-rt] Allow running tests without installing first" (PR #88075)

2024-04-08 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-compiler-rt-sanitizer Author: Alexander Richardson (arichardson) Changes Currently, the testsuite uses the default runtimes path to find the runtimes libraries which may or may not match the just-built runtimes. This change uses the `-resource-dir` flag

[llvm-branch-commits] Reland "[compiler-rt] Allow running tests without installing first" (PR #88075)

2024-04-08 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/88075 Currently, the testsuite uses the default runtimes path to find the runtimes libraries which may or may not match the just-built runtimes. This change uses the `-resource-dir` flag for clang whenever

[llvm-branch-commits] [llvm] Backport: Prepend all library intrinsics with `#` when building for Arm64EC (PR #88016)

2024-04-08 Thread Daniel Paoliello via llvm-branch-commits
https://github.com/dpaoliello milestoned https://github.com/llvm/llvm-project/pull/88016 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT] Use BAT to register fragments (PR #87968)

2024-04-08 Thread Maksim Panchenko via llvm-branch-commits
https://github.com/maksfb commented: Is information we emit in the symbol table insufficient to establish the fragment relationship? https://github.com/llvm/llvm-project/pull/87968 ___ llvm-branch-commits mailing list

[llvm-branch-commits] [BOLT] Emit empty FDE for injected functions (PR #87967)

2024-04-08 Thread Maksim Panchenko via llvm-branch-commits
https://github.com/maksfb commented: Let's make `hasCFI()` return true for injected functions. https://github.com/llvm/llvm-project/pull/87967 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [llvm] Backport: Prepend all library intrinsics with `#` when building for Arm64EC (PR #88016)

2024-04-08 Thread Jacek Caban via llvm-branch-commits
https://github.com/cjacek approved this pull request. https://github.com/llvm/llvm-project/pull/88016 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] Backport: Prepend all library intrinsics with `#` when building for Arm64EC (PR #88016)

2024-04-08 Thread Eli Friedman via llvm-branch-commits
efriedma-quic wrote: LGTM. (This only affects Arm64EC, so it's very safe to backport.) https://github.com/llvm/llvm-project/pull/88016 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [llvm] [nfc][ThinLTO] Generate import status in per-module combined summary (PR #88024)

2024-04-08 Thread Mingming Liu via llvm-branch-commits
https://github.com/minglotus-6 created https://github.com/llvm/llvm-project/pull/88024 This is still working in progress. Need to update all callers of 'ComputeImportForModule' properly >From cfb63d775d43a28b560d938346f1dd4b2dddc765 Mon Sep 17 00:00:00 2001 From: mingmingl Date: Thu, 4 Apr

[llvm-branch-commits] [llvm] Backport: Prepend all library intrinsics with `#` when building for Arm64EC (PR #88016)

2024-04-08 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 Author: Daniel Paoliello (dpaoliello) Changes Backports #87542 to v18 While attempting to build some Rust code, I was getting linker errors due to missing functions that are implemented in `compiler-rt`. Turns out that when

[llvm-branch-commits] [llvm] Backport: Prepend all library intrinsics with `#` when building for Arm64EC (PR #88016)

2024-04-08 Thread Daniel Paoliello via llvm-branch-commits
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/88016 Backports #87542 to v18 While attempting to build some Rust code, I was getting linker errors due to missing functions that are implemented in `compiler-rt`. Turns out that when `compiler-rt` is built for

[llvm-branch-commits] [mlir] [mlir][Interfaces][WIP] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/87980 >From 183ab14683a335e65891e1d585f69231699efceb Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 8 Apr 2024 11:25:29 + Subject: [PATCH] [mlir][Interfaces][WIP] `ValueBoundsOpInterface`:

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/87976 >From d8c3fd63044c9b7dfd33c2023729b9a4b72b4886 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 8 Apr 2024 09:44:02 + Subject: [PATCH] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix

[llvm-branch-commits] [llvm] release/18.x: [ConstantRange] Fix off by 1 bugs in UIToFP and SIToFP handling. (#86041) (PR #86153)

2024-04-08 Thread via llvm-branch-commits
AtariDreams wrote: > LGTM I don't have commit access by the way. https://github.com/llvm/llvm-project/pull/86153 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [mlir] [mlir][Interfaces][WIP] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
@@ -75,6 +75,75 @@ struct MulIOpInterface } }; +struct SelectOpInterface matthias-springer wrote: `SelectOpInterface` was already merged. I have to rebase. https://github.com/llvm/llvm-project/pull/87980 ___

[llvm-branch-commits] [mlir] [mlir][Interfaces][WIP] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-08 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-mlir-scf Author: Matthias Springer (matthias-springer) Changes This commit generalizes and cleans up the `ValueBoundsConstraintSet` API. The API used to provide function overloads for comparing/computing bounds of: - index-typed SSA value - dimension

[llvm-branch-commits] [mlir] [mlir][Interfaces][WIP] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-08 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-mlir-memref @llvm/pr-subscribers-mlir-linalg Author: Matthias Springer (matthias-springer) Changes This commit generalizes and cleans up the `ValueBoundsConstraintSet` API. The API used to provide function overloads for comparing/computing bounds of: -

[llvm-branch-commits] [mlir] [mlir][Interfaces][WIP] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-08 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-mlir-tensor Author: Matthias Springer (matthias-springer) Changes This commit generalizes and cleans up the `ValueBoundsConstraintSet` API. The API used to provide function overloads for comparing/computing bounds of: - index-typed SSA value -

[llvm-branch-commits] [mlir] [mlir][Interfaces][WIP] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/87980 This commit generalizes and cleans up the `ValueBoundsConstraintSet` API. The API used to provide function overloads for comparing/computing bounds of: - index-typed SSA value - dimension of shaped

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/87976 >From 4a019ca348ce2a65684e6417b656a51437e8176d Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 8 Apr 2024 09:44:02 + Subject: [PATCH] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
matthias-springer wrote: It is currently not possible to trigger this bug. New columns are always added to the constraint set as symbols. Only the first added SSA value (for which we compute a bound) is added as a dimension. There is currently no API to compute a bounds for an "AffineMap +

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: Can you provide a test that exercises this? Thanks! https://github.com/llvm/llvm-project/pull/87976 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread Benjamin Maxwell via llvm-branch-commits
https://github.com/MacDue approved this pull request. https://github.com/llvm/llvm-project/pull/87976 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-mlir Author: Matthias Springer (matthias-springer) Changes This was likely a copy-and-paste typo. --- Full diff: https://github.com/llvm/llvm-project/pull/87976.diff 1 Files Affected: - (modified) mlir/lib/Interfaces/ValueBoundsOpInterface.cpp

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/87976 This was likely a copy-and-paste typo. >From a09cbb284df8419e6ce819e289aa88bf86b66842 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 8 Apr 2024 09:44:02 + Subject: [PATCH]

[llvm-branch-commits] [clang] [Serialization] Code cleanups and polish 83233 (PR #83237)

2024-04-08 Thread Ilya Biryukov via llvm-branch-commits
ilya-biryukov wrote: Thanks for fixing it quickly, we'll try the new patch and get back with the results. https://github.com/llvm/llvm-project/pull/83237 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [BOLT] Emit empty FDE for injected functions (PR #87967)

2024-04-08 Thread Davide Italiano via llvm-branch-commits
https://github.com/dcci requested changes to this pull request. Can you add a test? that way we can better understand what this function actually does, given it touches a core functionality. https://github.com/llvm/llvm-project/pull/87967 ___

[llvm-branch-commits] [llvm] release/18.x [SelectionDAG] Prevent combination on inconsistent type in 'carryDiamond' (PR #86697)

2024-04-08 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/86697 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] release/18.x [X86_64] fix SSE type error in vaarg (PR #86698)

2024-04-08 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/86698 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] release/18.x: [X86] Fix miscompile in combineShiftRightArithmetic (PR #86728)

2024-04-08 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/86728 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] release/18.x: [SLP]Fix a crash if the argument of call was affected by minbitwidth analysis (PR #86731)

2024-04-08 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/86731 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] release/18.x: [ConstantRange] Fix off by 1 bugs in UIToFP and SIToFP handling. (#86041) (PR #86153)

2024-04-08 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/86153 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT] Emit empty FDE for injected functions (PR #87967)

2024-04-08 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov converted_to_draft https://github.com/llvm/llvm-project/pull/87967 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT] Use BAT to register fragments (PR #87968)

2024-04-08 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/87968 BAT contains metadata about fragment relationships. Use it directly before name-based matching. This removes warnings about control flow between unrelated fragments. Test Plan: TBD

[llvm-branch-commits] [BOLT] Emit empty FDE for injected functions (PR #87967)

2024-04-08 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/87967 This fixes an issue where `PatchEntries` overwrites function body but keeps CFI untouched. Existing FDEs thus become invalid. This doesn't affect unwinding because patched functions are transparent from

[llvm-branch-commits] [llvm] [BOLT] Cover all call sites in writeBATYAML (PR #87743)

2024-04-08 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/87743 >From 251020f10d1e6a7a888164748f78acc6994e0ab3 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Fri, 5 Apr 2024 07:36:40 -0700 Subject: [PATCH] Remove stats logging Created using spr 1.3.4 ---

[llvm-branch-commits] [llvm] [BOLT][BAT] Fix handling of split functions (PR #87569)

2024-04-08 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/87569 >From a3b0326428924a9565c673ffc6bc899ee788a19b Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Fri, 5 Apr 2024 07:40:41 -0700 Subject: [PATCH] Move comment to NumColdSamples Created using spr 1.3.4 ---

[llvm-branch-commits] [llvm] [BOLT][BAT] Fix handling of split functions (PR #87569)

2024-04-08 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/87569 >From a3b0326428924a9565c673ffc6bc899ee788a19b Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Fri, 5 Apr 2024 07:40:41 -0700 Subject: [PATCH] Move comment to NumColdSamples Created using spr 1.3.4 ---