<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bcm5719-llvm/llvm/lib/Transforms, branch meklort-10.0.0</title>
<subtitle>Project Ortega BCM5719 LLVM</subtitle>
<id>https://git.raptorcs.com/git/bcm5719-llvm/atom?h=meklort-10.0.0</id>
<link rel='self' href='https://git.raptorcs.com/git/bcm5719-llvm/atom?h=meklort-10.0.0'/>
<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>[WinEH] Fix inttoptr+phi optimization in presence of catchswitch</title>
<updated>2020-03-02T10:38:20+00:00</updated>
<author>
<name>Reid Kleckner</name>
<email>rnk@google.com</email>
</author>
<published>2020-03-01T15:47:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=0bf4795d069642afe2a430521f3549e425f092c9'/>
<id>urn:sha1:0bf4795d069642afe2a430521f3549e425f092c9</id>
<content type='text'>
getFirstInsertionPt's return value must be checked for validity before
casting it to Instruction*. Don't attempt to insert casts after a phi in
a catchswitch block.

Fixes PR45033, introduced in D37832.

Reviewed By: davidxl, hfinkel

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

(cherry picked from commit 1adbe86d87bd4ecffc73ab17c7da56f44816f424)
</content>
</entry>
<entry>
<title>SROA: Don't drop atomic load/store alignments (PR45010)</title>
<updated>2020-02-28T10:27:33+00:00</updated>
<author>
<name>Hans Wennborg</name>
<email>hans@chromium.org</email>
</author>
<published>2020-02-27T16:01:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=7cb6829291280a2adcc260346a7a56b8bddd43db'/>
<id>urn:sha1:7cb6829291280a2adcc260346a7a56b8bddd43db</id>
<content type='text'>
SROA will drop the explicit alignment on allocas when the ABI guarantees
enough alignment. Because the alignment on new load/store instructions
are set based on the alloca's alignment, that means SROA would end up
dropping the alignment from atomic loads and stores, which is not
allowed (see bug). For those, make sure to always carry over the
alignment from the previous instruction.

Differential revision: https://reviews.llvm.org/D75266

(cherry picked from commit d48c981697a49653efff9dd14fa692d99e6fa868)
</content>
</entry>
<entry>
<title>[InstCombine] foldShiftIntoShiftInAnotherHandOfAndInICmp(): fix miscompile (PR44802)</title>
<updated>2020-02-27T12:45:21+00:00</updated>
<author>
<name>Roman Lebedev</name>
<email>lebedev.ri@gmail.com</email>
</author>
<published>2020-02-25T14:24:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=b2b41bc3b51a083fb9e36e50d0131dfbd79e00ce'/>
<id>urn:sha1:b2b41bc3b51a083fb9e36e50d0131dfbd79e00ce</id>
<content type='text'>
Much like with reassociateShiftAmtsOfTwoSameDirectionShifts(),
as input, we have the following pattern:
  icmp eq/ne (and ((x shift Q), (y oppositeshift K))), 0
We want to rewrite that as:
  icmp eq/ne (and (x shift (Q+K)), y), 0  iff (Q+K) u&lt; bitwidth(x)

While we know that originally (Q+K) would not overflow
(because  2 * (N-1) u&lt;= iN -1), we may have looked past extensions of
shift amounts. so it may now overflow in smaller bitwidth.

To ensure that does not happen, we need to ensure that the total maximal
shift amount is still representable in that smaller bitwidth.
If the overflow would happen, (Q+K) u&lt; bitwidth(x) check would be bogus.

https://bugs.llvm.org/show_bug.cgi?id=44802
(cherry picked from commit 2855c8fed9326ec44526767f1596a4fe4e55dc70)
</content>
</entry>
<entry>
<title>[InstCombine] reassociateShiftAmtsOfTwoSameDirectionShifts(): fix miscompile (PR44802)</title>
<updated>2020-02-27T12:45:21+00:00</updated>
<author>
<name>Roman Lebedev</name>
<email>lebedev.ri@gmail.com</email>
</author>
<published>2020-02-25T13:48:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=f115a88191c3dc80c5140fbbf63f74ca77fcc74b'/>
<id>urn:sha1:f115a88191c3dc80c5140fbbf63f74ca77fcc74b</id>
<content type='text'>
As input, we have the following pattern:
  Sh0 (Sh1 X, Q), K
We want to rewrite that as:
  Sh x, (Q+K)  iff (Q+K) u&lt; bitwidth(x)
While we know that originally (Q+K) would not overflow
(because  2 * (N-1) u&lt;= iN -1), we may have looked past extensions of
shift amounts. so it may now overflow in smaller bitwidth.

To ensure that does not happen, we need to ensure that the total maximal
shift amount is still representable in that smaller bitwidth.
If the overflow would happen, (Q+K) u&lt; bitwidth(x) check would be bogus.

https://bugs.llvm.org/show_bug.cgi?id=44802
(cherry picked from commit 781d077afb0ed9771c513d064c40170c1ccd21c9)
</content>
</entry>
<entry>
<title>Revert "[LICM] Support hosting of dynamic allocas out of loops"</title>
<updated>2020-02-26T15:13:01+00:00</updated>
<author>
<name>Philip Reames</name>
<email>listmail@philipreames.com</email>
</author>
<published>2020-02-25T16:56:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=48d24465668b268ec0aa39b62cabab5ee50e961d'/>
<id>urn:sha1:48d24465668b268ec0aa39b62cabab5ee50e961d</id>
<content type='text'>
This reverts commit 8d22100f66c4170510c6ff028c60672acfe1cff9.

There was a functional regression reported (https://bugs.llvm.org/show_bug.cgi?id=44996).  I'm not actually sure the patch is wrong, but I don't have time to investigate currently, and this line of work isn't something I'm likely to get back to quickly.

(cherry picked from commit 14845b2c459021e3dbf2ead52d707d4a7db40cbb)
</content>
</entry>
<entry>
<title>[LoopRotate] Get and update MSSA only if available in legacy pass manager.</title>
<updated>2020-02-26T09:06:30+00:00</updated>
<author>
<name>Alina Sbirlea</name>
<email>asbirlea@google.com</email>
</author>
<published>2020-02-13T18:49:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=8b0df8e1ed6842095388fce08a0a5f761cd905ed'/>
<id>urn:sha1:8b0df8e1ed6842095388fce08a0a5f761cd905ed</id>
<content type='text'>
Summary:
Potential fix for: https://bugs.llvm.org/show_bug.cgi?id=44889 and https://bugs.llvm.org/show_bug.cgi?id=44408

In the legacy pass manager, loop rotate need not compute MemorySSA when not being in the same loop pass manager with other loop passes.
There isn't currently a way to differentiate between the two cases, so this attempts to limit the usage in LoopRotate to only update MemorySSA when the analysis is already available.
The side-effect of this is that it will split the Loop pipeline.

This issue does not apply to the new pass manager, where we have a flag specifying if all loop passes in that loop pass manager preserve MemorySSA.

Reviewers: dmgreen, fedor.sergeev, nikic

Subscribers: Prazek, hiraditya, george.burgess.iv, llvm-commits

Tags: #llvm

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

(cherry picked from commit 1326a5a4cfe004181f2ec8231d84ecda2b93cb25)
</content>
</entry>
<entry>
<title>Filter callbr insts from critical edge splitting</title>
<updated>2020-02-21T08:51:47+00:00</updated>
<author>
<name>Bill Wendling</name>
<email>isanbard@gmail.com</email>
</author>
<published>2020-02-21T00:22:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=da0fe2ade369223ebea2dafd411746e854a801f2'/>
<id>urn:sha1:da0fe2ade369223ebea2dafd411746e854a801f2</id>
<content type='text'>
Similarly to how splitting predecessors with an indirectbr isn't handled
in the generic way, we also shouldn't split callbrs, for similar
reasons.

(cherry picked from commit 2fe457690da0fc38bc7f9f1d0aee2ba6a6a16ada)
</content>
</entry>
<entry>
<title>[SLPVectorizer] Do not assume extracelement idx is a ConstantInt.</title>
<updated>2020-02-19T12:38:53+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2020-02-18T16:23:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=a0fe9e0517637c97f4f282bd3b76f2406a6cc1b2'/>
<id>urn:sha1:a0fe9e0517637c97f4f282bd3b76f2406a6cc1b2</id>
<content type='text'>
The index of an ExtractElementInst is not guaranteed to be a
ConstantInt. It can be any integer value. Check explicitly for
ConstantInts.

The new test cases illustrate scenarios where we crash without
this patch. I've also added another test case to check the matching
of extractelement vector ops works.

Reviewers: RKSimon, ABataev, dtemirbulatov, vporpo

Reviewed By: ABataev

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

(cherry picked from commit e32522ca178acc42e26f21d64ef8fc180ad772bd)
</content>
</entry>
<entry>
<title>[InstCombine] Fix infinite min/max canonicalization loop (PR44541)</title>
<updated>2020-02-10T10:29:25+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>nikita.ppv@gmail.com</email>
</author>
<published>2020-02-02T16:40:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=fc12083cbc5caa0e60a8e12bab9c34f71a4b31b1'/>
<id>urn:sha1:fc12083cbc5caa0e60a8e12bab9c34f71a4b31b1</id>
<content type='text'>
While D72944 also fixes https://bugs.llvm.org/show_bug.cgi?id=44541,
it does so in a more roundabout manner and there might be other
loopholes to trigger the same issue. This is a more direct fix,
that prevents the transform if the min/max is based on a
non-canonical sub X, 0 instruction.

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

(cherry picked from commit a148b9e9909db6a592609eb35b4de38c9e67cb8b)
</content>
</entry>
</feed>
