[llvm-branch-commits] [llvm][ProfDataUtils] provide getNumBranchWeights API (PR #90146)

2024-04-25 Thread Matthias Braun via llvm-branch-commits
https://github.com/MatzeB approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/90146 ___ 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
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 &I, MDNode *MD) { // Check consistency of !prof branch_weights metadata. if (ProfName.equals("branch_weights")) { +unsigned int Offset = getBranchWeightOffset(I); if (isa(&I)) { - Check(MD->

[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 &I); /// Nullptr otherwise. MDNode *getValidBranchWeightMDNode(const Instruction &I); +/// Check if Branch Weight Metadata has an "expected" field from an llvm.expect* +/// intrinsic +bool hasExpectedProvenanc

[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 &I); /// Nullptr otherwise. MDNode *getValidBranchWeightMDNode(const Instruction &I); +/// Check if Branch Weight Metadata has an "expected" field from an llvm.expect* +/// intrinsic +bool hasExpectedProvenanc

[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 + // getValidBranchWeightMDNode(),

[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 &I) { return getValidBranchWeightMDNode(I); } +bool hasExpectedProvenance(const Instruction &I) { + 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 &I); /// Nullptr otherwise. MDNode *getValidBranchWeightMDNode(const Instruction &I); +/// Check if Branch Weight Metadata has an "expected" field from an llvm.expect* +/// intrinsic +bool hasExpectedProvenanc

[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] [llvm] [LivePhysRegs] Add callee-saved regs from MFI in addLiveOutsNoPristines. (PR #73553)

2023-11-27 Thread Matthias Braun via llvm-branch-commits
MatzeB wrote: Looking at the `MachineOutliner` it seems to already be using `addLiveOuts()` so I must be missing something on why this change has any effect anyway... https://github.com/llvm/llvm-project/pull/73553 ___ llvm-branch-commits mailing list

[llvm-branch-commits] [llvm] [LivePhysRegs] Add callee-saved regs from MFI in addLiveOutsNoPristines. (PR #73553)

2023-11-27 Thread Matthias Braun via llvm-branch-commits
MatzeB wrote: Which code/pass is using `LivePhysRegs` that is causing you trouble here? https://github.com/llvm/llvm-project/pull/73553 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[llvm-branch-commits] [llvm] [LivePhysRegs] Add callee-saved regs from MFI in addLiveOutsNoPristines. (PR #73553)

2023-11-27 Thread Matthias Braun via llvm-branch-commits
MatzeB wrote: I still feel like I am missing something here, and it's been a while since I looked at this. But my impression is that LLVM modeling is "cheating" a bit in that technically all the callee-saves should be implicit-uses of the return instruction (and not live afterwards) but we don

[llvm-branch-commits] [llvm] [LivePhysRegs] Add callee-saved regs from MFI in addLiveOutsNoPristines. (PR #73553)

2023-11-27 Thread Matthias Braun via llvm-branch-commits
MatzeB wrote: I don't remember the situation on aarch64, but if by chance LR is modeled with this "pristine register" concept, then maybe the caller needs to use `addLiveIns()` rather than `addLiveInsNoPristines()`? https://github.com/llvm/llvm-project/pull/73553 __

[llvm-branch-commits] [llvm] [LivePhysRegs] Add callee-saved regs from MFI in addLiveOutsNoPristines. (PR #73553)

2023-11-27 Thread Matthias Braun via llvm-branch-commits
MatzeB wrote: Is this about computing *live-outs* of the return block as the code suggests? (The summary currently talks about live-ins?) https://github.com/llvm/llvm-project/pull/73553 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.ll

[llvm-branch-commits] [llvm] ad25f8a - X86InstrInfo: Support immediates that are +1/-1 different in optimizeCompareInstr

2022-01-11 Thread Matthias Braun via llvm-branch-commits
Author: Matthias Braun Date: 2022-01-11T09:07:29-08:00 New Revision: ad25f8a556d239d8b7d17383cf1a0771359521fd URL: https://github.com/llvm/llvm-project/commit/ad25f8a556d239d8b7d17383cf1a0771359521fd DIFF: https://github.com/llvm/llvm-project/commit/ad25f8a556d239d8b7d17383cf1a0771359521fd.diff

[llvm-branch-commits] [llvm] d72980a - Tests for D112754

2021-11-29 Thread Matthias Braun via llvm-branch-commits
Author: Matthias Braun Date: 2021-11-29T16:02:06-08:00 New Revision: d72980acfa54375eb3415af72cd67e85faaac168 URL: https://github.com/llvm/llvm-project/commit/d72980acfa54375eb3415af72cd67e85faaac168 DIFF: https://github.com/llvm/llvm-project/commit/d72980acfa54375eb3415af72cd67e85faaac168.diff

[llvm-branch-commits] [llvm] 26da34b - X86InstrInfo: Support immediates that are +1/-1 different in optimizeCompareInstr

2021-10-28 Thread Matthias Braun via llvm-branch-commits
Author: Matthias Braun Date: 2021-10-28T10:23:29-07:00 New Revision: 26da34b3238a018af23951b6a559f26aa78c9b6e URL: https://github.com/llvm/llvm-project/commit/26da34b3238a018af23951b6a559f26aa78c9b6e DIFF: https://github.com/llvm/llvm-project/commit/26da34b3238a018af23951b6a559f26aa78c9b6e.diff

[llvm-branch-commits] [llvm] 4db1cf5 - X86InstrInfo: Optimize more combinations of SUB+CMP

2021-10-28 Thread Matthias Braun via llvm-branch-commits
Author: Matthias Braun Date: 2021-10-28T10:23:28-07:00 New Revision: 4db1cf53740a8770b51ac1c03e8e9cc5e66eb83d URL: https://github.com/llvm/llvm-project/commit/4db1cf53740a8770b51ac1c03e8e9cc5e66eb83d DIFF: https://github.com/llvm/llvm-project/commit/4db1cf53740a8770b51ac1c03e8e9cc5e66eb83d.diff

[llvm-branch-commits] [llvm-branch] r294656 - ReleaseNotes.rst: Add a section about .mir testing

2017-02-09 Thread Matthias Braun via llvm-branch-commits
Author: matze Date: Thu Feb 9 17:25:27 2017 New Revision: 294656 URL: http://llvm.org/viewvc/llvm-project?rev=294656&view=rev Log: ReleaseNotes.rst: Add a section about .mir testing Modified: llvm/branches/release_40/docs/ReleaseNotes.rst Modified: llvm/branches/release_40/docs/ReleaseNotes

[llvm-branch-commits] [llvm-branch] r294630 - RegisterCoalescer: Cleanup joinReservedPhysReg(); NFC

2017-02-09 Thread Matthias Braun via llvm-branch-commits
Author: matze Date: Thu Feb 9 15:45:29 2017 New Revision: 294630 URL: http://llvm.org/viewvc/llvm-project?rev=294630&view=rev Log: RegisterCoalescer: Cleanup joinReservedPhysReg(); NFC Merging r293856: - Factor out a common subexpression - Add some helpful comments - Fix printing of a register

[llvm-branch-commits] [llvm-branch] r294631 - RegisterCoalescer: Fix joinReservedPhysReg()

2017-02-09 Thread Matthias Braun via llvm-branch-commits
Author: matze Date: Thu Feb 9 15:45:33 2017 New Revision: 294631 URL: http://llvm.org/viewvc/llvm-project?rev=294631&view=rev Log: RegisterCoalescer: Fix joinReservedPhysReg() Merging r294268: joinReservedPhysReg() can only deal with a liverange in a single basic block when copying from a vreg

[llvm-branch-commits] [llvm-branch] r292820 - Cherry pick r292625

2017-01-23 Thread Matthias Braun via llvm-branch-commits
Author: matze Date: Mon Jan 23 13:26:12 2017 New Revision: 292820 URL: http://llvm.org/viewvc/llvm-project?rev=292820&view=rev Log: Cherry pick r292625 Added: llvm/branches/release_40/test/CodeGen/AArch64/ldst-opt.mir - copied unchanged from r292625, llvm/trunk/test/CodeGen/AArch64/lds

[llvm-branch-commits] [llvm-branch] r282615 - Cherry pick r281957 (see http://llvm.org/PR30463)

2016-09-28 Thread Matthias Braun via llvm-branch-commits
Author: matze Date: Wed Sep 28 13:17:12 2016 New Revision: 282615 URL: http://llvm.org/viewvc/llvm-project?rev=282615&view=rev Log: Cherry pick r281957 (see http://llvm.org/PR30463) Added: llvm/branches/release_39/test/CodeGen/X86/branchfolding-undef.mir - copied unchanged from r281957