summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [opaque pointer types] Pass value type to LoadInst creation.James Y Knight2019-02-011-3/+6
| | | | | | | | | This cleans up all LoadInst creation in LLVM to explicitly pass the value type rather than deriving it from the pointer's element-type. Differential Revision: https://reviews.llvm.org/D57172 llvm-svn: 352911
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [IR] Replace `isa<TerminatorInst>` with `isTerminator()`.Chandler Carruth2018-08-261-1/+1
| | | | | | | | | | | | This is a bit awkward in a handful of places where we didn't even have an instruction and now we have to see if we can build one. But on the whole, this seems like a win and at worst a reasonable cost for removing `TerminatorInst`. All of this is part of the removal of `TerminatorInst` from the `Instruction` type hierarchy. llvm-svn: 340701
* Move Analysis/Utils/Local.h back to TransformsDavid Blaikie2018-06-041-1/+1
| | | | | | | | | | Review feedback from r328165. Split out just the one function from the file that's used by Analysis. (As chandlerc pointed out, the original change only moved the header and not the implementation anyway - which was fine for the one function that was used (since it's a template/inlined in the header) but not in general) llvm-svn: 333954
* Fix a couple of layering violations in TransformsDavid Blaikie2018-03-211-1/+1
| | | | | | | | | | | | | Remove #include of Transforms/Scalar.h from Transform/Utils to fix layering. Transforms depends on Transforms/Utils, not the other way around. So remove the header and the "createStripGCRelocatesPass" function declaration (& definition) that is unused and motivated this dependency. Move Transforms/Utils/Local.h into Analysis because it's used by Analysis/MemoryBuiltins.cpp. llvm-svn: 328165
* Sort the remaining #include lines in include/... and lib/....Chandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
* Allow DataLayout to specify addrspace for allocas.Matt Arsenault2017-04-101-6/+11
| | | | | | | | | | | | | | | | | | | | | | | LLVM makes several assumptions about address space 0. However, alloca is presently constrained to always return this address space. There's no real way to avoid using alloca, so without this there is no way to opt out of these assumptions. The problematic assumptions include: - That the pointer size used for the stack is the same size as the code size pointer, which is also the maximum sized pointer. - That 0 is an invalid, non-dereferencable pointer value. These are problems for AMDGPU because alloca is used to implement the private address space, which uses a 32-bit index as the pointer value. Other pointers are 64-bit and behave more like LLVM's notion of generic address space. By changing the address space used for allocas, we can change our generic pointer type to be LLVM's generic pointer type which does have similar properties. llvm-svn: 299888
* TransformUtils: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-10-131-9/+8
| | | | | | | | | | | Continuing the work from last week to remove implicit ilist iterator conversions. First related commit was probably r249767, with some more motivation in r249925. This edition gets LLVMTransformUtils compiling without the implicit conversions. No functional change intended. llvm-svn: 250142
* [WinEHPrepare] Add rudimentary support for the new EH instructionsDavid Majnemer2015-08-111-1/+1
| | | | | | | | | | | | | | | | | | This adds somewhat basic preparation functionality including: - Formation of funclets via coloring basic blocks. - Cloning of polychromatic blocks to ensure that funclets have unique program counters. - Demotion of values used between different funclets. - Some amount of cleanup once we have removed predecessors from basic blocks. - Verification that we are left with a CFG that makes some amount of sense. N.B. Arguments and numbering still need to be done. Differential Revision: http://reviews.llvm.org/D11750 llvm-svn: 244558
* Revert accidentally committed WinEHPrepare changesDavid Majnemer2015-08-061-1/+1
| | | | | | This reverts commit r244272, r244273, r244274, and r244275. llvm-svn: 244278
* Handle PHI nodes prefacing EH pads tooDavid Majnemer2015-08-061-1/+1
| | | | llvm-svn: 244274
* Drive-by fixes for LandingPad -> EHPadDavid Majnemer2015-08-041-1/+1
| | | | | | | | This change was done as an audit and is by inspection. The new EH system is still very much a work in progress. NFC for the landingpad case. llvm-svn: 243965
* Fix a bug in DemoteRegToStack where a reload instruction was inserted into theAkira Hatanaka2015-02-091-18/+16
| | | | | | | | | | | | | | | | | | wrong basic block. This would happen when the result of an invoke was used by a phi instruction in the invoke's normal destination block. An instruction to reload the invoke's value would get inserted before the critical edge was split and a new basic block (which is the correct insertion point for the reload) was created. This commit fixes the bug by splitting the critical edge before all the reload instructions are inserted. Also, hoist up the code which computes the insertion point to the only place that need that computation. rdar://problem/15978721 llvm-svn: 228566
* [C++] Use 'nullptr'. Transforms edition.Craig Topper2014-04-251-7/+7
| | | | llvm-svn: 207196
* [C++11] Add range based accessors for the Use-Def chain of a Value.Chandler Carruth2014-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires a number of steps. 1) Move value_use_iterator into the Value class as an implementation detail 2) Change it to actually be a *Use* iterator rather than a *User* iterator. 3) Add an adaptor which is a User iterator that always looks through the Use to the User. 4) Wrap these in Value::use_iterator and Value::user_iterator typedefs. 5) Add the range adaptors as Value::uses() and Value::users(). 6) Update *all* of the callers to correctly distinguish between whether they wanted a use_iterator (and to explicitly dig out the User when needed), or a user_iterator which makes the Use itself totally opaque. Because #6 requires churning essentially everything that walked the Use-Def chains, I went ahead and added all of the range adaptors and switched them to range-based loops where appropriate. Also because the renaming requires at least churning every line of code, it didn't make any sense to split these up into multiple commits -- all of which would touch all of the same lies of code. The result is still not quite optimal. The Value::use_iterator is a nice regular iterator, but Value::user_iterator is an iterator over User*s rather than over the User objects themselves. As a consequence, it fits a bit awkwardly into the range-based world and it has the weird extra-dereferencing 'operator->' that so many of our iterators have. I think this could be fixed by providing something which transforms a range of T&s into a range of T*s, but that *can* be separated into another patch, and it isn't yet 100% clear whether this is the right move. However, this change gets us most of the benefit and cleans up a substantial amount of code around Use and User. =] llvm-svn: 203364
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+1
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Reimplement isPotentiallyReachable to make nocapture deduction much stronger.Nick Lewycky2013-07-271-0/+1
| | | | | | | | | | Adds unit tests for it too. Split BasicBlockUtils into an analysis-half and a transforms-half, and put the analysis bits into a new Analysis/CFG.{h,cpp}. Promote isPotentiallyReachable into llvm::isPotentiallyReachable and move it into Analysis/CFG. llvm-svn: 187283
* [SjLj Prepare] When demoting an invoke instructions to the stack, if the normalChad Rosier2013-02-051-5/+15
| | | | | | | edge is critical, then split it so we can insert the store. rdar://13126179 llvm-svn: 174418
* Make sure we don't emit instructions before a landingpad instruction.Bill Wendling2013-01-081-1/+6
| | | | | | PR14782 llvm-svn: 171846
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-3/+3
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-1/+1
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Remove redundant comment. Use a more efficient datatype.Bill Wendling2012-02-171-13/+4
| | | | llvm-svn: 150780
* Fix some grammar-os and formatting.Bill Wendling2012-02-171-21/+17
| | | | llvm-svn: 150779
* Make sure we don't insert instructions before a landingpad instruction.Bill Wendling2011-11-071-2/+2
| | | | | | <rdar://problem/10405911> llvm-svn: 144000
* Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin2010-12-231-1/+1
| | | | | | | new gcc warning that complains on self-assignments and self-initializations. llvm-svn: 122458
* remove trailing whitespaceJim Grosbach2010-06-161-11/+11
| | | | llvm-svn: 106164
* Revert yesterday's change by removing the LLVMContext parameter to ↵Owen Anderson2009-07-151-8/+6
| | | | | | AllocaInst and MallocInst. llvm-svn: 75863
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-141-6/+10
| | | | llvm-svn: 75703
* Fix warning when assertions disabled.Chris Lattner2008-06-211-1/+1
| | | | llvm-svn: 52590
* Delete dead code.Dan Gohman2008-06-191-4/+0
| | | | llvm-svn: 52494
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Reg2Mem cleanup and optimizations:Anton Korobeynikov2007-10-211-12/+26
| | | | | | | - enable phi instructions demotion to stack - create alloca instructions in the entry block llvm-svn: 43208
* Silence warning while compiling with gcc 4.2Anton Korobeynikov2007-09-021-1/+2
| | | | llvm-svn: 41676
* Adding ability to demote phi to stack. Tanya Lattner2007-07-111-0/+38
| | | | llvm-svn: 39744
* Fix DemoteRegToStack on an invoke. This fixes PR634.Chris Lattner2005-10-041-1/+2
| | | | llvm-svn: 23618
* allow demotion to volatile values, add support for invokeChris Lattner2005-09-271-12/+15
| | | | llvm-svn: 23473
* Remove trailing whitespaceMisha Brukman2005-04-211-3/+3
| | | | llvm-svn: 21427
* Fix the missing symbols problem Bill was hitting. Patch contributed byChris Lattner2005-03-171-0/+1
| | | | | | Bill Wendling!! llvm-svn: 20649
* Fix PR310 and TailDup/2004-04-01-DemoteRegToStack.llxChris Lattner2004-04-011-5/+12
| | | | llvm-svn: 12597
* This code was both incredibly complex and incredibly broken. Fix it.Chris Lattner2004-03-161-137/+57
| | | | llvm-svn: 12456
* DemoteRegToStack got moved from DemoteRegToStack.h to Local.hChris Lattner2004-03-141-1/+1
| | | | llvm-svn: 12368
* Finegrainify namespacificationChris Lattner2004-01-091-7/+4
| | | | llvm-svn: 10727
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+4
| | | | llvm-svn: 9903
* Various cleanups and efficiency improvementsChris Lattner2003-11-061-38/+24
| | | | llvm-svn: 9753
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-201-0/+7
| | | | | | Header files will be on the way. llvm-svn: 9298
* CleanupChris Lattner2003-10-151-5/+2
| | | | llvm-svn: 9133
* Minor cleanups, no functional changesChris Lattner2003-09-201-89/+70
| | | | | | Rename Function::getEntryNode -> getEntryBlock llvm-svn: 8623
* Eliminate unnecessary ->get calls that are now automatically handled.Chris Lattner2003-05-291-10/+8
| | | | llvm-svn: 6397
* This file implements the function DemoteRegToStack(), which takes aVikram S. Adve2002-12-101-0/+193
virtual register computed by an Instruction& X and replaces it with a slot in the stack frame, allocated via alloca. llvm-svn: 4964
OpenPOWER on IntegriCloud