<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bcm5719-llvm/llvm/test/Transforms/EarlyCSE, branch meklort-10.0.1</title>
<subtitle>Project Ortega BCM5719 LLVM</subtitle>
<id>https://git.raptorcs.com/git/bcm5719-llvm/atom?h=meklort-10.0.1</id>
<link rel='self' href='https://git.raptorcs.com/git/bcm5719-llvm/atom?h=meklort-10.0.1'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/'/>
<updated>2020-03-19T09:02:25+00:00</updated>
<entry>
<title>[EarlyCSE] avoid crashing when detecting min/max/abs patterns (PR41083)</title>
<updated>2020-03-19T09:02:25+00:00</updated>
<author>
<name>Sanjay Patel</name>
<email>spatel@rotateright.com</email>
</author>
<published>2020-02-10T22:13:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=623461b2ce421cd287f1bea50c0998003375a782'/>
<id>urn:sha1:623461b2ce421cd287f1bea50c0998003375a782</id>
<content type='text'>
As discussed in PR41083:
https://bugs.llvm.org/show_bug.cgi?id=41083
...we can assert/crash in EarlyCSE using the current hashing scheme and
instructions with flags.

ValueTracking's matchSelectPattern() may rely on overflow (nsw, etc) or
other flags when detecting patterns such as min/max/abs composed of
compare+select. But the value numbering / hashing mechanism used by
EarlyCSE intersects those flags to allow more CSE.

Several alternatives to solve this are discussed in the bug report.
This patch avoids the issue by doing simple matching of min/max/abs
patterns that never requires instruction flags. We give up some CSE
power because of that, but that is not expected to result in much
actual performance difference because InstCombine will canonicalize
these patterns when possible. It even has this comment for abs/nabs:

  /// Canonicalize all these variants to 1 pattern.
  /// This makes CSE more likely.

(And this patch adds PhaseOrdering tests to verify that the expected
transforms are still happening in the standard optimization pipelines.

I left this code to use ValueTracking's "flavor" enum values, so we
don't have to change the callers' code. If we decide to go back to
using the ValueTracking call (by changing the hashing algorithm
instead), it should be obvious how to replace this chunk.

Differential Revision: https://reviews.llvm.org/D74285

(cherry picked from commit b8ebc11f032032c7ca449f020a1fe40346e707c8)
</content>
</entry>
<entry>
<title>Reapply: [DebugInfo] Correctly handle salvaged casts and split fragments at ISel</title>
<updated>2019-12-18T16:26:42+00:00</updated>
<author>
<name>stozer</name>
<email>stephen.tozer@sony.com</email>
</author>
<published>2019-12-18T14:28:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=89d19d60adb953dad14c04c7dcaa92d135a7d58f'/>
<id>urn:sha1:89d19d60adb953dad14c04c7dcaa92d135a7d58f</id>
<content type='text'>
This reverts commit 1f3dd83cc1f2b8f72b9d59e2b4221b12fb7f9a95, reapplying
commit bb1b0bc4e57428ce364d3d6c075ff03cb8973462.

The original commit failed on some builds seemingly due to the use of a
bracketed constructor with an std::array, i.e. `std::array&lt;&gt; arr({...})`.
</content>
</entry>
<entry>
<title>Revert "[DebugInfo] Correctly handle salvaged casts and split fragments at ISel"</title>
<updated>2019-12-18T11:46:10+00:00</updated>
<author>
<name>stozer</name>
<email>stephen.tozer@sony.com</email>
</author>
<published>2019-12-18T11:46:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=1f3dd83cc1f2b8f72b9d59e2b4221b12fb7f9a95'/>
<id>urn:sha1:1f3dd83cc1f2b8f72b9d59e2b4221b12fb7f9a95</id>
<content type='text'>
Reverted due to build failure on windows bots.

This reverts commit bb1b0bc4e57428ce364d3d6c075ff03cb8973462.
</content>
</entry>
<entry>
<title>[DebugInfo] Correctly handle salvaged casts and split fragments at ISel</title>
<updated>2019-12-18T11:09:18+00:00</updated>
<author>
<name>stozer</name>
<email>stephen.tozer@sony.com</email>
</author>
<published>2019-12-17T09:37:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=bb1b0bc4e57428ce364d3d6c075ff03cb8973462'/>
<id>urn:sha1:bb1b0bc4e57428ce364d3d6c075ff03cb8973462</id>
<content type='text'>
Previously, LLVM had no functional way of performing casts inside of a
DIExpression(), which made salvaging cast instructions other than Noop
casts impossible. This patch enables the salvaging of casts by using the
DW_OP_LLVM_convert operator for SExt and Trunc instructions.

There is another issue which is exposed by this fix, in which fragment
DIExpressions (which are preserved more readily by this patch) for
values that must be split across registers in ISel trigger an assertion,
as the 'split' fragments extend beyond the bounds of the fragment
DIExpression causing an error. This patch also fixes this issue by
checking the fragment status of DIExpressions which are to be split, and
dropping fragments that are invalid.
</content>
</entry>
<entry>
<title>[IR] Fix mayReadFromMemory() for writeonly calls</title>
<updated>2019-10-21T06:52:08+00:00</updated>
<author>
<name>Yevgeny Rouban</name>
<email>yevgeny.rouban@azul.com</email>
</author>
<published>2019-10-21T06:52:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=5e5af533ab16bad6dc5519b97b1820732d0141a5'/>
<id>urn:sha1:5e5af533ab16bad6dc5519b97b1820732d0141a5</id>
<content type='text'>
Current implementation of Instruction::mayReadFromMemory()
returns !doesNotAccessMemory() which is !ReadNone. This
does not take into account that the writeonly attribute
also indicates that the call does not read from memory.

The patch changes the predicate to !doesNotReadMemory()
that reflects the intended behavior.

Differential Revision: https://reviews.llvm.org/D69086

llvm-svn: 375389
</content>
</entry>
<entry>
<title>[EarlyCSE] Add support for unary FNeg to EarlyCSE</title>
<updated>2019-08-07T14:34:41+00:00</updated>
<author>
<name>Cameron McInally</name>
<email>cameron.mcinally@nyu.edu</email>
</author>
<published>2019-08-07T14:34:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=303b6dbfb47c6e7cc346468aeb0710c2877150e8'/>
<id>urn:sha1:303b6dbfb47c6e7cc346468aeb0710c2877150e8</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D65815

llvm-svn: 368171
</content>
</entry>
<entry>
<title>[NFC][EarlyCSE] Pre-commit unary FNeg tests.</title>
<updated>2019-08-06T16:41:30+00:00</updated>
<author>
<name>Cameron McInally</name>
<email>cameron.mcinally@nyu.edu</email>
</author>
<published>2019-08-06T16:41:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=9c52f66f48226e58f5e811e01add6c246209fea4'/>
<id>urn:sha1:9c52f66f48226e58f5e811e01add6c246209fea4</id>
<content type='text'>
llvm-svn: 368056
</content>
</entry>
<entry>
<title>[EarlyCSE] Fix hashing of self-compares</title>
<updated>2019-06-17T19:11:28+00:00</updated>
<author>
<name>Joseph Tremoulet</name>
<email>jotrem@microsoft.com</email>
</author>
<published>2019-06-17T19:11:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=daa1ae6142956039137253b15a2da4e3ac44b89f'/>
<id>urn:sha1:daa1ae6142956039137253b15a2da4e3ac44b89f</id>
<content type='text'>
Summary:
Update compare normalization in SimpleValue hashing to break ties (when
the same value is being compared to itself) by switching to the swapped
predicate if it has a lower numerical value.  This brings the hashing in
line with isEqual, which already recognizes the self-compares with
swapped predicates as equal.

Fixes PR 42280.

Reviewers: spatel, efriedma, nikic, fhahn, uabelho

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63349

llvm-svn: 363598
</content>
</entry>
<entry>
<title>[EarlyCSE] Ensure equal keys have the same hash value</title>
<updated>2019-06-13T15:24:11+00:00</updated>
<author>
<name>Joseph Tremoulet</name>
<email>jotrem@microsoft.com</email>
</author>
<published>2019-06-13T15:24:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=3bc6e2a7aa3853b06045c42e81af094647c48676'/>
<id>urn:sha1:3bc6e2a7aa3853b06045c42e81af094647c48676</id>
<content type='text'>
Summary:
The logic in EarlyCSE that looks through 'not' operations in the
predicate recognizes e.g. that `select (not (cmp sgt X, Y)), X, Y` is
equivalent to `select (cmp sgt X, Y), Y, X`.  Without this change,
however, only the latter is recognized as a form of `smin X, Y`, so the
two expressions receive different hash codes.  This leads to missed
optimization opportunities when the quadratic probing for the two hashes
doesn't happen to collide, and assertion failures when probing doesn't
collide on insertion but does collide on a subsequent table grow
operation.

This change inverts the order of some of the pattern matching, checking
first for the optional `not` and then for the min/max/abs patterns, so
that e.g. both expressions above are recognized as a form of `smin X, Y`.

It also adds an assertion to isEqual verifying that it implies equal
hash codes; this fires when there's a collision during insertion, not
just grow, and so will make it easier to notice if these functions fall
out of sync again.  A new flag --earlycse-debug-hash is added which can
be used when changing the hash function; it forces hash collisions so
that any pair of values inserted which compare as equal but hash
differently will be caught by the isEqual assertion.

Reviewers: spatel, nikic

Reviewed By: spatel, nikic

Subscribers: lebedev.ri, arsenm, craig.topper, efriedma, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62644

llvm-svn: 363274
</content>
</entry>
<entry>
<title>[EarlyCSE] Add tests for negated min/max/abs [NFC]</title>
<updated>2019-06-05T21:30:10+00:00</updated>
<author>
<name>Joseph Tremoulet</name>
<email>jotrem@microsoft.com</email>
</author>
<published>2019-06-05T21:30:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=acb56090639de1413b0147c66f78698844f37114'/>
<id>urn:sha1:acb56090639de1413b0147c66f78698844f37114</id>
<content type='text'>
Summary:
I'm planning to update the hashing logic to recognize their equivalence
in a subsequent change (D62644).

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62918

llvm-svn: 362657
</content>
</entry>
</feed>
