History log of /external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
519127f758fc4515adb06d52a4c2c1ae1a968879 16-Jul-2013 Manman Ren <mren@apple.com> PEI: Support for non-zero SPAdj at beginning of a basic block.

We can have a FrameSetup in one basic block and the matching FrameDestroy
in a different basic block when we have struct byval. In that case, SPAdj
is not zero at beginning of the basic block.

Modify PEI to correctly set SPAdj at beginning of each basic block using
DFS traversal. We used to assume SPAdj is 0 at beginning of each basic block.

PEI had an assert SPAdjCount || SPAdj == 0.
If we have a Destroy <n> followed by a Setup <m>, PEI will assert failure.
We can add an extra condition to make sure the pairs are matched:
The pairs start with a FrameSetup.
But since we are doing a much better job in the verifier, this patch removes
the check in PEI.

PR16393


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
da07e9df843015f8c306ed7863dbb8c8055fd85f 12-Jul-2013 Manman Ren <mren@apple.com> PEI: refactor replaceFrameIndices(MF) to call replaceFrameIndices(BB).

replaceFrameIndices(MF) will iterate over the BBs and call
replaceFrameIndices(BB). No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
7271ac2c0318043688ddc8686dd23777dca62c59 05-Jul-2013 Richard Sandiford <rsandifo@linux.vnet.ibm.com> [SystemZ] Clean up register scavenging code

SystemZ wants normal register scavenging slots, as close to the stack or
frame pointer as possible. The only reason it was using custom code was
because PrologEpilogInserter assumed an x86-like layout, where the frame
pointer is at the opposite end of the frame from the stack pointer.
This meant that when frame pointer elimination was disabled,
the slots ended up being as close as possible to the incoming
stack pointer, which is the opposite of what we want on SystemZ.

This patch adds a new knob to say which layout is used and converts
SystemZ to use target-independent scavenging slots. It's one of the pieces
needed to support frame-to-frame MVCs, where two slots might be required.

The ABI requires us to allocate 160 bytes for calls, so one approach
would be to use that area as temporary spill space instead. It would need
some surgery to make sure that the slot isn't live across a call though.

I stuck to the "isFPCloseToIncomingSP - ..." style comment on the
"do what the surrounding code does" principle. The FP case is already
covered by several Systemz/frame-* tests, which fail without the
PrologueEpilogueInserter change, so no new ones are needed.

No behavioural change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f22fd3f7b557a967b1edc1fa9ae770006a39e97c 03-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl instead of SmallVector for iterators and references to avoid specifying the vector size unnecessarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
6d9dbd5526e3161db884fc4fe99c278bb59ccc19 16-Jun-2013 David Blaikie <dblaikie@gmail.com> Debug Info: Simplify Frame Index handling in DBG_VALUE Machine Instructions

Rather than using the full power of target-specific addressing modes in
DBG_VALUEs with Frame Indicies, simply use Frame Index + Offset. This
reduces the complexity of debug info handling down to two
representations of values (reg+offset and frame index+offset) rather
than three or four.

Ideally we could ensure that frame indicies had been eliminated by the
time we reached an assembly or dwarf generation, but I haven't spent the
time to figure out where the FIs are leaking through into that & whether
there's a good place to convert them. Some FI+offset=>reg+offset
conversion is done (see PrologEpilogInserter, for example) which is
necessary for some SelectionDAG assumptions about registers, I believe,
but it might be possible to make this a more thorough conversion &
ensure there are no remaining FIs no matter how instruction selection
is performed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8a0d41e1a649c32e1f0e22c6c201a2e0d8463e30 14-Jun-2013 Derek Schuff <dschuff@google.com> Make PrologEpilogInserter save/restore all callee saved registers
in functions which call __builtin_unwind_init()

__builtin_unwind_init() is an undocumented gcc intrinsic which has this effect,
and is used in libgcc_eh.

Goes part of the way toward fixing PR8541.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c0cc28301a7fa71ae895dd637058e0624f6bd399 08-Jun-2013 Quentin Colombet <qcolombet@apple.com> Reapply r183552. This time, use a standard type for the option to avoid template
instantiation issue with non-standard type.

Add a backend option to warn on a given stack size limit.
Option: -mllvm -warn-stack-size=<limit>
Output (if limit is exceeded):
warning: Stack size limit exceeded (<actual size>) in <functionName>.

The longer term plan is to hook that to a clang warning.
PR:4072
<rdar://problem/13987214>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
95f24fbe4c0609ab30bbdb98c6d5c2155b35a584 08-Jun-2013 Quentin Colombet <qcolombet@apple.com> Revert commits related to stack warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
9a6b9bffa53bfa5e1a8373b31b2ddfa7b6bd7b30 07-Jun-2013 Quentin Colombet <qcolombet@apple.com> Add a backend option to warn on a given stack size limit.
Option: -mllvm -warn-stack-size=<limit>
Output (if limit is exceeded):
warning: Stack size limit exceeded (<actual size>) in <functionName>.

The longer term plan is to hook that to a clang warning.
PR:4072
<rdar://problem/13987214>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
2e80991a7712d51f7637513703fc896f93eea252 06-Apr-2013 Hal Finkel <hfinkel@anl.gov> Reapply r178845 with fix - Fix bug in PEI's virtual-register scavenging

This fixes PEI as previously described, but correctly handles the case where
the instruction defining the virtual register to be scavenged is the first in
the block. Arnold provided me with a bugpoint-reduced test case, but even that
seems too large to use as a regression test. If I'm successful in cleaning it
up then I'll commit that as well.

Original commit message:

This change fixes a bug that I introduced in r178058. After a register is
scavenged using one of the available spills slots the instruction defining the
virtual register needs to be moved to after the spill code. The scavenger has
already processed the defining instruction so that registers killed by that
instruction are available for definition in that same instruction. Unfortunately,
after this, the scavenger needs to iterate through the spill code and then
visit, again, the instruction that defines the now-scavenged register. In order
to avoid confusion, the register scavenger needs the ability to 'back up'
through the spill code so that it can again process the instructions in the
appropriate order. Prior to this fix, once the scavenger reached the
just-moved instruction, it would assert if it killed any registers because,
having already processed the instruction, it believed they were undefined.

Unfortunately, I don't yet have a small test case. Thanks to Pranav Bhandarkar
for diagnosing the problem and testing this fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b6cfeb63f8192724362565567a4cb4aa642baa1d 05-Apr-2013 Hal Finkel <hfinkel@anl.gov> Revert r178845 - Fix bug in PEI's virtual-register scavenging

Reverting because this breaks one of the LTO builders. Original commit message:

This change fixes a bug that I introduced in r178058. After a register is
scavenged using one of the available spills slots the instruction defining the
virtual register needs to be moved to after the spill code. The scavenger has
already processed the defining instruction so that registers killed by that
instruction are available for definition in that same instruction. Unfortunately,
after this, the scavenger needs to iterate through the spill code and then
visit, again, the instruction that defines the now-scavenged register. In order
to avoid confusion, the register scavenger needs the ability to 'back up'
through the spill code so that it can again process the instructions in the
appropriate order. Prior to this fix, once the scavenger reached the
just-moved instruction, it would assert if it killed any registers because,
having already processed the instruction, it believed they were undefined.

Unfortunately, I don't yet have a small test case. Thanks to Pranav Bhandarkar
for diagnosing the problem and testing this fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
afe2f43e4ea0a514413bc742fc03ef5c675ae86a 05-Apr-2013 Hal Finkel <hfinkel@anl.gov> Fix bug in PEI's virtual-register scavenging

This change fixes a bug that I introduced in r178058. After a register is
scavenged using one of the available spills slots the instruction defining the
virtual register needs to be moved to after the spill code. The scavenger has
already processed the defining instruction so that registers killed by that
instruction are available for definition in that same instruction. Unfortunately,
after this, the scavenger needs to iterate through the spill code and then
visit, again, the instruction that defines the now-scavenged register. In order
to avoid confusion, the register scavenger needs the ability to 'back up'
through the spill code so that it can again process the instructions in the
appropriate order. Prior to this fix, once the scavenger reached the
just-moved instruction, it would assert if it killed any registers because,
having already processed the instruction, it believed they were undefined.

Unfortunately, I don't yet have a small test case. Thanks to Pranav Bhandarkar
for diagnosing the problem and testing this fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8846129f6eb58982a2cac22306c8c9b586084475 26-Mar-2013 Hal Finkel <hfinkel@anl.gov> Update PEI's virtual-register-based scavenging to support multiple simultaneous mappings

The previous algorithm could not deal properly with scavenging multiple virtual
registers because it kept only one live virtual -> physical mapping (and
iterated through operands in order). Now we don't maintain a current mapping,
but rather use replaceRegWith to completely remove the virtual register as
soon as the mapping is established.

In order to allow the register scavenger to return a physical register killed
by an instruction for definition by that same instruction, we now call
RS->forward(I) prior to eliminating virtual registers defined in I. This
requires a minor update to forward to ignore virtual registers.

These new features will be tested in forthcoming commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
dc3beb90178fc316f63790812b22201884eaa017 23-Mar-2013 Hal Finkel <hfinkel@anl.gov> Allow the register scavenger to spill multiple registers

This patch lets the register scavenger make use of multiple spill slots in
order to guarantee that it will be able to provide multiple registers
simultaneously.

To support this, the RS's API has changed slightly: setScavengingFrameIndex /
getScavengingFrameIndex have been replaced by addScavengingFrameIndex /
isScavengingFrameIndex / getScavengingFrameIndices.

In forthcoming commits, the PowerPC backend will use this capability in order
to implement the spilling of condition registers, and some special-purpose
registers, without relying on r0 being reserved. In some cases, spilling these
registers requires two GPRs: one for addressing and one to hold the value being
transferred.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177774 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3080d23fde4981835d8a7faf46c152441fadb11f 14-Mar-2013 Hal Finkel <hfinkel@anl.gov> Provide the register scavenger to processFunctionBeforeFrameFinalized

Add the current PEI register scavenger as a parameter to the
processFunctionBeforeFrameFinalized callback.

This change is necessary in order to allow the PowerPC target code to
set the register scavenger frame index after the save-area offset
adjustments performed by processFunctionBeforeFrameFinalized. Only
after these adjustments have been made is it possible to estimate
the size of the stack frame.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
69d37fa6351d5fe2a97ea24a2d0d667a92f14a9c 05-Mar-2013 Bill Wendling <isanbard@gmail.com> Remove unused #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
700ed80d3da5e98e05ceb90e9bfb66058581a6db 21-Feb-2013 Eli Bendersky <eliben@google.com> Move the eliminateCallFramePseudoInstr method from TargetRegisterInfo
to TargetFrameLowering, where it belongs. Incidentally, this allows us
to delete some duplicated (and slightly different!) code in TRI.

There are potentially other layering problems that can be cleaned up
as a result, or in a similar manner.

The refactoring was OK'd by Anton Korobeynikov on llvmdev.

Note: this touches the target interfaces, so out-of-tree targets may
be affected.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
98fbe27ac8f0766ea94b89b8c03418131b72bea4 18-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Support for HiPE-compatible code emission, patch by Yiannis Tsiouris.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5fb7947ed16a57a9c0b71ac70905454d82d25696 01-Feb-2013 Chad Rosier <mcrosier@apple.com> Use a continue to simplify loop and reduce indentation. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3ab115ce8f5262608630d67c28707dbd24361d03 31-Jan-2013 Chad Rosier <mcrosier@apple.com> Add braces, so my head doesn't explode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
108fb3202af6f500073cdbb7be32c25d7a273a2e 31-Jan-2013 Chad Rosier <mcrosier@apple.com> [PEI] Pass the frame index operand number to the eliminateFrameIndex function.
Each target implementation was needlessly recomputing the index.
Part of rdar://13076458

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
0b8c9a80f20772c3793201ab5b251d3520b9cea3 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Move all of the header files which are involved in modelling the LLVM IR
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
831737d329a727f53a1fb0572f7b7a8127208881 30-Dec-2012 Bill Wendling <isanbard@gmail.com> Remove the Function::getFnAttributes method in favor of using the AttributeSet
directly.

This is in preparation for removing the use of the 'Attribute' class as a
collection of attributes. That will shift to the AttributeSet class instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
034b94b17006f51722886b0f2283fb6fb19aca1f 19-Dec-2012 Bill Wendling <isanbard@gmail.com> Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d04a8d4b33ff316ca4cf961e06c9e312eff8e64f 03-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Use the new script to sort the includes of every file under lib.

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. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
984639b7a4b2e2f15d82d64623a634b4772f022f 14-Nov-2012 Chad Rosier <mcrosier@apple.com> Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
9aa6e0a134358c681cc5918ec65b1ec9726b778e 17-Oct-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Merge MRI::isPhysRegOrOverlapUsed() into isPhysRegUsed().

All callers of these functions really want the isPhysRegOrOverlapUsed()
functionality which also checks aliases. For historical reasons, targets
without register aliases were calling isPhysRegUsed() instead.

Change isPhysRegUsed() to also check aliases, and switch all
isPhysRegOrOverlapUsed() callers to isPhysRegUsed().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
6765834754cbb3cb0f15b4b15e98c5e73fa50066 09-Oct-2012 Bill Wendling <isanbard@gmail.com> Create enums for the different attributes.

We use the enums to query whether an Attributes object has that attribute. The
opaque layer is responsible for knowing where that specific attribute is stored.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
2c189061184925c6a8ecbb5a19e648b230a41c0e 26-Sep-2012 Bill Wendling <isanbard@gmail.com> Remove the `hasFnAttr' method from Function.

The hasFnAttr method has been replaced by querying the Attributes explicitly. No
intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
06a23ea8083657270e86a178abf050246caac0b5 30-May-2012 Chad Rosier <mcrosier@apple.com> Remove extra space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
015f228861ef9b337366f92f637d4e8d624bb006 04-Mar-2012 Craig Topper <craig.topper@gmail.com> Use uint16_t to store registers in callee saved register tables to reduce size of static data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
19273aec441411b4d571fdb87c6daa0fbe7a33a0 21-Feb-2012 Andrew Trick <atrick@apple.com> Clear virtual registers after they are no longer referenced.

Passes after RegAlloc should be able to rely on MRI->getNumVirtRegs() == 0.
This makes sharing code for pre/postRA passes more robust.
Now, to check if a pass is running before the RA pipeline begins, use MRI->isSSA().
To check if a pass is running after the RA pipeline ends, use !MRI->getNumVirtRegs().

PEI resets virtual regs when it's done scavenging.

PTX will either have to provide its own PEI pass or assign physregs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
1dd8c8560d45d36a8e507cd014352f1d313f9f9e 08-Feb-2012 Andrew Trick <atrick@apple.com> Codegen pass definition cleanup. No functionality.

Moving toward a uniform style of pass definition to allow easier target configuration.
Globally declare Pass ID.
Globally declare pass initializer.
Use INITIALIZE_PASS consistently.
Add a call to the initializer from CodeGen.cpp.
Remove redundant "createPass" functions and "getPassName" methods.

While cleaning up declarations, cleaned up comments (sorry for large diff).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
25600cf50df79a6e7f8365a3ca7e940592e8ca74 06-Feb-2012 Andrew Trick <atrick@apple.com> Expose TargetPassConfig to PEI Pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a2a98fd0ddd2ae277be7cdd62aae92f6c5155e07 21-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Move common code into an MRI function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5a96b3dad2f634c9081c8b2b6c2575441dc5a2bd 07-Dec-2011 Evan Cheng <evan.cheng@apple.com> Add bundle aware API for querying instruction properties and switch the code
generator to it. For non-bundle instructions, these behave exactly the same
as the MC layer API.

For properties like mayLoad / mayStore, look into the bundle and if any of the
bundled instructions has the property it would return true.
For properties like isPredicable, only return true if *all* of the bundled
instructions have the property.
For properties like canFoldAsLoad, isCompare, conservatively return false for
bundles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8a8d479214745c82ef00f08d4e4f1c173b5f9ce2 02-Dec-2011 Nick Lewycky <nicholas@mxc.ca> Move global variables in TargetMachine into new TargetOptions class. As an API
change, now you need a TargetOptions object to create a TargetMachine. Clang
patch to follow.

One small functionality change in PTX. PTX had commented out the machine
verifier parts in their copy of printAndVerify. That now calls the version in
LLVMTargetMachine. Users of PTX who need verification disabled should rely on
not passing the command-line flag to enable it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b10946a5a938a433ca4d7301b8b5ff5a8c11a7ff 14-Oct-2011 Evan Cheng <evan.cheng@apple.com> A few 80-col violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141988 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
e81abfd30b7c81735e9f3d79006c2653690aa592 31-Aug-2011 Rafael Espindola <rafael.espindola@gmail.com> Spelling and grammar fixes to problems found by Duncan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
76927d758657b3a511c73467ec5a7288795c1513 30-Aug-2011 Rafael Espindola <rafael.espindola@gmail.com> Emit segmented-stack specific code into function prologues for
X86. Modify the pass added in the previous patch to call this new
code.

This new prologues generated will call a libgcc routine (__morestack)
to allocate more stack space from the heap when required

Patch by Sanjoy Das.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c219d191aadb4f9532bcaea5c5e66f66912656ca 04-Aug-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Count the total amount of stack space used in compiled functions.

Patch by Ivan Krasin!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d5b03f252c0db6b49a242abab63d7c5a260fceae 28-Jun-2011 Evan Cheng <evan.cheng@apple.com> Move CallFrameSetupOpcode and CallFrameDestroyOpcode to TargetInstrInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
7a2bdde0a0eebcd2125055e0eacaca040f0b766c 15-Apr-2011 Chris Lattner <sabre@nondot.org> Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
0f657b156f3d0890584bedda7294932a20b2ea16 03-Mar-2011 Jim Grosbach <grosbach@apple.com> Allow a target to choose whether to prefer the scavenger emergency spill slot
be next to the frame pointer or the stack pointer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
16c29b5f285f375be53dabaa73e3e91107485fe4 10-Jan-2011 Anton Korobeynikov <asl@math.spbu.ru> Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs and fixes here and there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c36b7069b42bece963b7e6adf020353ce990ef76 08-Jan-2011 Evan Cheng <evan.cheng@apple.com> Do not model all INLINEASM instructions as having unmodelled side effects.
Instead encode llvm IR level property "HasSideEffects" in an operand (shared
with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check
the operand when the instruction is an INLINEASM.

This allows memory instructions to be moved around INLINEASM instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
94c5ae08750f314bc3cf1bf882b686244a3927d9 28-Nov-2010 Anton Korobeynikov <asl@math.spbu.ru> Move more PEI-related hooks to TFI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
cd775ceff0b25a0b026f643a7990c2924bd310a3 28-Nov-2010 Anton Korobeynikov <asl@math.spbu.ru> Move callee-saved regs spills / reloads to TFI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d0c38176690e9602a93a20a43f1bd084564a8116 18-Nov-2010 Anton Korobeynikov <asl@math.spbu.ru> Move hasFP() and few related hooks to TargetFrameInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119740 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
33464912237efaa0ed7060829e66b59055bdd48b 15-Nov-2010 Anton Korobeynikov <asl@math.spbu.ru> First step of huge frame-related refactoring: move emit{Prologue,Epilogue} out of TargetRegisterInfo to TargetFrameInfo, which is definitely much better suitable place

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
0ed257c0365f1e2227ccd9f42c2ae1f80815d6d2 27-Oct-2010 Jim Grosbach <grosbach@apple.com> Formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c0c7c2b6061e7ca2d528bbedadb1bea0561c9158 18-Oct-2010 Jim Grosbach <grosbach@apple.com> Trivial grammar tweak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
2ab36d350293c77fc8941ce1023e4899df7e3a82 12-Oct-2010 Owen Anderson <resistor@mac.com> Begin adding static dependence information to passes, which will allow us to
perform initialization without static constructors AND without explicit initialization
by the client. For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve. I hope to be able to relax
the latter requirement in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ce665bd2e2b581ab0858d1afe359192bac96b868 08-Oct-2010 Owen Anderson <resistor@mac.com> Now with fewer extraneous semicolons!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
fcb4a8ead3cd8d9540d5eaa448af5d14a0ee341a 27-Aug-2010 Jim Grosbach <grosbach@apple.com> Simplify eliminateFrameIndex() interface back down now that PEI doesn't need
to try to re-use scavenged frame index reference registers. rdar://8277890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112241 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
700f5df518452162de7dda7461917f88e8f4c56e 27-Aug-2010 Jim Grosbach <grosbach@apple.com> Remove the now obsolete frame index virtual re-use algorithm from PEI. Pre-RA
virtual base registers handle this function, and more. A bit more cleanup
to do on the interface to eliminateFrameIndex() after this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c52b3cced8aebbc665021ec6b8bcd0974c4ad7ae 25-Aug-2010 Jim Grosbach <grosbach@apple.com> Add some statistics for PEI register scavenging

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112084 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a273442891ae20fd8192526132e3819ea9e5eda9 24-Aug-2010 Jim Grosbach <grosbach@apple.com> Move enabling the local stack allocation pass into the target where it belongs.
For now it's still a command line option, but the interface to the generic
code doesn't need to know that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5e2475598e0dd73c0ed3c8e065cf0669277c3cab 23-Aug-2010 Jim Grosbach <grosbach@apple.com> Remove the MFI storage of the local allocation block size. It's not needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
67ff81a08319f916571cea90ed92e17015c8584f 23-Aug-2010 Jim Grosbach <grosbach@apple.com> Better handling of local offsets for downwards growing stacks. This corrects
relative offsets when there are offsets encoded in the instructions and
simplifies final allocation in PEI. rdar://8277890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a0fc005321ac163f10ebc5216a85068a496969df 19-Aug-2010 Jim Grosbach <grosbach@apple.com> Update local stack block allocation to let PEI do the allocs if no additional
base registers were required. This will allow for slightly better packing
of the locals when alignment padding is necessary after callee saved registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
dc140c6e7b8350ca51aa1d408c10e25a27826e2c 18-Aug-2010 Jim Grosbach <grosbach@apple.com> Add materialization of virtual base registers for frame indices allocated into
the local block. Resolve references to those indices to a new base register.
For simplification and testing purposes, a new virtual base register is
allocated for each frame index being resolved. The result is truly horrible,
but correct, code that's good for exercising the new code paths.

Next up is adding thumb1 support, which should be very simple. Following that
will be adding base register re-use and implementing a reasonable ARM
heuristic for when a virtual base register should be generated at all.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
fecdea0bf77599038eb368db3bc6a38a14900308 17-Aug-2010 Jim Grosbach <grosbach@apple.com> tidy up. remove unused local.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
4861ed60ac68a543d1b88e631e9fe2c55583b24b 17-Aug-2010 Jim Grosbach <grosbach@apple.com> Better handle alignment requirements for local objects in pre-regalloc frame
mapping. Have the local block track its alignment requirement, and then
apply that when the block itself is allocated. Previously, offsets could
get adjusted in PEI to be different, relative to one another, than the
block allocation thought they would be, which defeats the point of doing
the allocation this way. Continuing rdar://8277890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3d72367d30c9ce6f387764a028763f7a366cc443 14-Aug-2010 Jim Grosbach <grosbach@apple.com> Add a local stack object block allocation pass. This is still an
experimental pass that allocates locals relative to one another before
register allocation and then assigns them to actual stack slots as a block
later in PEI. This will eventually allow targets with limited index offset
range to allocate additional base registers (not just FP and SP) to
more efficiently reference locals, as well as handle situations where
locals cannot be referenced via SP or FP at all (dynamic stack realignment
together with variable sized objects, for example). It's currently
incomplete and almost certainly buggy. Work in progress.

Disabled by default and gated via the -enable-local-stack-alloc command
line option.

rdar://8277890



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5b02901e91a155feca84d7383c1e569aacd1739e 06-Aug-2010 Jim Grosbach <grosbach@apple.com> Cleanup comment wording

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
dfc2c51d12fd53822279b6e564cdd5cef5c00b46 27-Jul-2010 Bill Wendling <isanbard@gmail.com> It's better to have the arrays, which would trigger the creation of stack
protectors, to be near the stack protectors on the stack. Accomplish this by
tagging the stack object with a predicate that indicates that it would trigger
this. In the prolog-epilog inserter, assign these objects to the stack after the
stack protector but before the other objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d13db2c59cc94162d6cf0a04187d408bfef6d4a7 22-Jul-2010 Owen Anderson <resistor@mac.com> Fix batch of converting RegisterPass<> to INTIALIZE_PASS().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ed903d746d96d071305b8182680595ba281b3f12 08-Jul-2010 Jim Grosbach <grosbach@apple.com> Clean up scavengeRegister() a bit to prefer available regs, which allows
the simplification of frame index register scavenging to not have to check
for available registers directly and instead just let scavengeRegister()
handle it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d9642faf7c66273eb3a8d99e5fa6b542da5374dd 08-Jul-2010 Jim Grosbach <grosbach@apple.com> When processing frame index virtual registers, consider all available registers
(if there are any) and use the one which remains available for the longest
rather than just using the first one. This should help enable better re-use
of the loaded frame index values. rdar://7318760



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ed2ae136d29dd36122d2476801e7d7a86e8301e3 03-Jul-2010 Evan Cheng <evan.cheng@apple.com> Remove isSS argument from CreateFixedObject. Fixed objects cannot be spill slots so it's always false.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
6627ac040a14f3a79564fd6ec030f9361f81d20e 02-Jul-2010 Jim Grosbach <grosbach@apple.com> Custom inserters (e.g., conditional moves in Thumb1 can introduce
new basic blocks, and if used as a function argument, that can cause call frame
setup / destroy pairs to be split across a basic block boundary. That prevents
us from doing a simple assertion to check that the pairs match and alloc/
dealloc the same amount of space. Modify the assertion to only check the
amount allocated when there are matching pairs in the same basic block.

rdar://8022442

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f1e309eb4862459a76445942ba4dafc433b6f317 02-Jul-2010 Dale Johannesen <dalej@apple.com> Propagate the AlignStack bit in InlineAsm's to the
PrologEpilog code, and use it to determine whether
the asm forces stack alignment or not. gcc consistently
does not do this for GCC-style asms; Apple gcc inconsistently
sometimes does it for asm blocks. There is no
convenient place to put a bit in either the SDNode or
the MachineInstr form, so I've added an extra operand
to each; unlovely, but it does allow for expansion for
more bits, should we need it. PR 5125. Some
existing testcases are affected.
The operand lists of the SDNode and MachineInstr forms
are indexed with awesome mnemonics, like "2"; I may
fix this someday, but not now. I'm not making it any
worse. If anyone is inspired I think you can find all
the right places from this patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
42d075c4fb21995265961501cec9ff6e3fb497ce 02-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Remove the TargetRegisterClass member from CalleeSavedInfo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ce48c1de828688b34cf5c2038fde23368a0a45f4 02-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Remove uses of getCalleeSavedRegClasses from outside the
backends and removes the virtual declaration. With that out of the way
I should be able to cleanup one backend at a time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
2457f2c66184e978d4ed8fa9e2128effff26cb0b 22-May-2010 Evan Cheng <evan.cheng@apple.com> Implement @llvm.returnaddress. rdar://8015977.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b92187a4103dca24c3767c380f63593d1f6161a7 14-May-2010 Bill Wendling <isanbard@gmail.com> Rename "HasCalls" in MachineFrameInfo to "AdjustsStack" to better describe what
the variable actually tracks.

N.B., several back-ends are using "HasCalls" as being synonymous for something
that adjusts the stack. This isn't 100% correct and should be looked into.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
746ad69e088176819981b4b2c5ac8dcd49f5e60e 06-May-2010 Evan Cheng <evan.cheng@apple.com> Add argument TargetRegisterInfo to loadRegFromStackSlot and storeRegToStackSlot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b4c14aaa50b58ac723d0ed179695e1cd7296572a 04-May-2010 Eric Christopher <echristo@apple.com> Reword a comment slightly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8c5358c93675b009ba2d57c3a5980f6bc58ba536 29-Apr-2010 Dale Johannesen <dalej@apple.com> Make naked functions work on PPC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
9e9aa44d1a33fb845268ba07b726a31f26195690 13-Apr-2010 Dan Gohman <gohman@apple.com> Rename MachineFrameInfo variables to MFI, for consistency with
the rest of CodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a267b0076e7887f5566e635ba35790f24d4524d9 05-Apr-2010 Chris Lattner <sabre@nondot.org> remove the MMI pointer from MachineFrameInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
7c617b5e53987d786451dd668b5113f2e2b983f8 10-Mar-2010 Jim Grosbach <grosbach@apple.com> Clear up the last (famous last words) frame index value reuse issues for Thumb1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
dff4b4c5a7cc894d3b4b6c6e779ea8f47fa50630 09-Mar-2010 Jim Grosbach <grosbach@apple.com> Change the Value argument to eliminateFrameIndex to a type-tagged value. This
is preparatory to having PEI's scavenged frame index value reuse logic
properly distinguish types of frame values (e.g., whether the value is
stack-pointer relative or frame-pointer relative).

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
4642ad3af1cf508ac320b9afd25b065f08b36574 23-Feb-2010 Jim Grosbach <grosbach@apple.com> Updated version of r96634 (which was reverted due to failing 176.gcc and
126.gcc nightly tests. These failures uncovered latent bugs that machine DCE
could remove one half of a stack adjust down/up pair, causing PEI to assert.
This update fixes that, and the tests now pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
1a2e8686f8137a1a2329952ffd1e21969ea1658c 19-Feb-2010 Bob Wilson <bob.wilson@apple.com> Revert 96634. It causes assertion failures for 126.gcc and 176.gcc in
the armv6 nightly tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
cf43e60544041c127bb875fe4cf0d0ae96cd6c78 19-Feb-2010 Jim Grosbach <grosbach@apple.com> Radar 7636153. In the presence of large call frames, it's not sufficient
for ARM to just check if a function has a FP to determine if it's safe
to simplify the stack adjustment pseudo ops prior to eliminating frame
indices. Allow targets to override the default behavior and does so for ARM
and Thumb2.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
7545f49a5edfe19612d03e683d8b955c03018056 13-Feb-2010 Evan Cheng <evan.cheng@apple.com> Teach MachineFrameInfo to track maximum alignment while stack objects are being
created. This ensures it's updated at all time. It means targets which perform
dynamic stack alignment would know whether it is required and whether frame
pointer register cannot be made available register allocation.
This is a fix for rdar://7625239. Sorry, I can't create a reasonably sized test
case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
518bb53485df640d7b7e3f6b0544099020c42aa7 09-Feb-2010 Chris Lattner <sabre@nondot.org> move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h. #include the new TargetOpcodes.h
into MachineInstr. Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the
codebase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a98add69bd53fcaf896e5632e5b4557d09c748df 28-Dec-2009 Bill Wendling <isanbard@gmail.com> Remove dead store.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
817a46454aa22b80069157a2b02717b7edfd9cbb 11-Dec-2009 Anton Korobeynikov <asl@math.spbu.ru> Honour setHasCalls() set from isel.
This is used in some weird cases like general dynamic TLS model.
This fixes PR5723

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
7896c9f436a4eda5ec15e882a7505ba482a2fcd0 03-Dec-2009 Chris Lattner <sabre@nondot.org> improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3f2bf85d14759cc4b28a86805f566ac805a54d00 12-Nov-2009 David Greene <greened@obbligato.org> Add a bool flag to StackObjects telling whether they reference spill
slots. The AsmPrinter will use this information to determine whether to
print a spill/reload comment.

Remove default argument values. It's too easy to pass a wrong argument
value when multiple arguments have default values. Make everything
explicit to trap bugs early.

Update all targets to adhere to the new interfaces..


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f2ce516828ed6b04bad5132a13c8e228d9a0b117 29-Oct-2009 Jim Grosbach <grosbach@apple.com> When the function is doing dynamic stack realignment, the spill slot will be
indexed via the stack pointer, even if a frame pointer is present. Update the
heuristic to place it nearest the stack pointer in that case, rather than
nearest the frame pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85474 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
332553768242e82383df61d9161d1a665bfb3122 21-Oct-2009 Jim Grosbach <grosbach@apple.com> Cleanup of frame index scavenging. Better code flow and more accurately
handles T2 and ARM use cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84761 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
03d02d4faa6cf8ae1337f64bc83dcbd9de570372 20-Oct-2009 Jim Grosbach <grosbach@apple.com> Better handle instructions that re-def a scratch register

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f7a0c0de6d73df8f24438234485b7950323b3d44 20-Oct-2009 Jim Grosbach <grosbach@apple.com> Register re-use for scavenged frame indices must check for re-deginition
of the register in the instruction which kills the scavenged value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
7e831db1d4f5dc51ca6526739cf41e59895c5c20 20-Oct-2009 Jim Grosbach <grosbach@apple.com> Enable post-pass frame index register scavenging for ARM and Thumb2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
491f54f1fd700204db0a19efde0cc2627641d711 17-Oct-2009 Evan Cheng <evan.cheng@apple.com> Distinquish stack slots from other stack objects. They (and fixed objects) get FixedStack PseudoSourceValues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
33524c3b26e3b709488d84094493d9a6098c0155 14-Oct-2009 Jim Grosbach <grosbach@apple.com> Make loop not recalc getNumOperands() each time around

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d0c38327547d6f864bec2e0b88042b1c97b89131 14-Oct-2009 Jim Grosbach <grosbach@apple.com> quiet compiler warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
71c8dc9b20536e89afdae1b82075806761a57c89 09-Oct-2009 Jim Grosbach <grosbach@apple.com> when previous scratch register is killed, flag the value as no longer tracking

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
65c58daa8b8985d2116216043103009815a55e77 08-Oct-2009 Jim Grosbach <grosbach@apple.com> Re-enable register scavenging in Thumb1 by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
e40bf5f9f40a4672cd55bfa51c64a4bb6f4b2f8f 08-Oct-2009 Jim Grosbach <grosbach@apple.com> bugfix. The target may use virtual registers that aren't tracked for re-use but are allocated by the scavenger. The re-use algorithm needs to watch for that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
9f3a559dff691bc1ed85089cb0870cf30a4a2d96 08-Oct-2009 Jim Grosbach <grosbach@apple.com> reverting thumb1 scavenging default due to test failure while I figure out what's up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
bafa3d9f6aaf24d721476ded7b1211ad57dd46c3 08-Oct-2009 Jim Grosbach <grosbach@apple.com> Enable thumb1 register scavenging by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b8452b80f4b24bed1efe0bace9e925c2ec01122e 07-Oct-2009 Jim Grosbach <grosbach@apple.com> grammar

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
391e1704c2e6934bae2ef5df07fc9690c26dbb62 07-Oct-2009 Jim Grosbach <grosbach@apple.com> add initializers for clarity. Add missing assignment of PrevLastUseOp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b58f498f7502e7e1833decbbbb4df771367c7341 07-Oct-2009 Jim Grosbach <grosbach@apple.com> Add register-reuse to frame-index register scavenging. When a target uses
a virtual register to eliminate a frame index, it can return that register
and the constant stored there to PEI to track. When scavenging to allocate
for those registers, PEI then tracks the last-used register and value, and
if it is still available and matches the value for the next index, reuses
the existing value rather and removes the re-materialization instructions.
Fancier tracking and adjustment of scavenger allocations to keep more
values live for longer is possible, but not yet implemented and would likely
be better done via a different, less special-purpose, approach to the
problem.

eliminateFrameIndex() is modified so the target implementations can return
the registers they wish to be tracked for reuse.

ARM Thumb1 implements and utilizes the new mechanism. All other targets are
simply modified to adjust for the changed eliminateFrameIndex() prototype.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
32030fe021ee614df6fdd77a2228e0e265049f3d 30-Sep-2009 Jim Grosbach <grosbach@apple.com> Add additional assert() to verify no extraneous use of a scavenged register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
366e021fb2cb0efb8e727ef5e40bd55cef974c7a 30-Sep-2009 Jim Grosbach <grosbach@apple.com> replace TRI->isVirtualRegister() with TargetRegisterInfo::isVirtualRegister()
per customary usage

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
0a13e566abcfacc3e07f509437060eee294dbfee 30-Sep-2009 Jim Grosbach <grosbach@apple.com> fix compiler warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
9a0b6e6ded68db772631c2938c7a07905e28144f 29-Sep-2009 Jim Grosbach <grosbach@apple.com> Simplify the tracking of virtual frame index registers. Ranges cannot overlap,
so a simple "current register" will suffice. Also add some additional
sanity-checking assertions to make sure things are as we expect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8ff95de83cbe85d939535d2f4fb5f9b2b721081a 27-Sep-2009 Tilmann Scheller <tilmann.scheller@googlemail.com> Use explicit structs instead of std::pair to map callee saved regs to spill slots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
0035f9c3b9982eeef098b608fceb7572df969b3e 25-Sep-2009 Bob Wilson <bob.wilson@apple.com> pr4926: ARM requires the stack pointer to be aligned, even for leaf functions.
For the AAPCS ABI, SP must always be 4-byte aligned, and at any "public
interface" it must be 8-byte aligned. For the older ARM APCS ABI, the stack
alignment is just always 4 bytes. For X86, we currently align SP at
entry to a function (e.g., to 16 bytes for Darwin), but no stack alignment
is needed at other times, such as for a leaf function.

After discussing this with Dan, I decided to go with the approach of adding
a new "TransientStackAlignment" field to TargetFrameInfo. This value
specifies the stack alignment that must be maintained even in between calls.
It defaults to 1 except for ARM, where it is 4. (Some other targets may
also want to set this if they have similar stack requirements. It's not
currently required for PPC because it sets targetHandlesStackFrameRounding
and handles the alignment in target-specific code.) The existing StackAlignment
value specifies the alignment upon entry to a function, which is how we've
been using it anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3d6cb88a64fe67064de206405951eb326d86fc0c 25-Sep-2009 Jim Grosbach <grosbach@apple.com> Start of revamping the register scavenging in PEI. ARM Thumb1 is the driving
interest for this, as it currently reserves a register rather than using
the scavenger for matierializing constants as needed.

Instead of scavenging registers on the fly while eliminating frame indices,
new virtual registers are created, and then a scavenged collectively in a
post-pass over the function. This isolates the bits that need to interact
with the scavenger, and sets the stage for more intelligent use, and reuse,
of scavenged registers.

For the time being, this is disabled by default. Once the bugs are worked out,
the current scavenging calls in replaceFrameIndices() will be removed and
the post-pass scavenging will be the default. Until then,
-enable-frame-index-scavenging enables the new code. Currently, only the
Thumb1 back end is set up to use it.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c34666ee1871d47dfa4865c7138902dd1b770101 24-Sep-2009 Bob Wilson <bob.wilson@apple.com> Fix a hypothetical problem for targets with StackGrowsUp and a non-zero
LocalAreaOffset. (We don't have any of those right now.)
PEI::calculateFrameObjectOffsets includes the absolute value of the
LocalAreaOffset in the cumulative offset value used to calculate the
stack frame size. It then adds the raw value of the LocalAreaOffset
to the stack size. For a StackGrowsDown target, that raw value is negative
and has the effect of cancelling out the absolute value that was added
earlier, but that obviously won't work for a StackGrowsUp target. Change
to subtract the absolute value of the LocalAreaOffset.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
94188d4e67cf1c570ad87dbabf198931033d628e 23-Sep-2009 Bob Wilson <bob.wilson@apple.com> Edit a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
e31e4e51a9305b623eec819ceb6b71f20b259864 18-Sep-2009 Bob Wilson <bob.wilson@apple.com> Fix a comment typo and some whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
24f20e083280d979e8fa1bc88959ae9e8339ee99 22-Aug-2009 Devang Patel <dpatel@apple.com> Record variable debug info at ISel time directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d62c9a697b53f9e754926a89126fd121220ed09b 15-Aug-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't setCalleeSavedInfoValid() until spills are interted.

In a naked function, the flag is never set and getPristineRegs() returns an
empty list. That means naked functions are able to clobber callee saved
registers, but that is the whole point of naked functions.

This fixes PR4716.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
4a0f08c5fc14d840e4e411fade036f1cd815b795 13-Aug-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Add MachineFrameInfo::getPristineRegisters(MBB) method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
845012e6d31799c7fbd1193fa1af8ee2d12e9231 01-Aug-2009 Dan Gohman <gohman@apple.com> Use setPreservesAll and setPreservesCFG in CodeGen passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77754 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ad2afc2a421a0e41603d5eee412d4d8c77e9bc1c 31-Jul-2009 Dan Gohman <gohman@apple.com> Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsage
shouldn't do AU.setPreservesCFG(), because even though CodeGen passes
don't modify the LLVM IR CFG, they may modify the MachineFunction CFG,
and passes like MachineLoop are registered with isCFGOnly set to true.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c5b19b21d84814d19692a6bbea11fbd135f4b094 31-Jul-2009 Daniel Dunbar <daniel@zuster.org> Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and many
failures when building assorted projects with clang.

--- Reverse-merging r77654 into '.':
U include/llvm/CodeGen/Passes.h
U include/llvm/CodeGen/MachineFunctionPass.h
U include/llvm/CodeGen/MachineFunction.h
U include/llvm/CodeGen/LazyLiveness.h
U include/llvm/CodeGen/SelectionDAGISel.h
D include/llvm/CodeGen/MachineFunctionAnalysis.h
U include/llvm/Function.h
U lib/Target/CellSPU/SPUISelDAGToDAG.cpp
U lib/Target/PowerPC/PPCISelDAGToDAG.cpp
U lib/CodeGen/LLVMTargetMachine.cpp
U lib/CodeGen/MachineVerifier.cpp
U lib/CodeGen/MachineFunction.cpp
U lib/CodeGen/PrologEpilogInserter.cpp
U lib/CodeGen/MachineLoopInfo.cpp
U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
D lib/CodeGen/MachineFunctionAnalysis.cpp
D lib/CodeGen/MachineFunctionPass.cpp
U lib/CodeGen/LiveVariables.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
933c762371fe8cc6e2ef5d00d6866f4924852fed 31-Jul-2009 Dan Gohman <gohman@apple.com> Manage MachineFunctions with an analysis Pass instead of the Annotable
mechanism. To support this, make MachineFunctionPass a little more
complete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c5ec8a78ea898087ad361e5b755f74a76150e5fd 17-Jul-2009 Anton Korobeynikov <asl@math.spbu.ru> Add support for naked functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
423ccfe51daa699a969cd716ce3a69cb2ada6234 17-Jul-2009 Dale Johannesen <dalej@apple.com> Assume an inline asm might be a call, so we get
stack alignment right when it is. This is not
ideal but conservatively correct. Adjust a test
to compensate for changed stack offset value.
gcc.apple/asm-block-57.c



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
33b350bf24be396a127c81af045468765731afc7 16-Jul-2009 Anton Korobeynikov <asl@math.spbu.ru> Scan for presence of calls and determine max callframe size early. To allow ProcessFunctionBeforeCalleeSaveScan() use this information

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
910139f9ca53fc20a680d51ae61bb1e072095141 09-Jul-2009 Evan Cheng <evan.cheng@apple.com> Targets sometimes assign fixed stack object to spill certain callee-saved
registers based on dynamic conditions. For example, X86 EBP/RBP, when used as
frame register has to be spilled in the first fixed object. It should inform
PEI this so it doesn't get allocated another stack object. Also, it should not
be spilled as other callee-saved registers but rather its spilling and restoring
are being handled by emitPrologue and emitEpilogue. Avoid spilling it twice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
058a024eb7265239d527680b0a448cdb48102a46 08-Jul-2009 Bill Wendling <isanbard@gmail.com> Use interators instead of counters for loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
2afb3b7251dbcfadef7a8126e9516bde78fc13bb 14-May-2009 Jim Grosbach <grosbach@apple.com> Removing the HasBuiltinSetjmp flag and associated bits. Flagging the presence
of exception handling builtin sjlj targets in functions turns out not to
be necessary. Marking the intrinsic implementation in the .td file as
defining all registers is sufficient to get the context saved properly by
the containing function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
752c1df73949438ef6fa86a86363ee7091aa2532 13-May-2009 John Mosby <ojomojo@gmail.com> PEI: rename PEI.h to PrologEpilogInserter.h to adhere to file naming standard

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
0e0da734bbdfa1d3f55cd04db31d83b97e4556f7 13-May-2009 Jim Grosbach <grosbach@apple.com> Add support for GCC compatible builtin setjmp and longjmp intrinsics. This is
a supporting preliminary patch for GCC-compatible SjLJ exception handling. Note that these intrinsics are not designed to be invoked directly by the user, but
rather used by the front-end as target hooks for exception handling.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
378553cb079aba2b8dee5d52b5166316d4132d5a 12-May-2009 John Mosby <ojomojo@gmail.com> Restructure PEI code:

- moved shrink wrapping code from PrologEpilogInserter.cpp to
new file ShrinkWrapping.cpp.

- moved PEI pass definition into new shared header PEI.h.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
fb3bd472a1a987a97754137914016dbd78c7d5c7 11-May-2009 Evan Cheng <evan.cheng@apple.com> Apply patch review feedback.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71472 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
6afd198fd8bb3b1985182ea990a3b98f50ef7b79 11-May-2009 Evan Cheng <evan.cheng@apple.com> Unbreak non-debug build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b9cfbd94abb23ec8646b9b10aa4ac3d1cbf4461e 11-May-2009 John Mosby <ojomojo@gmail.com> Shrink wrapping in PEI:
- reduces _static_ callee saved register spills
and restores similar to Chow's original algorithm.
- iterative implementation with simple heuristic
limits to mitigate compile time impact.
- handles placing spills/restores for multi-entry,
multi-exit regions in the Machine CFG without
splitting edges.
- passes test-suite in LLCBETA mode.

Added contains() method to ADT/SparseBitVector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ea4d351fc690bd6558fe9ca61db88ee809f0572f 27-Mar-2009 John Mosby <ojomojo@gmail.com> Shrink wrapping in PEI: initial release. Finishing development, enable with --shrink-wrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
78a5bd5dbd4d99d916c69d89ceaabd83c0e52469 24-Mar-2009 Evan Cheng <evan.cheng@apple.com> Fix PR3845: Avoid stale MachineInstruction pointer reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8fc2d0ee8dd4e077ee90a1fcc36fd0101c2947a2 20-Mar-2009 Chris Lattner <sabre@nondot.org> Apply the patch requested in PR3846.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5e6345bde0f3a6405ec1ea852f1e5e5df8642f9c 19-Mar-2009 Chris Lattner <sabre@nondot.org> Fix PEI to not walk off the start of a block when an updated instruction
is the first in its block. This is PR3842.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
1465d61bdd36cfd6021036a527895f0dd358e97d 28-Jan-2009 Duncan Sands <baldrick@free.fr> Rename getAnalysisToUpdate to getAnalysisIfAvailable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
cab3e68136b20a10cb0fe8ad97874bacf27dda7d 07-Nov-2008 Bill Wendling <isanbard@gmail.com> Refactor code that adjusts the offsets of stack objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
44cf38c01ff610139d2e8dbbdc4e6123a3debcdd 06-Nov-2008 Bill Wendling <isanbard@gmail.com> Don't recalculate the stack position of the stack protector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
4c3a1d8d2be313f1b322f680801fec262a2480c6 06-Nov-2008 Bill Wendling <isanbard@gmail.com> - Rename stackprotector_{prologue,epilogue} to stackprotector_{create,check}.
- Get rid of "HasStackProtector" in MachineFrameInfo.
- Modify intrinsics to tell which are doing what with memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b2a4298ce41e7ef80cd75a3c1dfa6433f0759a1a 06-Nov-2008 Bill Wendling <isanbard@gmail.com> Implement the stack protector stack accesses via intrinsics:

- stackprotector_prologue creates a stack object and stores the guard there.

- stackprotector_epilogue reads the stack guard from the stack position created
by stackprotector_prologue.

- The PrologEpilogInserter was changed to make sure that the stack guard is
first on the stack frame.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f7c094000f4baf094b1d60ba68a5b4e0193c502a 31-Oct-2008 Bill Wendling <isanbard@gmail.com> Revert r58489. It isn't correct for all cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f6a9988ceab0ca660fa4f4e89d8d683f487118eb 31-Oct-2008 Bill Wendling <isanbard@gmail.com> Don't skip over all "terminator" instructions when determining where to put the
callee-saved restore code. It could skip over conditional jumps
accidentally. Instead, just skip the "return" instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d735b8019b0f297d7c14b55adcd887af24d8e602 03-Oct-2008 Dan Gohman <gohman@apple.com> Switch the MachineOperand accessors back to the short names like
isReg, etc., from isRegister, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8b56a90bec639665fc024896d2fc2bdd095c76a3 23-Sep-2008 Evan Cheng <evan.cheng@apple.com> Instead of setPreservesAll, just mark them preseving machine loop info and machine dominators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
bbeeb2a61ea19fbb5449260165b56c40fdc4860b 22-Sep-2008 Evan Cheng <evan.cheng@apple.com> Mark several codegen passes as preserving all analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ae73dc1448d25b02cabc7c64c86c64371453dda8 04-Sep-2008 Dan Gohman <gohman@apple.com> Tidy up several unbeseeming casts from pointer to intptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c0d6012b31afa2220306afa27db1b02e18427776 16-Jul-2008 Dan Gohman <gohman@apple.com> Fix a comment to say nonnegative instead of positive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
edec8d89dfaebd7050df4acafe3d01fa755ffd0d 30-Jun-2008 Dale Johannesen <dalej@apple.com> No need to align the stack if there are no stack
objects. Fixes a couple of tests on Linux.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b5dae003252d8e650a32bfdf33cba5aed8e41e40 26-Jun-2008 Dale Johannesen <dalej@apple.com> Fixes the last x86-64 test failure in compat.exp:
<16 x float> is 64-byte aligned (for some reason),
which gets us into the stack realignment code. The
computation changing FP-relative offsets to SP-relative
was broken, assiging a spill temp to a location
also used for parameter passing. This
fixes it by rounding up the stack frame to a multiple
of the largest alignment (I concluded it wasn't fixable
without doing this, but I'm not very sure.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a8c63f0fc9feb48f17d702a907f065959c41e337 03-Jun-2008 Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Fixed bug in bad behavior in calculateFrameObjectOffsets,
the solution commited is different from the previous patch to
avoid int and unsigned comparison


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
aadc780a56820c263dca141b2b9f9e39355f6991 23-Apr-2008 Anton Korobeynikov <asl@math.spbu.ru> Use precomputed value, if any


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
874384e20f618d6ac932628db64e048757213fcd 23-Apr-2008 Anton Korobeynikov <asl@math.spbu.ru> Cleanup


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
71a2cb25ebc818383dd0f80475bc166f834e8d99 20-Mar-2008 Chris Lattner <sabre@nondot.org> detabify llvm, patch by Mike Stump!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
405abffd5eb1ad1841491e51943b598c935f309b 04-Mar-2008 Bill Wendling <isanbard@gmail.com> Miscellaneous clean-ups based on Evan's feedback:

- Cleaned up how the prologue-epilogue inserter loops over the instructions.
- Instead of restarting the processing of an instruction if we remove an
implicit kill, just update the end iterator and make sure that the iterator
isn't incremented.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
988a5782d3ce3cddc65d57d6aac7312d33ed59ab 03-Mar-2008 Bill Wendling <isanbard@gmail.com> Multiple instructions can be inserted when eliminating frame indexes. We need
the register scavenger to process all of those new instructions instead of just
the last one inserted.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
be680dcea6858c438c6615326ae1c098ff448ae1 27-Feb-2008 Evan Cheng <evan.cheng@apple.com> Don't track max alignment during stack object allocations since they can be deleted later. Let PEI compute it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d36531249a9a9500e516148e7e72d4c0a7a4d0ee 27-Feb-2008 Evan Cheng <evan.cheng@apple.com> Spiller now remove unused spill slots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
20b76ab3c75fa34cd997444d2d456c2e22d4bfdd 21-Feb-2008 Bill Wendling <isanbard@gmail.com> Adjust the MaxAlignment for the special register scavenging spill slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
6f0d024a534af18d9e60b3ea757376cd8a3a980e 10-Feb-2008 Dan Gohman <gohman@apple.com> Rename MRegisterInfo to TargetRegisterInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a844bdeab31ef04221e7ef59a8467893584cc14d 02-Feb-2008 Evan Cheng <evan.cheng@apple.com> SDIsel processes llvm.dbg.declare by recording the variable debug information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc.
Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes.
For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
1b08bbca5592351a940bcd164bdec724ee954326 01-Feb-2008 Evan Cheng <evan.cheng@apple.com> Remove the nasty LABEL hack with a much less evil one. Now llvm.dbg.func.start implies a stoppoint is set. SelectionDAGISel records a new source line but does not create a ISD::LABEL node for this special stoppoint. Asm printer will magically print this label. This ensures nothing is emitted before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
bb81d97feb396a8bb21d074db1c57e9f66525f40 31-Jan-2008 Evan Cheng <evan.cheng@apple.com> Add an extra operand to LABEL nodes which distinguishes between debug, EH, or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
00dff8dda29b5a249cd99405ce26e84cef13ba53 31-Jan-2008 Evan Cheng <evan.cheng@apple.com> Also avoid adding callee save code before debug labels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
749c6f6b5ed301c84aac562e414486549d7b98eb 07-Jan-2008 Chris Lattner <sabre@nondot.org> rename TargetInstrDescriptor -> TargetInstrDesc.
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
349c4952009525b27383e2120a6b3c998f39bd09 07-Jan-2008 Chris Lattner <sabre@nondot.org> Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptor


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
69244300b8a0112efb44b6273ecea4ca6264b8cf 07-Jan-2008 Chris Lattner <sabre@nondot.org> Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
that it is cheap and efficient to get.

Move a variety of predicates from TargetInstrInfo into
TargetInstrDescriptor, which makes it much easier to query a predicate
when you don't have TII around. Now you can use MI->getDesc()->isBranch()
instead of going through TII, and this is much more efficient anyway. Not
all of the predicates have been moved over yet.

Update old code that used MI->getInstrDescriptor()->Flags to use the
new predicates in many places.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
920595a960fbebbf614dd159d54fc2e7ea279c22 06-Jan-2008 Duncan Sands <baldrick@free.fr> Remove an unused variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a393cd3306b865e8e5d82dc4e6cfabcdf5d8dc44 05-Jan-2008 Owen Anderson <resistor@mac.com> I should not be allowed to commit when sleepy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f6372aa1cc568df19da7c5023e83c75aa9404a07 01-Jan-2008 Owen Anderson <resistor@mac.com> Move some more instruction creation methods from RegisterInfo into InstrInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
84bc5427d6883f73cfeae3da640acd011d35c006 31-Dec-2007 Chris Lattner <sabre@nondot.org> Rename SSARegMap -> MachineRegisterInfo in keeping with the idea
that "machine" classes are used to represent the current state of
the code being compiled. Given this expanded name, we can start
moving other stuff into it. For now, move the UsedPhysRegs and
LiveIn/LoveOuts vectors from MachineFunction into it.

Update all the clients to match.

This also reduces some needless #includes, such as MachineModuleInfo
from MachineFunction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
9e3304900ff69c4920fea7369c9c36916c4a6a6a 30-Dec-2007 Chris Lattner <sabre@nondot.org> MachineOperand::getImmedValue -> MachineOperand::getImm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
4ee451de366474b9c228b4e5fa573795a715216d 29-Dec-2007 Chris Lattner <sabre@nondot.org> Remove attribution from file headers, per discussion on llvmdev.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d64b5c82b97ad1b74eb9fd2f23257a7899b0c307 05-Dec-2007 Evan Cheng <evan.cheng@apple.com> Add a argument to storeRegToStackSlot and storeRegToAddr to specify whether
the stored register is killed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
2365f51ed03afe6993bae962fdc2e5a956a64cd5 14-Jul-2007 Anton Korobeynikov <asl@math.spbu.ru> Long live the exception handling!

This patch fills the last necessary bits to enable exceptions
handling in LLVM. Currently only on x86-32/linux.

In fact, this patch adds necessary intrinsics (and their lowering) which
represent really weird target-specific gcc builtins used inside unwinder.

After corresponding llvm-gcc patch will land (easy) exceptions should be
more or less workable. However, exceptions handling support should not be
thought as 'finished': I expect many small and not so small glitches
everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8d410b69384ae4e178b3b522ef3357290a714de5 31-May-2007 Lauro Ramos Venancio <lauro.venancio@gmail.com> Fix PR1424.
When a function has FP, the register scavenging spill slot offset already
was calculated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
1997473cf72957d0e70322e2fe6fe2ab141c58a6 03-May-2007 Devang Patel <dpatel@apple.com> Drop 'const'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3e15bf33e024b9df9e89351a165acfdb1dde51ed 02-May-2007 Devang Patel <dpatel@apple.com> Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
794fd75c67a2cdc128d67342c6d88a504d186896 01-May-2007 Devang Patel <dpatel@apple.com> Do not use typeinfo to identify pass in pass manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8e3347332120956538a6d882b02719e34b57f0cd 01-May-2007 Evan Cheng <evan.cheng@apple.com> If call frame is not part of stack frame and no dynamic alloc, eliminateFrameIndex() must adjust SP offset with size of call frames.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5c3885ce8e6a3dc69913b50fe6bdc0c89c5432d5 01-May-2007 Evan Cheng <evan.cheng@apple.com> Under normal circumstances, when a frame pointer is not required, we reserve
argument space for call sites in the function immediately on entry to the
current function. This eliminates the need for add/sub sp brackets around call
sites. However, this is not always a good idea. If the "call frame" is large and
the target load / store instructions have small immediate field to encode sp
offset, this can cause poor codegen. In the worst case, this can make it
impossible to scavenge a register if the reserved spill slot is pushed too far
apart from sp / fp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
6c087e5585b227f3c1d8278304c7cfbc7cd4f6e8 26-Apr-2007 Evan Cheng <evan.cheng@apple.com> Match MachineFunction::UsedPhysRegs changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ea84c5ee952c62dd0c703c9852d7a60715e4a435 25-Apr-2007 Chris Lattner <sabre@nondot.org> support for >4G stack frames


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a401b1e1c5eb9563617db8a2477b4c5f8b239521 25-Apr-2007 Chris Lattner <sabre@nondot.org> support > 4G stack objects


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
0ebe9c132c6b9c74b334f0c7503e702b499575d5 09-Apr-2007 Chris Lattner <sabre@nondot.org> Fix a bug introduced with my previous patch, where it didn't correctly handle
instructions which replace themselves when FI's are rewritten (common on ppc).
This fixes CodeGen/PowerPC/2006-10-17-ppc64-alloca.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d2eae62e93fc6e398263a952609b6ea60a204802 09-Apr-2007 Chris Lattner <sabre@nondot.org> Fix CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll and PR1308:
some instructions can have multiple frame indices in them. If this happens,
rewrite all of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
87f8bf65dd869348dd4d2884a417e2e22ae4f981 06-Mar-2007 Evan Cheng <evan.cheng@apple.com> If target decides to create an emergency spill slot, make sure it's closest to SP or frame pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a81a5ab35793a4c46235367d73bf3e7569535a4c 01-Mar-2007 Evan Cheng <evan.cheng@apple.com> Delete register scavenger when done with it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
23322d1427e319089f5098d02cefbc7d8446d746 01-Mar-2007 Evan Cheng <evan.cheng@apple.com> Interface clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
e5876ce21a23aeef913b25ffc09ad3829e6ade1e 28-Feb-2007 Chris Lattner <sabre@nondot.org> add a newline at end of file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
36230cdda48edf6c634f2dcf69f9d78ac5a17377 28-Feb-2007 Evan Cheng <evan.cheng@apple.com> Make requiresRegisterScavenging determination on a per MachineFunction basis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34711 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
37f15a6d488d256d371f6c39ab83837bc9c0772d 28-Feb-2007 Evan Cheng <evan.cheng@apple.com> MRegisterInfo disowns RegScavenger. It's immutable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3f6fd87473c3fc7d2e99a43b17140d70daa7148c 27-Feb-2007 Evan Cheng <evan.cheng@apple.com> Let MRegisterInfo now owns RegScavenger.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ed570dedad945e1fe9a4bfeaa47276d875f1feed 27-Feb-2007 Evan Cheng <evan.cheng@apple.com> forward() should not increment internal iterator. Its client may insert instruction between now and next forward() call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
49dd06461a7e027a6c938f0570297d46f2f34218 23-Feb-2007 Evan Cheng <evan.cheng@apple.com> First potential client of register scavenger.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
44c3b9fdd416c79f4b67cde1aecfced5921efd81 26-Jan-2007 Jim Laskey <jlaskey@mac.com> Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
for debugging and exception handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
02a20291410a6814c657b69901a57103d4861a07 25-Jan-2007 Evan Cheng <evan.cheng@apple.com> Added a MRegisterInfo hook that tells PEI the target is responsible for
rounding the stack frame to a multiple of stack alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
367372a30c36776e31958f0dc38306f32b80aa7c 23-Jan-2007 Evan Cheng <evan.cheng@apple.com> PEI is now responsible for adding MaxCallFrameSize to frame size and align the stack. Each target can further adjust the frame size if necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
70cfa8894443281c77df5d3790e014647d1ccd05 20-Jan-2007 Evan Cheng <evan.cheng@apple.com> Remove an unused variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
57a2306074989dfd6e1c0d9ddd2b5084f664e2a9 20-Jan-2007 Evan Cheng <evan.cheng@apple.com> We not align the final stack slot but instead let the target do so in emitPrologue(). Each target can make adjustments to the stack frame and re-align the stack as it deem appropriate. Do not align it twice which can end up wasting stack space.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ad93d7fda53d92d07a3b3a2087e46de7cd695752 02-Jan-2007 Evan Cheng <evan.cheng@apple.com> - Fixing naming inconsistency: calleesave -> calleesaved.
- Make use of spillCalleeSavedRegisters() and restoreCalleeSavedRegisters().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
7d3223eef2982d7acdfb24facde6605fd9a8b5e8 07-Dec-2006 Evan Cheng <evan.cheng@apple.com> Initialize {Min|Max}CSFrameIndex properly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5feaa9a70716e9181a9b940236bc461f2a75334a 28-Sep-2006 Evan Cheng <evan.cheng@apple.com> TargetRegisterClass specifies the desired spill alignment. However, it cannot be honored if stack alignment is smaller.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c2b4ec37dea2586765a04d74120e1b6197bbd804 28-Sep-2006 Evan Cheng <evan.cheng@apple.com> PEI now place callee save spills closest to the address pointed to by the
incoming stack. This allows X86 backend to use push / pop in epilogue /
prologue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
692d4e0823774730b90e8e2d7bf58119397f0535 27-Sep-2006 Evan Cheng <evan.cheng@apple.com> Rename function. It's determining which callee-save registers to save.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
a4f0b3a084d120cfc5b5bb06f64b222f5cb72740 27-Aug-2006 Chris Lattner <sabre@nondot.org> s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
08ede262a744f99429658fadb43662441bdcb42d 26-Aug-2006 Jim Laskey <jlaskey@mac.com> Tidy up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f3e4f0e615bb2c36c4a9d60bb908e08b76025c75 25-Aug-2006 Jim Laskey <jlaskey@mac.com> Consolidate callee saved register information so that it can me used by debug
information and exception handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f8c68f694c25b1ae8c0e5adb2a19432cb405d232 29-Jun-2006 Chris Lattner <sabre@nondot.org> Shave another 27K off libllvmgcc.dylib with visibility hidden


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c485e55c651fe6240e118e42bdf98effb6d06584 12-May-2006 Chris Lattner <sabre@nondot.org> Remove dead variable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
4188699f80c233a20b6ddc61570a8a8c1804cb85 07-Apr-2006 Jim Laskey <jlaskey@mac.com> Foundation for call frame information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
4672f71ac4d056aa22d6b09838a3eb22a2e384e7 03-Apr-2006 Chris Lattner <sabre@nondot.org> The stack alignment is now computed dynamically, just verify it is correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
cbef8ba5f959b3c4f932005ceef5cf2e0d899f9b 06-Nov-2005 Chris Lattner <sabre@nondot.org> Always compute max align.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ae232e7a1055033436370c0b3aecf054fa44d5e7 06-Nov-2005 Nate Begeman <natebegeman@mac.com> Add the necessary support to the ISel to allow targets to codegen the new
alignment information appropriately. Includes code for PowerPC to support
fixed-size allocas with alignment larger than the stack. Support for
arbitrarily aligned dynamic allocas coming soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8fb040e584606f048b85d87363a52baf5ff9c1c7 30-Sep-2005 Chris Lattner <sabre@nondot.org> now that we have a reg class to spill with, get this info from the regclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
80a4f169b4a8cd160f832fd4a1052e5d9b2c1a92 30-Sep-2005 Chris Lattner <sabre@nondot.org> Now that we have getCalleeSaveRegClasses() info, use it to pass the register
class into the spill/reload methods. Targets can now rely on that argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23556 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
bf9716b9c48d3b0370c715cd79540945f73dc296 30-Sep-2005 Chris Lattner <sabre@nondot.org> Change this code ot pass register classes into the stack slot spiller/reloader
code. PrologEpilogInserter hasn't been updated yet though, so targets cannot
use this info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
dfd58709cc78e841ef4a50ba75d940473031617e 29-Aug-2005 Chris Lattner <sabre@nondot.org> Fix a bug in my previous patch that was using the wrong iterator. This fixes
Olden/bisort among others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ed461e0fafbd0b905cb716df108000bcd6ecf3d4 27-Aug-2005 Chris Lattner <sabre@nondot.org> Make this code safe for when loadRegFromStackSlot inserts multiple instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
4fc997941dde5c11e91a28c9b5b8fa331d053a18 15-May-2005 Chris Lattner <sabre@nondot.org> When inserting callee-save register reloads, make sure to skip over any
terminator instructions before the 'ret' in case the target has a
multi-instruction return sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22041 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
2a82ef317c39ac436f80854c7ddbb06bfddeada1 13-May-2005 Chris Lattner <sabre@nondot.org> Tolerate instrs with extra args


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
edf128a7fa90f2b0b7ee24741a04a7ae1ecd6f7e 22-Apr-2005 Misha Brukman <brukman+llvm@gmail.com> Remove trailing whitespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3563015b0df358cfc4ec310eb0df195015ea54a5 24-Jan-2005 Chris Lattner <sabre@nondot.org> Simplify/speedup the PEI by not having to scan for uses of the callee saved
registers. This information is computed directly by the register allocator
now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
92b9fcea7b3180ed18f379212d14bd5cea7a1954 23-Jan-2005 Chris Lattner <sabre@nondot.org> Speed this up a bit by making ModifiedRegs a vector<char> not vector<bool>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5037a1591070247af4f83316ec479829846cc734 22-Jan-2005 Chris Lattner <sabre@nondot.org> Implicitly defined registers can clobber callee saved registers too!
This fixes the return-address-not-being-saved problem in the Alpha backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3ca6a2c72c9ab8c5df00fc473abcc12f526b9f6a 19-Jan-2005 Chris Lattner <sabre@nondot.org> Add an assertion that would have made more sense to duraid


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
81ab877a0c8fbbdc903762bcc891c50e5bb98204 30-Aug-2004 Nate Begeman <natebegeman@mac.com> Put this change back in after testing from Reid proved its innocence. getSpillSize now returns value in bits


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
bd2efb96005c51f9088701843c5ee9032bd1ca76 27-Aug-2004 Nate Begeman <natebegeman@mac.com> Back out change to divide getSpillSize by 8 until I figure out why it breaks x86, which has register sizes in bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5709998993cade99e4aeda1c9d44a1bdf54aa720 27-Aug-2004 Nate Begeman <natebegeman@mac.com> Register sizes are in bits, not bytes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
7008034c9f5e69af92496308e176752dfc8e4297 21-Aug-2004 Chris Lattner <sabre@nondot.org> Register info alignment is in bits, frame object alignment is (currently) in
bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
fa1face30a1943aa17560f6f6e10bb667b257065 21-Aug-2004 Chris Lattner <sabre@nondot.org> Now that we have per-register spill size/alignment info, remove more uses
of getRegClass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
26eb14ba51c8eccdb3ac69370c6ac859d3be34a4 16-Aug-2004 Chris Lattner <sabre@nondot.org> Stop using CreateStackObject(RegClass*)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
57f1b67c347b9ba1f8a1cdc3a55362d4f2aa8653 15-Aug-2004 Chris Lattner <sabre@nondot.org> These methods no longer take a TargetRegisterClass* operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15774 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8c9b4de5744ea6c4ce8b79e8a55130df268761cd 15-Aug-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Make this compile on gc 3.4.1 (static_cast to non-const type was not
allowed).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5de0f7aa14f15f463cedf6391bc4823e79d342b5 15-Aug-2004 Nate Begeman <natebegeman@mac.com> Elminiate MachineFunction& argument from eliminateFrameIndex


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15736 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c330b68fb7f1cb7f05a60ab4d811bba397538840 12-Aug-2004 Chris Lattner <sabre@nondot.org> Split saveCallerSavedRegisters into two methods for clarity, and add comments.
Add support for targets that must spill certain physregs at certain locations.

Patch contributed by Nate Begeman, slightly hacked by me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
ecf8afdc2065dec1ca739e2b6a96f8e72dc34533 07-Aug-2004 Chris Lattner <sabre@nondot.org> Ok get rid of the REST of the tabs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d555da52f4301f0a221845d5a549848f5ae84577 07-Aug-2004 Chris Lattner <sabre@nondot.org> Death to tabs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
7f7bbc2fdb833485ac3d865a405fd948e58e8ddb 11-Jun-2004 Chris Lattner <sabre@nondot.org> Fix fallout from getOffsetOfLocalArea() being negated. Debugging dumps were being
printed incorrectly, and we were reserving 8 extra bytes of stack space for functions
on X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
577aec14288b86ab1fb07e164375ebc7d3038cb7 10-Jun-2004 Chris Lattner <sabre@nondot.org> Fix the prolog epilog code inserter to match the documentation and support
targets whose stack grows up.

Patch contributed by Vladimir Prus


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
9bcdcd17c7219dbc68de2f11ca2de86471c8c390 02-Jun-2004 Chris Lattner <sabre@nondot.org> Adjust to new TargetMachine interface


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
859a18b5833f3566799313ecba8db4916500485b 15-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Make dense maps keyed on physical registers smallerusing
MRegisterInfo::getNumRegs() instead of
MRegisterInfo::FirstVirtualRegister.

Also use MRegisterInfo::is{Physical,Virtual}Register where
appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
05d8350c12d8d81de1d8af6f7da155bc1c1da50e 15-Feb-2004 Chris Lattner <sabre@nondot.org> Allow for fixed objects to reside in the local area, and if they don't to not
clobber them by allocating other objects in the same space!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
93799292c1c04c53ff077a427737b3ffbd0445ab 14-Feb-2004 Chris Lattner <sabre@nondot.org> There is no reason to align the stack pointer if there are no callees of this function!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
c0b9dc5be79f009d260edb5cd5e1d8346587aaa2 12-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Change MachineBasicBlock's vector of MachineInstr pointers into an
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
1cbe4d0ad0888e50858cca83cf2a0d3083709513 10-Feb-2004 Chris Lattner <sabre@nondot.org> Do not use MachineOperand::isVirtualRegister either!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3d878d80d67452865e286069ceefe918c0f65acb 10-Feb-2004 Chris Lattner <sabre@nondot.org> Eliminate users of MachineOperand::isPhysicalRegister


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
4d7af65903cbc858464362e70a6adf499982ec8a 14-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Change interface of MachineOperand as follows:

a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
b) add isUse(), isDef()
c) rename opHiBits32() to isHiBits32(),
opLoBits32() to isLoBits32(),
opHiBits64() to isHiBits64(),
opLoBits64() to isLoBits64().

This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
d0fde30ce850b78371fd1386338350591f9ff494 11-Nov-2003 Brian Gaeke <gaeke@uiuc.edu> Put all LLVM code into the llvm namespace, as per bug 109.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b576c94c15af9a440f69d9d03c2afead7971118c 20-Oct-2003 John Criswell <criswell@uiuc.edu> Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
73ff5120eb8b8c0ccbfed8a17f1024c67a75f319 08-Oct-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Change MRegisterDesc::AliasSet, TargetInstrDescriptor::ImplicitDefs
and TargetInstrDescriptor::ImplicitUses to always point to a null
terminated array and never be null. So there is no need to check for
pointer validity when iterating over those sets. Code that looked
like:

if (const unsigned* AS = TID.ImplicitDefs) {
for (int i = 0; AS[i]; ++i) {
// use AS[i]
}
}

was changed to:

for (const unsigned* AS = TID.ImplicitDefs; *AS; ++AS) {
// use *AS
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
19df3876e6dce016ec4c5ab28320a246ab285001 13-Aug-2003 Brian Gaeke <gaeke@uiuc.edu> Factory methods for FunctionPasses now return type FunctionPass *.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
5f2180c53330502eb2f0f5bf3f21a838ad800906 27-May-2003 Vikram S. Adve <vadve@cs.uiuc.edu> (1) Added special register class containing (for now) %fsr.
Fixed spilling of %fcc[0-3] which are part of %fsr.

(2) Moved some machine-independent reg-class code to class TargetRegInfo
from SparcReg{Class,}Info.

(3) Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
and related functions and flags. Fixed several bugs where only
"isDef" was being checked, not "isDefAndUse".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
b589bf7d77a57e961a871ae5ffee2381722d8c0f 02-May-2003 Chris Lattner <sabre@nondot.org> Fix a bug which occurred with empty basic blocks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
0416d2a70aea644c3e0c06301c29f3b81ec1e42d 16-Jan-2003 Chris Lattner <sabre@nondot.org> Fix problems with empty basic blocks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f85249ca7336cda5bd491c161cb163847774e868 16-Jan-2003 Chris Lattner <sabre@nondot.org> Arg, fix bugs in previous checkin...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5322 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
78d6db5627bdf41ab3ffd96133821647dbc60d53 16-Jan-2003 Chris Lattner <sabre@nondot.org> Add assertion


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
4ac7d7302b36a5d20f71b5c290c63a7f6c345289 15-Jan-2003 Chris Lattner <sabre@nondot.org> * Insert prolog/epilog code before rewriting indexes
* Fix calculation of frame offsets when there is an offset.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
3501feab811c86c9659248a4875fc31a3165f84d 14-Jan-2003 Chris Lattner <sabre@nondot.org> Rename MachineInstrInfo -> TargetInstrInfo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5272 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
f00a3f905e8cd99ab4d3dbbde1a9d510516e0fa2 13-Jan-2003 Chris Lattner <sabre@nondot.org> Convert to MachineFunctionPass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
eb24db9727a7babe863d5afe70c7bda3a460da18 28-Dec-2002 Chris Lattner <sabre@nondot.org> Rename FunctionFrameInfo to MachineFrameInfo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
8bd66e690779c838db51f55cf0b31d7206b3b659 28-Dec-2002 Chris Lattner <sabre@nondot.org> Rename MachineFrameInfo to TargetFrameInfo.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp
58b3328ac709a5706a8bfa522012ed90f1b4d4bd 28-Dec-2002 Chris Lattner <sabre@nondot.org> Initial checkin of Prolog/Epilog code inserter, which is an important part
of the abstract frame representation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PrologEpilogInserter.cpp