summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Analysis/MemorySSA.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename a few unittests/.../Foo.cpp files to FooTest.cppNico Weber2018-09-031-1395/+0
| | | | | | | | | The convention for unit test sources is that they're called FooTest.cpp. No behavior change. https://reviews.llvm.org/D51579 llvm-svn: 341313
* [MemorySSA] Fix def optimization handlingGeorge Burgess IV2018-08-231-0/+128
| | | | | | | | | | | | | | | | | | | | | | In order for more complex updates of MSSA to happen (e.g. those in D45299), MemoryDefs need to be actual `Use`s of what they're optimized to. This patch makes that happen. In addition, this patch changes our optimization behavior for Defs slightly: we'll now consider a Def optimization invalid if the MemoryAccess it's optimized to changes. That we weren't doing this before was a bug, but given that we were tracking these with a WeakVH before, it was sort of difficult for that to matter. We're already have both of these behaviors for MemoryUses. The difference is that a MemoryUse's defining access is always its optimized access, and defining accesses are always `Use`s (in the LLVM sense). Nothing exploded when testing a stage3 clang+llvm locally, so... This also includes the test-case promised in r340461. llvm-svn: 340577
* [MemorySSA] "Fix" lifetime intrinsic handlingGeorge Burgess IV2018-08-101-0/+66
| | | | | | | | | | | | | | | | | | | MemorySSA currently creates MemoryAccesses for lifetime intrinsics, and sometimes treats them as clobbers. This may/may not be the best way forward, but while we're doing it, we should consider MayAlias/PartialAlias to be clobbers. The ideal fix here is probably to remove all of this reasoning about lifetimes from MemorySSA + put it into the passes that need to care. But that's a wayyy broader fix that needs some consensus, and we have miscompiles + a release branch today, and this should solve the miscompiles just as well. differential revision is D43269. Landing without an explicit LGTM (and without using the special please-autoclose-this syntax) so we can still use that revision as a place to decide what the right fix here is. llvm-svn: 339411
* llvm: Add support for "-fno-delete-null-pointer-checks"Manoj Gupta2018-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Support for this option is needed for building Linux kernel. This is a very frequently requested feature by kernel developers. More details : https://lkml.org/lkml/2018/4/4/601 GCC option description for -fdelete-null-pointer-checks: This Assume that programs cannot safely dereference null pointers, and that no code or data element resides at address zero. -fno-delete-null-pointer-checks is the inverse of this implying that null pointer dereferencing is not undefined. This feature is implemented in LLVM IR in this CL as the function attribute "null-pointer-is-valid"="true" in IR (Under review at D47894). The CL updates several passes that assumed null pointer dereferencing is undefined to not optimize when the "null-pointer-is-valid"="true" attribute is present. Reviewers: t.p.northover, efriedma, jyknight, chandlerc, rnk, srhines, void, george.burgess.iv Reviewed By: efriedma, george.burgess.iv Subscribers: eraman, haicheng, george.burgess.iv, drinkcat, theraven, reames, sanjoy, xbolva00, llvm-commits Differential Revision: https://reviews.llvm.org/D47895 llvm-svn: 336613
* Expose must/may alias info in MemorySSA.Alina Sbirlea2018-03-081-0/+200
| | | | | | | | | | | | | | | | Summary: Building MemorySSA gathers alias information for Defs/Uses. Store and expose this information when optimizing uses (when building MemorySSA), and when optimizing defs or updating uses (getClobberingMemoryAccess). Current patch does not propagate alias information through MemoryPhis. Reviewers: gbiv, dberlin Subscribers: Prazek, sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D38569 llvm-svn: 327035
* [MemorySSA] Invalidate def caches on deletionGeorge Burgess IV2018-02-271-0/+48
| | | | | | | | | | | The only cases I can come up with where this invalidation needs to happen is when there's a deletion somewhere. If we find more creative test-cases, we can probably go with another approach mentioned on PR36529. Fixes PR36529. llvm-svn: 326177
* [MemorySSA] Fix a cache invalidation bug with removed accessesGeorge Burgess IV2018-02-231-0/+42
| | | | | | | I suspect there's a deeper issue here, but we probably shouldn't be using INVALID_MEMORYSSA_ID as liveOnEntry's ID anyway. llvm-svn: 325971
* [mssa] Fix case when there is no definition in a block prior to an inserted use.Alina Sbirlea2017-06-071-0/+46
| | | | | | | | | | | | | | | Summary: Check that the first access before one being tested is valid. Before this patch, if there was no definition prior to the Use being tested, the first time Iter was deferenced, it hit the sentinel. Reviewers: dberlin, gbiv Subscribers: sanjoy, Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D33950 llvm-svn: 304926
* Re-sort #include lines for unittests. This uses a slightly modifiedChandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | clang-format (https://reviews.llvm.org/D33932) to keep primary headers at the top and handle new utility headers like 'gmock' consistently with other utility headers. No other change was made. I did no manual edits, all of this is clang-format. This should allow other changes to have more clear and focused diffs, and is especially motivated by moving some headers into more focused libraries. llvm-svn: 304786
* MemorySSA: Move to Analysis, from Transforms/Utils. It's used asDaniel Berlin2017-04-111-0/+865
Analysis, it has Analysis passes, and once NewGVN is made an Analysis, this removes the cross dependency from Analysis to Transform/Utils. NFC. llvm-svn: 299980
OpenPOWER on IntegriCloud