[llvm-branch-commits] [BOLT][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-08 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-04 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov converted_to_draft https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-03 Thread Maksim Panchenko via llvm-branch-commits
@@ -492,6 +486,10 @@ uint64_t BoltAddressTranslation::translate(uint64_t FuncAddress, const uint32_t Val = KeyVal->second >> 1; // dropping BRANCHENTRY bit if (IsBranchSrc) { +// Branch entry is found in BAT +if (KeyVal->first == Offset && KeyVal->second &

[llvm-branch-commits] [BOLT][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-03 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-03 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-03 Thread Amir Ayupov via llvm-branch-commits
@@ -478,18 +478,34 @@ uint64_t BoltAddressTranslation::translate(uint64_t FuncAddress, return Offset; const MapTy = Iter->second; + if (IsBranchSrc) { +// Try exact lookup first +auto KeyVal = Map.find(Offset); +if (KeyVal != Map.end() && KeyVal->second &

[llvm-branch-commits] [BOLT][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-03 Thread Amir Ayupov via llvm-branch-commits
@@ -478,18 +478,34 @@ uint64_t BoltAddressTranslation::translate(uint64_t FuncAddress, return Offset; const MapTy = Iter->second; + if (IsBranchSrc) { +// Try exact lookup first +auto KeyVal = Map.find(Offset); +if (KeyVal != Map.end() && KeyVal->second &

[llvm-branch-commits] [BOLT][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-03 Thread Amir Ayupov via llvm-branch-commits
@@ -24,6 +24,32 @@ READ-BAT-CHECK-NOT: BOLT-ERROR: unable to save profile in YAML format for input READ-BAT-CHECK: BOLT-INFO: Parsed 5 BAT entries READ-BAT-CHECK: PERF2BOLT: read 79 aggregated LBR entries +# Check handling of a branch not in BAT (added by BOLT) +RUN:

[llvm-branch-commits] [BOLT][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-03 Thread Maksim Panchenko via llvm-branch-commits
@@ -48,10 +48,9 @@ static cl::opt InputFilename(cl::Positional, cl::Required, cl::cat(BatDumpCategory)); -static cl::list Translate("translate", -

[llvm-branch-commits] [BOLT][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-03 Thread Maksim Panchenko via llvm-branch-commits
@@ -24,6 +24,32 @@ READ-BAT-CHECK-NOT: BOLT-ERROR: unable to save profile in YAML format for input READ-BAT-CHECK: BOLT-INFO: Parsed 5 BAT entries READ-BAT-CHECK: PERF2BOLT: read 79 aggregated LBR entries +# Check handling of a branch not in BAT (added by BOLT) +RUN:

[llvm-branch-commits] [BOLT][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-03 Thread Maksim Panchenko via llvm-branch-commits
@@ -478,18 +478,34 @@ uint64_t BoltAddressTranslation::translate(uint64_t FuncAddress, return Offset; const MapTy = Iter->second; + if (IsBranchSrc) { +// Try exact lookup first +auto KeyVal = Map.find(Offset); +if (KeyVal != Map.end() && KeyVal->second &

[llvm-branch-commits] [BOLT][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-01 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/90811 ___ 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][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-01 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-bolt Author: Amir Ayupov (aaupov) Changes Map branches that are not present in BAT to the containing basic block. The normal behavior is to map it to the preceding translation entry, which may or may not be a basic block, and this causes profile

[llvm-branch-commits] [BOLT][BAT] Fix translate for branches added by BOLT (PR #90811)

2024-05-01 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/90811 Map branches that are not present in BAT to the containing basic block. The normal behavior is to map it to the preceding translation entry, which may or may not be a basic block, and this causes profile staleness