[PATCH] D63934: [MIR] Improve PRE condition of MachineCSE optimization

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 17:25:25 PDT 2019


anton-afanasyev added a subscriber: lkail.
anton-afanasyev added a comment.

Hi all! I've figured out that my current implementation of PRE is incorrect and it needs to be either corrected, restricted or reverted.
The issue is that current PRE can actually hoist instruction executing it speculatively for some CFG paths which potentially leads to perf degradation. However I believe that current heuristic PRE is rather useful if it is restricted enough. Good restriction (apart from this revision) is implemented by @lkail here: https://reviews.llvm.org/D64394, it is based on basic block frequencies comparision.

@asbirlea, @aymanmus, @igorb -- does this restriction solve your particular issues with perf degradation?
Yes, this restriction still allows speculative execution (so one need to forbid hoisting of "illegal" instructions like throwable ones), but this execution consider to be beneficial.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63934/new/

https://reviews.llvm.org/D63934





More information about the llvm-commits mailing list