You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opt --codegenprepare --mtriple=riscv32 --cgp-verify-bfi-updates bfi-bug3.ll -S
Freq mismatch: entry 8 vs 16
This
block-frequency-info: __test
- entry: float = 1.0, int = 8
Other
block-frequency-info: __test
- entry: float = 1.0, int = 16
Assertion failed: (Match && "BFI mismatch"), function verifyMatch, file BlockFrequencyInfoImpl.h, line 1800.
Please, note that the actual triplet value doesn't seem to matter, as the failed assertion is in target-independent part of the code.
As I understand, the issues happens because the BFI updates are not synced with actual code transformations performed by CodeGenPrepare pass. Namely, the BBs frequency info, expressed as FrequencyData::Integer, is not updated.
Does it make sense to compare Scaled values instead?
--- a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
+++ b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
@@ -1777,7 +1777,7 @@ void BlockFrequencyInfoImpl<BT>::verifyMatch(
BlockNode OtherNode = OtherValidNodes[BB];
const auto &Freq = Freqs[Node.Index];
const auto &OtherFreq = Other.Freqs[OtherNode.Index];
- if (Freq.Integer != OtherFreq.Integer) {
+ if (Freq.Scaled != OtherFreq.Scaled) {
Match = false;
dbgs() << "Freq mismatch: " << bfi_detail::getBlockName(BB) << " "
<< Freq.Integer << " vs " << OtherFreq.Integer << "\n";
The text was updated successfully, but these errors were encountered:
You may be right. I don't remember exactly but it seems that both the float
and int values can be slightly off due to the float point precision and the
min/max values that exist in the same CFG. I don't work in this area any
more so you're welcome to improve the code if you'd like, not worry about
it or revert the commit.
Hello,
I faced with a failed assertion in BlockFrequencyInfoImpl on LLVM TOT.
Repro case: bfi-bug.ll
LLVM should be built in the debug mode.
Please, note that the actual triplet value doesn't seem to matter, as the failed assertion is in target-independent part of the code.
As I understand, the issues happens because the BFI updates are not synced with actual code transformations performed by CodeGenPrepare pass. Namely, the BBs frequency info, expressed as FrequencyData::Integer, is not updated.
Does it make sense to compare Scaled values instead?
The text was updated successfully, but these errors were encountered: