[PATCH] D83926: [ValueTracking] Let isGuaranteedNotToBeUndefOrPoison use canCreateUndefOrPoison

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 19 10:10:38 PDT 2020


aqjune marked an inline comment as done.
aqjune added a comment.

Since isGuaranteedNotToBeUndefOrPoison now traverses over many ops, there is 0.3% slowdown from ReleaseLTO-O3 in average on CTMark:

  +-----------------------------------------------+---------+-------+----------+-------+-------+----------+
  |                                               | compile |       |          | link  |       |          |
  +-----------------------------------------------+---------+-------+----------+-------+-------+----------+
  |                                               | base    |       | slowdown | base  |       | slowdown |
  | CTMark/7zip/7zip-benchmark.test               | 89.31   | 89.96 | 0.72%    | 46.73 | 46.93 | 0.43%    |
  | CTMark/Bullet/bullet.test                     | 62.76   | 63.13 | 0.59%    | 9.59  |  9.62 | 0.31%    |
  | CTMark/ClamAV/clamscan.test                   | 26.91   | 26.95 | 0.13%    | 24.70 | 24.82 | 0.48%    |
  | CTMark/SPASS/SPASS.test                       | 26.07   | 26.18 | 0.42%    | 19.60 | 19.72 | 0.60%    |
  | CTMark/consumer-typeset/consumer-typeset.test | 19.58   | 19.65 | 0.36%    | 18.41 | 18.49 | 0.44%    |
  | CTMark/kimwitu++/kc.test                      | 26.50   | 26.56 | 0.22%    | 14.54 | 14.51 | -0.21%   |
  | CTMark/lencod/lencod.test                     | 34.48   | 34.47 | -0.03%   | 38.38 | 38.67 | 0.76%    |
  | CTMark/mafft/pairlocalalign.test              | 16.17   | 16.25 | 0.44%    | 8.64  |  8.64 | 0.00%    |
  | CTMark/sqlite3/sqlite3.test                   | 24.49   | 24.42 | -0.28%   | 24.43 | 24.52 | 0.36%    |
  | CTMark/tramp3d-v4/tramp3d-v4.test             | 49.14   | 49.10 | -0.08%   | 35.64 | 35.85 | 0.59%    |
  +-----------------------------------------------+---------+-------+----------+-------+-------+----------+

The solution for this doesn't seem trivial. Fixing existing undef/poison-related bugs might introduce more calls to this function, which will bring more slowdown.
What would be the right direction to address this issue?



================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4785
-  if (isa<FreezeInst>(V))
-    return true;
-  // TODO: Some instructions are guaranteed to return neither undef
----------------
jdoerfert wrote:
> Personally, I'd keep freeze up top, easy case after all ;). No strong opinion though.
Since constants and noundefs (after relevant patches are landed) are/will be very common, locating those checks at the top seemed beneficial.
I saw slight degradation from compilation time from this patch - maybe a single isa<> might be super cheap so it won't make affect the result, but wanted to make things optimal :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83926





More information about the llvm-commits mailing list