[PATCH] D96754: [NewPM] Use stale divergence analysis with SimpleLoopUnswitch

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 10:51:58 PST 2021


tra added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:2886-2891
+/// The `StaleDA` analysis is useful for skipping divergent branches
+/// if it is available: unswitching such a branch is expensive on
+/// targets that have divergence. The analysis is stale since other
+/// loop transforms neither preserve nor update it, but it is safe for
+/// skipping branches.
+///
----------------
Could you elaborate on why it is always safe?

IIUIC, the idea is that by default we'll treat all branches as divergent. The DA will allow treating some branches as non-divergent. Any new branches created transforms will not be included in the stale DA and therefore will be treated as divergent,

Perhaps `BaselineDA` would be a better name? Yes, it is potentially stale and that needs to be prominently displayed, but being stale is not particularly descriptive of the parameter.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96754



More information about the llvm-commits mailing list