Similarly as for pointers, even for integers a == b is usually false.
GCC also uses this heuristic.
Paths
| Differential D85781
[BPI] Improve static heuristics for integer comparisons ClosedPublic Authored by xbolva00 on Aug 11 2020, 2:10 PM.
Details Summary Similarly as for pointers, even for integers a == b is usually false. GCC also uses this heuristic.
Diff Detail
Event TimelineComment Actions Any perf data?
Comment Actions
I observed nice improvement for zstd with silesia dataset. Perf data: https://pastebin.com/N1JEzCMm Decompression speed was improved quite significatly. ~ 940 MB/s -> 970 - 980 MB/s This revision is now accepted and ready to land.Aug 12 2020, 9:23 PM
Herald added subscribers: luismarques, apazos, sameer.abuasal and 24 others. · View Herald TranscriptAug 13 2020, 3:42 AM xbolva00 marked an inline comment as done. Closed by commit rG385c9d673f21: [BPI] Improve static heuristics for integer comparisons (authored by xbolva00). · Explain WhyAug 13 2020, 3:45 AM This revision was automatically updated to reflect the committed changes. xbolva00 added a reverting change: rGa0485421d24b: Revert "[BPI] Improve static heuristics for integer comparisons".Aug 13 2020, 3:59 AM xbolva00 added a reverting change: rGf9264995a691: Revert "[BPI] Improve static heuristics for integer comparisons".Aug 13 2020, 5:37 AM Comment Actions How your last commit differs from the approved one? Why you have so many additional changes in the tests? Comment Actions
Patch affects many codegen tests so I updated them mostly with updater scripts. Comment Actions
The question is why changes for these tests were not part of original review? Did you just missed to upload them or changes appeared later? Comment Actions Missed. Some files were adjusted to be regenerated with update scripts, so some changes are bigger than needed. Comment Actions Some tests have non-trivial changes. Some tests are actually enhanced. In this case, it'd be nice if a separate review (or just a commit, depending on the nature of the updates) to improve the tests first. Then this review can show the differences. It would be easier for a reader to understand the improvement (and also makes reverts easier if this turns out to be insufficient) Comment Actions
FWIW i've already previously provided such feedback at least in https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20200810/819028.html, Comment Actions Feedback arrived after things landed. Should I revert everything and split it to many patches and reland? https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20200810/819028.html Strange (?). I did not receive this mail. Next time please comment on Phab. Comment Actions I suggest the following steps to commit this patch:
false;
turned on and ask the target owner to examine the changes
option on by default;
Comment Actions
Good idea, thanks! xbolva00 added a reverting change: rG0f14b2e6cbb5: Revert "[BPI] Improve static heuristics for integer comparisons".Aug 17 2020, 11:45 AM Comment Actions
Hm, are you not subscribed to/looking through llvm-commits mails?
Comment Actions No. But I got mails from Eli or Tom.
Revision Contents
Diff 285319 llvm/include/llvm/Analysis/BranchProbabilityInfo.h
llvm/lib/Analysis/BranchProbabilityInfo.cpp
llvm/test/Analysis/BranchProbabilityInfo/integer_heuristics.ll
llvm/test/Analysis/BranchProbabilityInfo/loop.ll
llvm/test/Analysis/BranchProbabilityInfo/zero_heuristics.ll
llvm/test/CodeGen/AArch64/aarch64-gep-opt.ll
llvm/test/CodeGen/AArch64/branch-relax-alignment.ll
llvm/test/CodeGen/AArch64/combine-comparisons-by-cse.ll
llvm/test/CodeGen/AArch64/cond-br-tuning.ll
llvm/test/CodeGen/AArch64/fast-isel-cmp-branch.ll
llvm/test/CodeGen/ARM/2011-12-14-machine-sink.ll
llvm/test/CodeGen/ARM/cmpxchg-weak.ll
llvm/test/CodeGen/ARM/lsr-unfolded-offset.ll
llvm/test/CodeGen/ARM/machine-cse-cmp.ll
llvm/test/CodeGen/Hexagon/newvaluejump2.ll
llvm/test/CodeGen/Mips/brcongt.ll
llvm/test/CodeGen/Mips/brconlt.ll
llvm/test/CodeGen/Mips/brconne.ll
llvm/test/CodeGen/Mips/compactbranches/no-beqzc-bnezc.ll
llvm/test/CodeGen/Mips/lcb2.ll
llvm/test/CodeGen/Mips/lcb5.ll
llvm/test/CodeGen/Mips/longbranch/compact-branches-long-branch.ll
llvm/test/CodeGen/Mips/seleq.ll
llvm/test/CodeGen/Mips/selle.ll
llvm/test/CodeGen/PowerPC/brcond.ll
llvm/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll
llvm/test/CodeGen/PowerPC/redundant-copy-after-tail-dup.ll
llvm/test/CodeGen/RISCV/branch.ll
llvm/test/CodeGen/RISCV/rv64m-w-insts-legalization.ll
llvm/test/CodeGen/SystemZ/int-cmp-37.ll
llvm/test/CodeGen/SystemZ/int-cmp-40.ll
llvm/test/CodeGen/Thumb2/LowOverheadLoops/mve-float-loops.ll
llvm/test/CodeGen/Thumb2/LowOverheadLoops/varying-outer-2d-reduction.ll
llvm/test/CodeGen/Thumb2/mve-postinc-distribute.ll
llvm/test/CodeGen/Thumb2/mve-postinc-lsr.ll
llvm/test/CodeGen/Thumb2/mve-satmul-loops.ll
llvm/test/CodeGen/Thumb2/thumb2-branch.ll
llvm/test/CodeGen/X86/3addr-16bit.ll
llvm/test/CodeGen/X86/absolute-cmp.ll
llvm/test/CodeGen/X86/atomic-flags.ll
llvm/test/CodeGen/X86/atomic-unordered.ll
llvm/test/CodeGen/X86/bmi.ll
llvm/test/CodeGen/X86/bt.ll
llvm/test/CodeGen/X86/conditional-tailcall-pgso.ll
llvm/test/CodeGen/X86/conditional-tailcall.ll
llvm/test/CodeGen/X86/fast-isel-cmp-branch2.ll
llvm/test/CodeGen/X86/funnel-shift.ll
llvm/test/CodeGen/X86/indirect-branch-tracking-eh2.ll
llvm/test/CodeGen/X86/jump_sign.ll
llvm/test/CodeGen/X86/lsr-negative-stride.ll
llvm/test/CodeGen/X86/machine-cse.ll
llvm/test/CodeGen/X86/memcmp-more-load-pairs.ll
llvm/test/CodeGen/X86/memcmp-optsize.ll
llvm/test/CodeGen/X86/memcmp-pgso.ll
llvm/test/CodeGen/X86/memcmp.ll
llvm/test/CodeGen/X86/neg_cmp.ll
llvm/test/CodeGen/X86/nobt.ll
llvm/test/CodeGen/X86/pr29170.ll
llvm/test/CodeGen/X86/wide-integer-cmp.ll
|
Perhaps change ZH_TAKEN_WEIGHT to IH_TAKEN_WEIGHT. Similarly for ZH_NONTAKEN_WEIGHT