[PATCH] D138132: [JumpThreading] Preserve profile metadata during select unfolding
Roman Paukner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 10 06:19:24 PST 2023
rp marked 2 inline comments as not done.
rp added inline comments.
================
Comment at: llvm/test/Transforms/JumpThreading/select.ll:4-9
+; CHECK-LABEL: ---- Branch Probability Info : unfold1 ----
+; CHECK: set edge cond.false -> 0 successor probability to 0x0ccccccd / 0x80000000 = 10.00%
+; CHECK: set edge cond.false -> 1 successor probability to 0x73333333 / 0x80000000 = 90.00%
+; CHECK-LABEL: ---- Branch Probability Info : unfold2 ----
+; CHECK: set edge cond.false -> 0 successor probability to 0x0ccccccd / 0x80000000 = 10.00%
+; CHECK: set edge cond.false -> 1 successor probability to 0x73333333 / 0x80000000 = 90.00%
----------------
lebedev.ri wrote:
> You should just check the metadata (`--check-globals`)
Is it possible to check edge probabilities with metadata? As when I hard-code this code into probability calculation:
```
BP.emplace_back(BranchProbability::getBranchProbability(1, 10));
BP.emplace_back(BranchProbability::getBranchProbability(9, 10));
```
The probabilities in those checks will be reported as 10/90%, yet the prof metadata will stay as it was - 25/75%.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138132/new/
https://reviews.llvm.org/D138132
More information about the llvm-commits
mailing list