- Jul 22, 2016
-
-
Wei Mi authored
Differential Revision: https://reviews.llvm.org/D22688 llvm-svn: 276449
-
- Jul 20, 2016
-
-
George Burgess IV authored
A seemingly common use for the walker's getClobberingMemoryAccess function is: ``` MemoryAccess *getClobber(MemorySSAWalker *W, MemoryUseOrDef *MUD) { const Instruction *I = MUD->getMemoryInst(); return W->getClobberingMemoryAccess(I); } ``` Which is kind of redundant, since walkers will ultimately query MSSA to find out which MemoryAccess `I` maps to (...which is always `MUD`). So, this patch adds an overload of getClobberingMemoryAccess that accepts MemoryAccesses directly. As a result, the Instruction overload of getClobberingMemoryAccess becomes a lightweight wrapper around our new overload. Additionally, this patch un`virtual`izes the Instruction overload of getClobberingMemoryAccess, since there doesn't seem to be a walker that benefits from that being virtual, and I can't think of how else one would implement it. Happy to make it virtual again if we would benefit from doing so. llvm-svn: 276169
-
Sanjay Patel authored
As noted in https://reviews.llvm.org/D22537 , we can use this functionality in visitSelectInstWithICmp() and InstSimplify, but currently we have duplicated code. llvm-svn: 276140
-
Sanjay Patel authored
llvm-svn: 276135
-
Michael Zolotukhin authored
This reverts commit r276064, and thus reapplies r275891 and r275883 with a fix for PR28608. llvm-svn: 276077
-
Sean Silva authored
Revert "[LoopSimplify] Update LCSSA after separating nested loops." This reverts commit r275891. Revert "[LCSSA] Post-process PHI-nodes created by SSAUpdate when constructing LCSSA form." This reverts commit r275883. llvm-svn: 276064
-
Daniel Berlin authored
llvm-svn: 276050
-
Daniel Berlin authored
Summary: Make MemorySSA::dominates/locallydominates constant time Reviewers: george.burgess.iv, gberry Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D22527 llvm-svn: 276046
-
- Jul 19, 2016
-
-
George Burgess IV authored
This patch updates MemorySSA's use-optimizing walker to be more accurate and, in some cases, faster. Essentially, this changed our core walking algorithm from a cache-as-you-go DFS to an iteratively expanded DFS, with all of the caching happening at the end. Said expansion happens when we hit a Phi, P; we'll try to do the smallest amount of work possible to see if optimizing above that Phi is legal in the first place. If so, we'll expand the search to see if we can optimize to the next phi, etc. An iteratively expanded DFS lets us potentially quit earlier (because we don't assume that we can optimize above all phis) than our old walker. Additionally, because we don't cache as we go, we can now optimize above loops. As an added bonus, this patch adds a ton of verification (if EXPENSIVE_CHECKS are enabled), so finding bugs is easier. Differential Revision: https://reviews.llvm.org/D21777 llvm-svn: 275940
-
- Jul 18, 2016
-
-
Michael Zolotukhin authored
Summary: Usually LCSSA survives this transformation, but in some cases (see attached test) it doesn't: values from the original loop after separating might be used from the outer loop. Before the transformation it was the same loop, so LCSSA phis were not required. This fixes PR28272. Reviewers: sanjoy, hfinkel, chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21665 llvm-svn: 275891
-
Michael Zolotukhin authored
Summary: SSAUpdate might insert PHI-nodes inside loops, which can break LCSSA form unless we fix it up. This fixes PR28424. Reviewers: sanjoy, chandlerc, hfinkel Subscribers: uabelho, llvm-commits Differential Revision: http://reviews.llvm.org/D21997 llvm-svn: 275883
-
- Jul 15, 2016
-
-
Michael Zolotukhin authored
Summary: When a pass tries to keep LCSSA form it's often convenient to be able to update LCSSA for a set of instructions rather than for the entire loop. This patch makes the processInstruction from LCSSA externally available under a name formLCSSAForInstruction. Reviewers: chandlerc, sanjoy, hfinkel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D22378 llvm-svn: 275613
-
David Majnemer authored
Calling getModRefInfo with a fence resulted in crashes because fences don't have a memory location. Add a new predicate to Instruction called isFenceLike which indicates that the instruction mutates memory but not any single memory location in particular. In practice, it is a proxy for the set of instructions which "mayWriteToMemory" but cannot be used with MemoryLocation::get. This fixes PR28570. llvm-svn: 275581
-
- Jul 13, 2016
-
-
Andrew Kaylor authored
llvm-svn: 275304
-
Andrew Kaylor authored
Patch by Sunita Marathe Differential Revision: http://reviews.llvm.org/D21920 llvm-svn: 275284
-
- Jul 09, 2016
-
-
Davide Italiano authored
Chandler pointed out in his review but I forgot to remove before committing, my bad. llvm-svn: 274963
-
Davide Italiano authored
While here move simplifyLoop() function to the new header, as suggested by Chandler in the review. Differential Revision: http://reviews.llvm.org/D21404 llvm-svn: 274959
-
- Jul 08, 2016
-
-
Xinliang David Li authored
llvm-svn: 274927
-
- Jul 07, 2016
-
-
Davide Italiano authored
llvm-svn: 274796
-
Sjoerd Meijer authored
moved the optimise for size check inside function optimizeFPuts. llvm-svn: 274758
-
Sjoerd Meijer authored
because fwrite requires more arguments and thus extra MOVs are required. llvm-svn: 274753
-
- Jul 06, 2016
-
-
Chad Rosier authored
Differential Revision: http://reviews.llvm.org/D22058 llvm-svn: 274679
-
Daniel Berlin authored
llvm-svn: 274606
-
George Burgess IV authored
llvm-svn: 274590
-
- Jul 01, 2016
-
-
Xinliang David Li authored
Differential Revision: http://reviews.llvm.org/D21636 llvm-svn: 274334
-
- Jun 28, 2016
-
-
Michael Kuperstein authored
llvm-svn: 273974
-
- Jun 27, 2016
-
-
Daniel Berlin authored
NFC. llvm-svn: 273901
-
- Jun 26, 2016
-
-
Benjamin Kramer authored
build. There's a known bug in msvc 2013 that fails to compile do-while loops inside of ranged for loops. llvm-svn: 273811
-
Benjamin Kramer authored
Only minor manual fixes. No functionality change intended. llvm-svn: 273808
-
- Jun 25, 2016
-
-
David Majnemer authored
No functional change is intended llvm-svn: 273780
-
David Majnemer authored
This reverts commit r273778, it seems to break UBSan :/ llvm-svn: 273779
-
David Majnemer authored
SimplifyCFG had logic to insert calls to llvm.trap for two very particular IR patterns: stores and invokes of undef/null. While InstCombine canonicalizes certain undefined behavior IR patterns to stores of undef, phase ordering means that this cannot be relied upon in general. There are much better tools than llvm.trap: UBSan and ASan. N.B. I could be argued into reverting this change if a clear argument as to why it is important that we synthesize llvm.trap for stores, I'd be hard pressed to see why it'd be useful for invokes... llvm-svn: 273778
-
David Majnemer authored
Calling null is undefined behavior, a call to undef can be trivially treated as a call to null. llvm-svn: 273776
-
Michael Kuperstein authored
llvm-svn: 273761
-
David Majnemer authored
r273711 was reverted by r273743. The inliner needs to know about any call sites in the inlined function. These were obscured if we replaced a call to undef with an undef but kept the call around. This fixes PR28298. llvm-svn: 273753
-
David Majnemer authored
llvm-svn: 273752
-
Nico Weber authored
llvm-svn: 273743
-
- Jun 24, 2016
-
-
George Burgess IV authored
This patch moves MSSA's caching walker into MemorySSA, and moves the actual definition of MSSA's caching walker out of MemorySSA.h. This is done in preparation for the new walker, which should be out for review soonish. Also, this patch removes a field from UpwardsMemoryQuery and has a few lines of diff from clang-format'ing MemorySSA.cpp. llvm-svn: 273723
-
David Majnemer authored
We cannot remove an instruction with no uses just because SimplifyInstruction succeeds. It may have side effects. llvm-svn: 273711
-
David Majnemer authored
This makes the code a little more concise, no functional change is intended. llvm-svn: 273644
-