[PATCH] D95789: [SpeculateAroundPHIs] Avoid speculation on loop back edges

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 7 08:51:03 PST 2021


bjope added a comment.

In D95789#2604835 <https://reviews.llvm.org/D95789#2604835>, @Meinersbur wrote:

> IIUC, this patch inhibits optimizations opportunities because of a bug elsewhere?

I haven't understood if the rewrite really is an optimization or not when the critical edge split occur for a backedge. All I see for my target are performance penalties (either by no longer getting an "hwloop", or due to that the rewrite introduces a conditional branch inside the loop body).
This patch both restores performance loss introduced by changing from legacy PM to new PM, and avoids the problem with incorrect loop metadata after such non-profitable rewrites. If someone could motivate the transform (why it should be considered as beneficial), then I agree that the loop metadata problem should be solved instead. And then maybe we also need some TTI hook or something to allow targets to skip the transform if it isn't wanted. Those rewrites at least seem to be devastating for our OOT benchmark suite when switching from legacy PM to new PM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95789



More information about the llvm-commits mailing list