History log of /external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
35e7751af455f2cc559cdc2d3424b53706e09bb3 04-Jun-2013 David Majnemer <david.majnemer@gmail.com> ARM: Fix crash in ARM backend inside of ARMConstantIslandPass

The ARM backend did not expect LDRBi12 to hold a constant pool operand.
Allow for LLVM to deal with the instruction similar to how it deals with
LDRi12.

This fixes PR16215.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c6af2432c802d241c8fffbe0371c023e6c58844e 25-May-2013 Michael J. Spencer <bigcheesegs@gmail.com> Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b300455b5817f099d64aad8f9356e0e23fa9a87e 21-Feb-2013 Evan Cheng <evan.cheng@apple.com> Radar numbers don't belong in source code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.cpp
3574eca1b02600bac4e625297f4ecf745f4c4f32 08-Oct-2012 Micah Villmow <villmow@gmail.com> Move TargetData to DataLayout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88 22-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Reduce duplicated hash map lookups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
70cfaa34645bf8ad232c400f0fe7c48a9d715586 07-Jul-2012 Chad Rosier <mcrosier@apple.com> Fix the naming of ensureAlignment. Per the coding standard function names
should be camel case, and start with a lower case letter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
887d095fb6c6fb0980ab90a9211fb2420d0da7c0 30-Apr-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix address calculation error from r155744.

This was exposed by SingleSource/UnitTests/Vector/constpool.c.

The computed size of a basic block isn't always a multiple of its known
alignment, and that can introduce extra alignment padding after the
block.

<rdar://problem/11347135>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
9b10dae0bf3a796ac06e94f072ac67126e30a255 28-Apr-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix a problem with blocks that need to be split twice.

The code could search past the end of the basic block when there was
already a constant pool entry after the block.

Test case with giant basic block in SingleSource/UnitTests/Vector/constpool.c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
456ff46e668f361f79e8e91f145152089cd7d933 28-Apr-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Track worst case alignment padding more accurately.

Previously, ARMConstantIslandPass would conservatively compute the
address of an aligned basic block as:

RoundUpToAlignment(Offset + UnknownPadding)

This worked fine for the layout algorithm itself, but it could fool the
verify() function because it accounts for alignment padding twice: Once
when adding the worst case UnknownPadding, and again by rounding up the
fictional block offset. This meant that when optimizeThumb2Instructions
would shrink an instruction, the conservative distance estimate could
grow. That shouldn't be possible since the woorst case alignment padding
wss already included.

This patch drops the use of RoundUpToAlignment, and depends only on
worst case padding to compute conservative block offsets. This has the
weird effect that the computed offset for an aligned block may not be
aligned.

The important difference is that shrinking an instruction can never
cause the estimated distance between two instructions to grow. The
estimated distance is always larger than the real distance that only the
assembler knows.

<rdar://problem/11339352>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
3ee3661f8f10e7f82094a89c40d9118630ab0a40 31-Mar-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Add a 2 byte safety margin in offset computations.

ARMConstantIslandPass still has bugs where jump table compression can
cause constant pool entries to go out of range.

Add a safety margin of 2 bytes when placing constant islands, but use
the real max displacement for verification.

<rdar://problem/11156595>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
101c03a8c9042781b6c9ba1fcc366e14fc8534ce 31-Mar-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Add more debugging output to ARMConstantIslandPass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
7a4c071cd9f67599eba21e902079d0e85f2abf97 30-Mar-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Invalidate liveness in ARMConstantIslandPass.

This pass splits basic blocks to insert constant islands, and it
doesn't recompute the live-in lists. No later passes depend on accurate
liveness information.

This fixes PR12410 where the machine code verifier was complaining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c89c744b69cecac576317a98322fd295e36e9886 27-Mar-2012 Craig Topper <craig.topper@gmail.com> Remove unnecessary llvm:: qualifications

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
acf2077ca497980a066e8e7bb81ceec0de82d5da 26-Mar-2012 Craig Topper <craig.topper@gmail.com> Replace uses of ARMBaseInstrInfo and ARMTargetMachine with the Base versions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
7a465250564d2ae0cc53ebe58732a751daa43e8d 24-Mar-2012 Jim Grosbach <grosbach@apple.com> ARM tidy up ARMConstantIsland.cpp.

No functional change, just tidy up the code and nomenclature a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
0c3cfefca62eeaf1f98a49756e3bcb2c451b3374 31-Jan-2012 Jim Grosbach <grosbach@apple.com> Refactor loop for better readability.

Excellent suggestion from Ben Kramer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c73f42b54028e0fce3e7159b76cd59e78107023d 31-Jan-2012 Jim Grosbach <grosbach@apple.com> Add explanatory comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
4d6ccb5f68cd7c6418a209f1fa4dbade569e4493 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
bfe8afaaec03795fe6c78daa9817e54c186a699d 14-Jan-2012 Evan Cheng <evan.cheng@apple.com> After r147827 and r147902, it's now possible for unallocatable registers to be
live across BBs before register allocation. This miscompiled 197.parser
when a cmp + b are optimized to a cbnz instruction even though the CPSR def
is live-in a successor.
cbnz r6, LBB89_12
...
LBB89_12:
ble LBB89_1

The fix consists of two parts. 1) Teach LiveVariables that some unallocatable
registers might be liveouts so don't mark their last use as kill if they are.
2) ARM constantpool island pass shouldn't form cbz / cbnz if the conditional
branch does not kill CPSR.

rdar://10676853


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
19d0bf3a9273d337b776ca33c284fd2b5da485ab 10-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Consider unknown alignment caused by OptimizeThumb2Instructions().

This function runs after all constant islands have been placed, and may
shrink some instructions to their 2-byte forms. This can actually cause
some constant pool entries to move out of range because of growing
alignment padding.

Treat instructions that may be shrunk the same as inline asm - they
erode the known alignment bits.

Also reinstate an old assertion in verify(). It is correct now that
basic block offsets include alignments.

Add a single large test case that will hopefully exercise many parts of
the constant island pass.

<rdar://problem/10670199>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
dae412bd320f1522bd1d850be0276212fca0331f 10-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Accurately model hardware alignment rounding.

On Thumb, the displacement computation hardware uses the address of the
current instruction rouned down to a multiple of 4. Include this
rounding in the UserOffset we compute for each instruction.

When inline asm is present, the instruction alignment may not be known.
Constrain the maximum displacement instead in that case.

This makes it possible for CreateNewWater() and OffsetIsInRange() to
agree about the valid displacements. When they disagree, infinite
looping happens.

As always, test cases for this stuff are insane.

<rdar://problem/10660175>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147825 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
169db15717e77f2893d1868ef934ce42c2e9e956 09-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Catch runaway ARMConstantIslandPass even in -Asserts builds.

The pass is prone to looping, and it is better to crash than loop
forever, even in a -Asserts build.

<rdar://problem/10660175>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
59ecaae7b61ef0023ed1db4643937f7a57f61d10 06-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Abort AdjustBBOffsetsAfter early when possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b076fb7762498289718dbe4cb5de03e6e93bd4e7 17-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix off-by-one error in bucket sort.

The bad sorting caused a misaligned basic block when building 176.vpr in
ARM mode.

<rdar://problem/10594653>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
f9aabb8f32d61d19f57fb4710c06d01a12fedce7 16-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't adjust for alignment padding in OffsetIsInRange.

This adjustment is already included in the block offsets computed by
BasicBlockInfo, and adjusting again here can cause the pass to loop.

When CreateNewWater splits a basic block, OffsetIsInRange would reject
the new CPE on the next pass because of the too conservative alignment
adjustment. This caused the block to be split again, and so on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
f5bb45f89564129fcaca25b9dd84750ffc02beed 16-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Note ARM constant island alignment in the release notes.

The command line option should be removed, but not until the feature has
gotten a lot of testing. The ARMConstantIslandPass tends to have subtle
bugs that only show up after a while.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b6ff6ec85e589b8ad3bede4533dc71a09655bb1e 15-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Enable proper constant island alignment by default.

The code size increase is tiny (< 0.05%) because so little code uses
16-byte constant pool entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
299b059cd675f1e5beac1a2383a44e062e2eef43 15-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Consider CPE alignment in CreateNewWater().

An aligned constant pool entry may require extra alignment padding where
the new water is created. Take that into account when computing offset.

Also consider the alignment of other constant pool entries when
splitting a basic block. Alignment padding may make it necessary to
move the split point higher.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
5e46dcbb4b6f6e82f7bb88490800ed09ac02f105 14-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix speling and 80-col.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
2e29024d2e3aa23a1ec049c30dbce903e57d5f9b 13-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Account for CPE alignment when searching for new water.

Constant pool entries with different alignment may cause more alignment
padding to be inserted. Compute the amount of padding needed, and try to
pick the location that requires the least amount of padding.

Also take the extra padding into account when the water is above the
use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
8552821e578d693ec14007b21e9468010485ae76 12-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add a postOffset() alignment argument.

This computes the offset of the layout sucessor block, considering its
alignment as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
bd1ec17caf8fc393b112e6c01fe0e9cd7db213ae 12-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
cca33a3f24106cfdb6cb892b76efc76f1ad91806 12-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Also set the proper alignment on inner islands and the function itself.

Downgrade the alignment of the initial constant island when constant
pool entries are moved elsewhere.

This is all gated by -arm-align-constant-islands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
dbf350a5a8f5fb5321a4e11e381f0023fbe61d15 12-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Make MF a class member instead of passing it around everywhere.

Also add an MCP member pointing to the machine constant pool.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b813f924a749396ffb4a4bd087ee1dbb678551f3 12-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add a -arm-align-constant-islands flag, default off.

Order constant pool entries by descending alignment in the initial
island to ensure packing and correct alignment. When the command line
flag is set, also align the basic block containing the constant pool
entries.

This is only a partial implementation of constant island alignment. More
to come.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
77caaf0fc000a1e2e2afe949b6205ea5db668be9 10-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Try to align the point where a large basic block is split.

The split point is picked such that the newly created water has the same
alignment as the function. This makes the island suitable for constant
pool entries with potentially higher alignment.

This also fixes an issue where the basic block was split one instruction
too late, causing nonconvergence of the algorithm.

<rdar://problem/10550705>

There is still an issue with correctly packing differently aligned
entries in the island.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
2d5023bbcf816de39e37d9fea6dfa8f7aadb393f 10-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> More debug output formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146313 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
493ad6b95d153763b4b4fec456918f6c0d72d1ea 09-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> User a helper overload for a common pattern.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
3c4615eef2cb6b1bacb9b5fffe98359f9659f7c2 09-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Tweak debugging output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
e6f9e9d8365346330c782c82860a6b77df8ee829 08-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Drop the HasInlineAsm flag.

It is not used any more. We are tracking inline assembly misalignments
directly through the BBInfo.Unalign and KnownBits fields.

A simple conservative size estimate is not good enough since it can
cause alignment padding to be underestimated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
99486be8bad67f70445df99fd0c07d17eb8b1c05 08-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplify offset verification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
540c6d9d2651310d88eb9a147177ccd52eec7cd5 08-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't include alignment padding in BBInfo.Size.

Compute alignment padding before and after basic blocks dynamically.

Heed basic block alignment.

This simplifies bookkeeping because we don't have to constantly add and
remove padding from BBInfo.Size. It also makes it possible to track the
extra known alignment bits we get after a tBR_JTr terminator and when
entering an aligned basic block.

This makes the ARMConstantIslandPass aware of aligned basic blocks.

It is tricky to model block alignment correctly when dealing with inline
assembly and tBR_JTr instructions that have variable size. If inline
assembly turns out to be smaller than expected, that may cause following
alignment padding to be larger than expected. This could cause constant
pool entries to move out of range.

To avoid that problem, we use the worst case alignment padding following
inline assembly. This may cause slightly suboptimal constant island
placement in aligned basic blocks following inline assembly. Normal
functions should be unaffected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.cpp
2fe71c5ef4b1816993bafeec501e742a7fa69b46 07-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Eliminate delta argument from AdjustBBOffsetsAfter.

The block offset can be computed from the previous block. That is more
robust than keeping track of a delta.

Eliminate one redundant AdjustBBOffsetsAfter call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
a26811ec83d00344a739d84f4b8584e5548b94ce 07-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Compute some alignment information for each basic block.

These fields are not used for anything yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
5bb32530bc1adb970eee2ac18508ea2876a2f410 07-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Move common expression into a method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
a3f331bd81f9d468654635df4428ecc8d8ebb5ea 07-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Group BBSizes and BBOffsets into a single vector<BasicBlockInfo>.

No functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
6fbea43b0b35e2a3f6f91a92edeffa873c5cd794 06-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r145971: "Use conservative size estimate for tBR_JTr."

This caused more offset errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
d25c27807ef6b3d80ffa218b1fa5441fe40d3ce6 06-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Use conservative size estimate for tBR_JTr.

This pseudo-instruction contains a .align directive in its expansion, so
the total size may vary by 2 bytes.

It is too difficult to accurately keep track of this alignment
directive, just use the worst-case size instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
305e5fe797cbba32d8091d687d47e98c8f3ee1f4 06-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove alignment from deserted constant islands.

ARMConstantIslandPass may sometimes leave empty constant islands behind
(it really shouldn't). Remove the alignment from the empty islands so
the size calculations are still correct.

This should fix the many Thumb1 assembler errors in the nightly test
suite.

The reduced test case for this problem is way too big. That is to be
expected for ARMConstantIslandPass bugs.

<rdar://problem/10534709>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
3e572ac2fbdf6aa538500be07b9b050ac008669e 06-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Align ARM constant pool islands via their basic block.

Previously, all ARM::CONSTPOOL_ENTRY instructions had a hardwired
alignment of 4 bytes emitted by ARMAsmPrinter. Now the same alignment
is set on the basic block.

This is in preparation of supporting ARM constant pool islands with
different alignments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
e80fba0e6c976039c132c3d5d4fcad569d2259a8 06-Dec-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Use an existing function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
a0737950233acc271e444b270498d4986b4d2d00 12-Sep-2011 Owen Anderson <resistor@mac.com> There's no need to add additional predicate operands when converting a tB to a tBfar now. Fixes nightly test failures on armv6 Thumb. <rdar://problem/10110404>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
cd4338fff5cc9427003766519bebcfa213b32d61 10-Sep-2011 Owen Anderson <resistor@mac.com> Fix buildbot breakage caused by r139415. I missed one instance of a manually create ARM::tB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
51f6a7abf27fc92c3d8904c2334feab8b498e8e9 09-Sep-2011 Owen Anderson <resistor@mac.com> Thumb unconditional branches are allowed in IT blocks, and therefore should have a predicate operand, unlike conditional branches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
ee04a6d3a40c3017124e3fd89a0db473a2824498 21-Jul-2011 Evan Cheng <evan.cheng@apple.com> Sink ARMMCExpr and ARMAddressingModes into MC layer. First step to separate ARM MC code from target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
0af0dc8ac6d084bb04cf0188e48eecd6c98903ba 18-Jul-2011 Owen Anderson <resistor@mac.com> Re-apply r135319 with a fix for the constant island pass.
Original Log: Get rid of the separate opcodes for the Darwin versions of tBL, tBLXi, and tBLXr, using pseudo-instructions to lower to the single final opcode. Update the ARM disassembler for this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135414 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
25e6d48220330d17875d0ae0ad6a45597d5ac36c 08-Jul-2011 Jim Grosbach <grosbach@apple.com> Make tBX_RET and tBX_RET_vararg predicable.

The normal tBX instruction is predicable, so there's no reason the
pseudos for using it as a return shouldn't be. Gives us some nice code-gen
improvements as can be seen by the test changes. In particular, several
tests now have to disable if-conversion because it works too well and defeats
the test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134746 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
e837dead3c8dc3445ef6a0e2322179c57e264a13 28-Jun-2011 Evan Cheng <evan.cheng@apple.com> - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo and
sink them into MC layer.
- Added MCInstrInfo, which captures the tablegen generated static data. Chang
TargetInstrInfo so it's based off MCInstrInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
0539c159fb6e3f8d09d4790d8d6a4615c26d3e98 02-Apr-2011 Evan Cheng <evan.cheng@apple.com> Avoid de-referencing pass beginning of a basic block. No small test case possible. rdar://9216009

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
ab4c366274a582dd8146b2820c6b999cad5fce36 15-Feb-2011 Duncan Sands <baldrick@free.fr> Spelling fix: consequtive -> consecutive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
971b83b67a9812556cdb97bb58aa96fb37af458d 08-Feb-2011 Owen Anderson <resistor@mac.com> Revert both r121082 (which broke a bunch of constant pool stuff) and r125074 (which worked around it). This should get us back to the old, correct behavior, though it will make the integrated assembler unhappy for the time being.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
75396a998887220074b90f176e29054a35b6c0ed 08-Feb-2011 Evan Cheng <evan.cheng@apple.com> Temporary workaround for a bad bug introduced by r121082 which replaced
t2LDRpci with t2LDRi12.
There are a couple of problems with this.
1. The encoding for the literal and immediate constant are different.
Note bit 7 of the literal case is 'U' so it can be negative.
2. t2LDRi12 is now narrowed to tLDRpci before constant island pass is run.
So we end up never using the Thumb2 instruction, which ends up creating a
lot more constant islands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
98b928ea71576c243bdb203879d966be9cde5f3c 30-Jan-2011 Anton Korobeynikov <asl@math.spbu.ru> Save a mapping between original and cloned constpool entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
5de5d4b6d0eb3fd379fa571d82f6fa764460b3b8 17-Jan-2011 Evan Cheng <evan.cheng@apple.com> Materialize GA addresses with movw + movt pairs for Darwin in PIC mode. e.g.
movw r0, :lower16:(L_foo$non_lazy_ptr-(LPC0_0+4))
movt r0, :upper16:(L_foo$non_lazy_ptr-(LPC0_0+4))
LPC0_0:
add r0, pc, r0

It's not yet enabled by default as some tests are failing. I suspect bugs in
down stream tools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
9a4d2e40a02b6e5fab5ccf1c768a52c76f3aec6a 21-Dec-2010 Bill Wendling <isanbard@gmail.com> Comment cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122302 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
cd080249fc249a51d8b0021a651d8b9d4a4977e0 18-Dec-2010 Bill Wendling <isanbard@gmail.com> RemoveUnusedCPEntries can change things. Track it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
3e333637f172c30adf5c8333b592fbde17ff9f78 16-Dec-2010 Jim Grosbach <grosbach@apple.com> Thumb1 had two patterns for the same load-from-constant-pool instruction.
Canonicalize on tLDRpci and remove tLDRcp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
6b8719fd7dc527e4c1910ae49ebee61d90907c08 13-Dec-2010 Owen Anderson <resistor@mac.com> Revert r121721, which broke buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
e8d02539d7981c07d301d91a6a5b6ad34099b510 13-Dec-2010 Owen Anderson <resistor@mac.com> Make Thumb2 LEA-like instruction into pseudos, which map down to ADR. Provide correct fixups for Thumb2 ADR,
which is _of course_ different from ARM ADR fixups, or any other Thumb2 fixup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
97a884d602538705644e296a57a039959cdb6f6e 07-Dec-2010 Jim Grosbach <grosbach@apple.com> Refactor the ARM CMPz* patterns to just use the normal CMP instructions when
possible. They were duplicates for everything exception the source pattern
before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
eb6779c5b98383e33542207f062102e79263df16 07-Dec-2010 Owen Anderson <resistor@mac.com> Second attempt at converting Thumb2's LDRpci, including updating the gazillion places that need to know about it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
d092a87ba3f905a6801a0bdf816267329cf0391c 29-Nov-2010 Jim Grosbach <grosbach@apple.com> Rename t2 TBB and TBH instructions to reference that they encode the jump table
data. Next up, pseudo-izing them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
3e5561247202bae994dd259a2d8dc4eff8f799f3 27-Oct-2010 Jim Grosbach <grosbach@apple.com> First part of refactoring ARM addrmode2 (load/store) instructions to be more
explicit about the operands. Split out the different variants into separate
instructions. This gives us the ability to, among other things, assign
different scheduling itineraries to the variants. rdar://8477752.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117409 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
d96b02b3d6dfede96b6259f737720cc10330c84b 19-Aug-2010 Eric Christopher <echristo@apple.com> Remove extra header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111456 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
719510a178a910feb1db707140011c32a30992c4 12-Aug-2010 Evan Cheng <evan.cheng@apple.com> Make sure ARM constant island pass does not break up an IT block. If the split point is in the middle of an IT block, it should move it up to just above the IT instruction. rdar://8302637


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
e44be6381609d31b2d8879dbd5107e01404fa475 09-Aug-2010 Evan Cheng <evan.cheng@apple.com> Change -prefer-32bit-thumb to attribute -mattr=+32bit instead to disable more 32-bit to 16-bit optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
90c579de5a383cee278acc3f7e7b9d0a656e6a35 06-Aug-2010 Owen Anderson <resistor@mac.com> Reapply r110396, with fixes to appease the Linux buildbot gods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
1f74590e9d1b9cf0f1f81a156efea73f76546e05 06-Aug-2010 Owen Anderson <resistor@mac.com> Revert r110396 to fix buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
9ccaf53ada99c63737547c0235baeb8454b04e80 06-Aug-2010 Owen Anderson <resistor@mac.com> Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier. Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
8086d5800dbe8cc392ce217adccfaca915858aed 24-Jul-2010 Dale Johannesen <dalej@apple.com> Revert 109076. It is wrong and was causing regressions. Add some
comments explaining why it was wrong. 8225024.

Fix the real problem in 8213383: the code that splits very large
blocks when no other place to put constants can be found was not
considering the case that the block contained a Thumb tablejump.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
2062875a7d8f7dd94a20d9e3a298e9e216efb4b5 22-Jul-2010 Chris Lattner <sabre@nondot.org> eliminate the TargetInstrInfo::GetInstSizeInBytes hook.
ARM/PPC/MSP430-specific code (which are the only targets that
implement the hook) can directly reference their target-specific
instrinfo classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b1c857bb7b3d7bc187de4e97439eb212a8604bf0 22-Jul-2010 Evan Cheng <evan.cheng@apple.com> Fix constant island pass's handling of tBR_JTr. The offset of the instruction does not have to be 4-byte aligned. Rather, it's the offset + 2 that must be aligned since the instruction expands into:
mov pc, r1
.align 2
LJTI0_0_0:
.long LBB0_14

This fixes rdar://8213383. No test case since it's not possible to come up with a suitable small one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
03e2d44722c1ebd3953007db0579147b46efba18 08-Jul-2010 Jim Grosbach <grosbach@apple.com> grammar

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c7937ae025194cb62ffcd592785c3ad97e7882ce 08-Jul-2010 Jim Grosbach <grosbach@apple.com> Handle cases where the post-RA scheduler may move instructions between the
address calculation instructions leading up to a jump table when we're trying
to convert them into a TB[H] instruction in Thumb2. This realistically
shouldn't happen much, if at all, for well formed inputs, but it's more correct
to handle it. rdar://7387682



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
26b8ef53ff2ff1ffd72d140b5be264e32dee0195 07-Jul-2010 Jim Grosbach <grosbach@apple.com> grammar and trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107811 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
fe60104ac97f3a8736dcfbfdf9547c7b7cc7b951 22-Jun-2010 Dan Gohman <gohman@apple.com> Use pre-increment instead of post-increment when the result is not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
9cfcfeb24bf7182d40d8e8a54e350451b67a1136 21-Jun-2010 Jim Grosbach <grosbach@apple.com> early exit for dbg_value instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
18f30e6f5e80787808fe1455742452a5210afe07 02-Jun-2010 Jim Grosbach <grosbach@apple.com> Clean up 80 column violations. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c7f3ace20c325521c68335a1689645b43b06ddf0 02-Apr-2010 Chris Lattner <sabre@nondot.org> use DebugLoc default ctor instead of DebugLoc::getUnknownLoc()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
815baebe1c8dc02accf128ae10dff9a1742d3244 13-Mar-2010 Bob Wilson <bob.wilson@apple.com> Change ARM ld/st multiple instructions to have variant instructions for
writebacks to the address register. This gets rid of the hack that the
first register on the list was the magic writeback register operand. There
was an implicit constraint that if that operand was not reg0 it had to match
the base register operand. The post-RA scheduler's antidependency breaker
did not understand that constraint and sometimes changed one without the
other. This also fixes Radar 7495976 and should help the verifier work
better for ARM code.

There are now new ld/st instructions explicit writeback operands and explicit
constraints that tie those registers together.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98409 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.cpp
7d7dab02783fb4f1f5d0cf274c52a4fb059bfbea 28-Jan-2010 Chris Lattner <sabre@nondot.org> eliminate the ARMFunctionInfo::Align member, using
MachineFunction::Alignment instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b1e803985d3378538ae9cff7eed4102c002d1e22 26-Jan-2010 Chris Lattner <sabre@nondot.org> prep work to support a future where getJumpTableInfo will return
a null pointer for functions with no jump tables. No functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.cpp
a9562568e5c2a897e3a51b18700eeb70f0dda48c 20-Nov-2009 Jim Grosbach <grosbach@apple.com> The verify() call of CPEIsInRange() isn't right for the assertion check of
constant pool ranges, as CPEIsInRange() makes conservative assumptions about
the potential alignment changes from branch adjustments. The verification,
on the other hand, runs after those branch adjustments are made, so the
effects on alignment are known and already taken into account. The sanity
check in verify should check the range directly instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89473 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
de8b1dbf95811fa2fc38bd677453f75811eb1029 20-Nov-2009 Jim Grosbach <grosbach@apple.com> Remove verifySizes() since it's not adding much value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
4d8e90a026a29a812616690bd77b72e0b5ae6c75 20-Nov-2009 Jim Grosbach <grosbach@apple.com> When placing constant islands and adjusting for alignment padding, inline
assembly can confuse things utterly, as it's assumed that instructions in
inline assembly are 4 bytes wide. For Thumb mode, that's often not true,
so the calculations for when alignment padding will be present get thrown off,
ultimately leading to out of range constant pool entry references. Making
more conservative assumptions that padding may be necessary when inline asm
is present avoids this situation.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89403 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
dec6de92d1425c88f319179fb4a0b0a23f781df9 19-Nov-2009 Jim Grosbach <grosbach@apple.com> fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
f04777b945e272ccec21c7080bd5480d78a14fd2 17-Nov-2009 Jim Grosbach <grosbach@apple.com> Enable arm jumpt table adjustment.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
a0a95a3c1cea79757854cf39ba07734b39e2b0e9 17-Nov-2009 Jim Grosbach <grosbach@apple.com> When moving a block for table jumps, make sure the prior block terminator
is analyzable so it can be updated. If it's not, be safe and don't move the
block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
08cbda56b6a45a2c29bdf3d9668ad614ad86cb77 16-Nov-2009 Jim Grosbach <grosbach@apple.com> Simplify thumb2 jump table adjustments. Remove unnecessary calculation and
usage of block sizes and offsets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
9249efe4c7451e83fb4c904fd7fcc8edfe08d815 16-Nov-2009 Jim Grosbach <grosbach@apple.com> clarify comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b2e86bb142c882c68c54723f65c572def9bf77cc 16-Nov-2009 Jim Grosbach <grosbach@apple.com> back off for a bit. tracking down weirdness

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
ca215e7804ca5d85e19e31850c3ba3d155624e89 16-Nov-2009 Jim Grosbach <grosbach@apple.com> Analyze has to be before checking the condition, obviously. Properly construct an iterator for prior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
9c477f54f3c3e2541205f24bfe89b22da7b6e096 14-Nov-2009 Jim Grosbach <grosbach@apple.com> cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
00a6a1f0225b01229134ecee7a853be638703c36 14-Nov-2009 Jim Grosbach <grosbach@apple.com> Cleanup flow, and only update the jump table we're analyzing when replacing a destination MBB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c1a07be185d50fb3201782e4c832356f612480fb 13-Nov-2009 Jim Grosbach <grosbach@apple.com> Block renumbering

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
80697d1b266cd3cd3b92edd424d66d573db6b4b1 12-Nov-2009 Jim Grosbach <grosbach@apple.com> Update TB[BH] layout optimization. Add support for moving the target block
to directly follow the jump table. Move the layout changes to prior to any
constant island handling.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
01dec0e545de18aadcd3911563a93d10a625be80 12-Nov-2009 Jim Grosbach <grosbach@apple.com> Revert 86857. It's causing consumer-typeset to fail, and there's a better way to do it forthcoming anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
f4997e87e3131a5609b54b18c6d94833827e9dce 11-Nov-2009 Jim Grosbach <grosbach@apple.com> Do jump table adjustment before constant island allocation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
1fc7d715aa35703fcc4a87ece718a8c447e8ee72 11-Nov-2009 Jim Grosbach <grosbach@apple.com> The TBB and TBH instructions for Thumb2 are really handy for jump tables, but
can only branch forward. To best take advantage of them, we'd like to adjust
the basic blocks around a bit when reasonable. This patch puts basics in place
to do that, with a super-simple algorithm for backwards jump table targets that
creates a new branch after the jump table which branches backwards. Real
heuristics for reordering blocks or other modifications rather than inserting
branches will follow.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
e5165490b7ba24bb2f3043399e0d60e7f3bcf8a5 09-Nov-2009 Jim Grosbach <grosbach@apple.com> Use Unified Assembly Syntax for the ARM backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
de17fb6e4dd8f169f707d58d4e124c8d4d2c7dba 01-Nov-2009 Evan Cheng <evan.cheng@apple.com> Use cbz and cbnz instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
f5a86f45e75ec744c203270ffa03659eb0a220c1 25-Oct-2009 Nick Lewycky <nicholas@mxc.ca> Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
6726b6d75a8b679068a58cb954ba97cf9d1690ba 25-Oct-2009 Nick Lewycky <nicholas@mxc.ca> Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b923953733ee6b0f477cd767dcc16f94a0966158 15-Oct-2009 Bob Wilson <bob.wilson@apple.com> Fix a potential performance problem in placing ARM constant pools.
In the case where there are no good places to put constants and we fall back
upon inserting unconditional branches to make new blocks, allow all constant
pool references in range of those blocks to put constants there, even if that
means resetting the "high water marks" for those references. This will still
terminate because you can't keep splitting blocks forever, and in the bad
cases where we have to split blocks, it is important to avoid splitting more
than necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
549dda9d82a5ec0a0cbf429a18d33a8e66062424 15-Oct-2009 Bob Wilson <bob.wilson@apple.com> Be smarter about reusing constant pool entries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
36fa5321bacf351f47d6193f56c464e6ab93b934 15-Oct-2009 Bob Wilson <bob.wilson@apple.com> Fix another problem with ARM constant pools. Radar 7303551.
When ARMConstantIslandPass cannot find any good locations (i.e., "water") to
place constants, it falls back to inserting unconditional branches to make a
place to put them. My recent change exposed a problem in this area. We may
sometimes append to the same block more than one unconditional branch. The
symptoms of this are that the generated assembly has a branch to an undefined
label and running llc with -debug will cause a seg fault.

This happens more easily since my change to prevent CPEs from moving from
lower to higher addresses as the algorithm iterates, but it could have
happened before. The end of the block may be in range for various constant
pool references, but the insertion point for new CPEs is not right at the end
of the block -- it is at the end of the CPEs that have already been placed
at the end of the block. The insertion point could be out of range. When
that happens, the fallback code will always append another unconditional
branch if the end of the block is in range.

The fix is to only append an unconditional branch if the block does not
already end with one. I also removed a check to see if the constant pool load
instruction is at the end of the block, since that is redundant with
checking if the end of the block is in-range.

There is more to be done here, but I think this fixes the immediate problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
4796ba2e701f302f9628af6e2fb4b491dc2e4b94 13-Oct-2009 Bob Wilson <bob.wilson@apple.com> Fix regression introduced by r83894.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
af4b7352193e4a024d4a4e87cac1ba1589e4de57 13-Oct-2009 Bob Wilson <bob.wilson@apple.com> Delete a comment that makes no sense to me. The statement that moving a CPE
before its reference is only supported on ARM has not been true for a while.
In fact, until recently, that was only supported for Thumb. Besides that,
CPEs are always a multiple of 4 bytes in size, so inserting a CPE should have
no effect on Thumb alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
757652c5ba820bbea75d8713d7bf3749e4113778 12-Oct-2009 Bob Wilson <bob.wilson@apple.com> Change CreateNewWater method to return NewMBB by reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
f98032ef64a777fe63d390539f901d7d6d4e868c 12-Oct-2009 Bob Wilson <bob.wilson@apple.com> Last week, ARMConstantIslandPass was failing to converge for the
MultiSource/Benchmarks/MiBench/automotive-susan test. The failure has
since been masked by an unrelated change (just randomly), so I don't have
a testcase for this now. Radar 7291928.

The situation where this happened is that a constant pool entry (CPE) was
placed at a lower address than the load that referenced it. There were in
fact 2 CPEs placed at adjacent addresses and referenced by 2 loads that were
close together in the code. The distance from the loads to the CPEs was
right at the limit of what they could handle, so that only one of the CPEs
could be placed within range. On every iteration, the first CPE was found
to be out of range, causing a new CPE to be inserted. The second CPE had
been in range but the newly inserted entry pushed it too far away. Thus the
second CPE was also replaced by a new entry, which in turn pushed the first
CPE out of range. Etc.

Judging from some comments in the code, the initial implementation of this
pass did not support CPEs placed _before_ their references. In the case
where the CPE is placed at a higher address, the key to making the algorithm
terminate is that new CPEs are only inserted at the end of a group of adjacent
CPEs. This is implemented by removing a basic block from the "WaterList"
once it has been used, and then adding the newly inserted CPE block to the
list so that the next insertion will come after it. This avoids the ping-pong
effect where CPEs are repeatedly moved to the beginning of a group of
adjacent CPEs. This does not work when going backwards, however, because the
entries at the end of an adjacent group of CPEs are closer than the CPEs
earlier in the group.

To make this pass terminate, we need to maintain a property that changes can
only happen in some sort of monotonic fashion. The fix used here is to require
that the CPE for a particular constant pool load can only move to lower
addresses. This is a very simple change to the code and should not cause
any significant degradation in the results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
32c50e8f9920bb7835eb42926945c9a1e6385de5 12-Oct-2009 Bob Wilson <bob.wilson@apple.com> Another minor clean-up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
d637c1a4955c750b64414c4429ec707be2d8b990 12-Oct-2009 Bob Wilson <bob.wilson@apple.com> Remove redundant parameter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
3b7573517ccd0f8f9e4bc64cf1923bae68e40d3f 12-Oct-2009 Bob Wilson <bob.wilson@apple.com> Use early exit to reduce indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
9d16f2c0baf91445764751b7c92cd1ff6d6d43f8 12-Oct-2009 Bob Wilson <bob.wilson@apple.com> Change to return a value by reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
034de5f65f9139954cb01d94eaebbaefd294946e 12-Oct-2009 Bob Wilson <bob.wilson@apple.com> Add a typedef for an iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
10469f8e48e007989b0469e677d4000a1311ecd2 01-Oct-2009 Evan Cheng <evan.cheng@apple.com> ARM::tPOP and tPOP_RET each has an extra writeback operand now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
893e1c90a03a53cf13f73849324e83612688428a 23-Aug-2009 Chris Lattner <sabre@nondot.org> eliminate the last DOUTs from the targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
705e07f578e2b3af47ddab610feb4e7f2d3063a5 23-Aug-2009 Chris Lattner <sabre@nondot.org> remove various std::ostream version of printing methods from
MachineInstr and MachineOperand. This required eliminating a
bunch of stuff that was using DOUT, I hope that bill doesn't
mind me stealing his fun. ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
31b99dd76035067b1c3cc6c7e9d663b7b0210938 14-Aug-2009 Evan Cheng <evan.cheng@apple.com> Also shrink immediate branches; also more assembler workarounds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
a1efbbdbf3217598f334a6f39dab84ca06f5de41 14-Aug-2009 Evan Cheng <evan.cheng@apple.com> Shrink ADR and LDR from constantpool late during constantpool island pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
48bd7e3bbc481cd9b99a981f7d8e06989774f9d2 13-Aug-2009 Evan Cheng <evan.cheng@apple.com> tPOP_RET now has predicate operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
e0d7fe85505b14c014a9da78e891359a99c1e0a3 12-Aug-2009 Evan Cheng <evan.cheng@apple.com> Remove another Darwin assembler workaround.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
4b322e58b77d16f103d88a3af3a4ebd2675245a0 11-Aug-2009 Evan Cheng <evan.cheng@apple.com> Shrinkify Thumb2 load / store multiple instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
764ab52dd80310a205c9888bf166d09dab858f90 11-Aug-2009 Jim Grosbach <grosbach@apple.com> Whitespace cleanup. Remove trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
4a8ea215e69e9ca19c8acf1c236b73860188a023 11-Aug-2009 Evan Cheng <evan.cheng@apple.com> Cosmetic changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b6879b2b84df2f642cd39f5bf58584c4a39f8080 07-Aug-2009 Evan Cheng <evan.cheng@apple.com> Error out, rather than infinite looping, if constant island pass can't converge.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
53c67c0218d8420234dd71bf2d9df3388909af77 07-Aug-2009 Evan Cheng <evan.cheng@apple.com> tBfar is bl, which clobbers LR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
25f7cfc3cccba6f569f29f79ea533bae960b93c0 01-Aug-2009 Evan Cheng <evan.cheng@apple.com> Workaround a couple of Darwin assembler bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
d26b14c34cbcee1448b86b524578fc51cc979023 31-Jul-2009 Evan Cheng <evan.cheng@apple.com> - Teach TBB / TBH offset limits are 510 and 131070 respectively since the offset
is scaled by two.
- Teach GetInstSizeInBytes about TBB and TBH.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
8770f747a98194056805f1b7cbcb0b75a7633b87 30-Jul-2009 Evan Cheng <evan.cheng@apple.com> tbb / tbh instructions only branch forward, not backwards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77522 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
5657c01949dca6c012ac60d242d1a8d2ffdf5603 29-Jul-2009 Evan Cheng <evan.cheng@apple.com> Optimize Thumb2 jumptable to use tbb / tbh when all the offsets fit in byte / halfword.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
66ac53165e17b7c76b8c69e57bde623d44ec492e 25-Jul-2009 Evan Cheng <evan.cheng@apple.com> Change Thumb2 jumptable codegen to one that uses two level jumps:

Before:
adr r12, #LJTI3_0_0
ldr pc, [r12, +r0, lsl #2]
LJTI3_0_0:
.long LBB3_24
.long LBB3_30
.long LBB3_31
.long LBB3_32

After:
adr r12, #LJTI3_0_0
add pc, r12, +r0, lsl #2
LJTI3_0_0:
b.w LBB3_24
b.w LBB3_30
b.w LBB3_31
b.w LBB3_32

This has several advantages.
1. This will make it easier to optimize this to a TBB / TBH instruction +
(smaller) table.
2. This eliminate the need for ugly asm printer hack to force the address
into thumb addresses (bit 0 is one).
3. Same codegen for pic and non-pic.
4. This eliminate the need to align the table so constantpool island pass
won't have to over-estimate the size.

Based on my calculation, the later is probably slightly faster as well since
ldr pc with shifter address is very slow. That is, it should be a win as long
as the HW implementation can do a reasonable job of branch predict the second
branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
40efc251cd7a52dd2375ec95ee38b1be4572178f 24-Jul-2009 Evan Cheng <evan.cheng@apple.com> Disable my constant island pass optimization (to make use soimm more effectively). It caused infinite looping on lencod.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
789476240d6b6f8ad9366cadf790a82bd41bb0b3 24-Jul-2009 Evan Cheng <evan.cheng@apple.com> Make sure thumb2 jumptable entries are aligned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
d3d9d66dd211d1267e764c7294876d9a227f04ca 23-Jul-2009 Evan Cheng <evan.cheng@apple.com> Fix up ARM constant island pass for Thumb2.

Also fixed up code to fully use the SoImm field for ADR on ARM mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
5d8f1cae76e4e424bf3b4392eddb3f4dbf38662a 22-Jul-2009 Evan Cheng <evan.cheng@apple.com> Fixing cp island pass. Step 1: Determine whether the constant pool offset can be
negative on an individual bases rather than basing on whether it's in thumb
mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c23197a26f34f559ea9797de51e187087c039c42 14-Jul-2009 Torok Edwin <edwintorok@gmail.com> llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c25e7581b9b8088910da31702d4ca21c4734c6d7 11-Jul-2009 Torok Edwin <edwintorok@gmail.com> assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
f1daf7d8abebd6e0104a6b41a774ccbb19a51c60 09-Jul-2009 David Goodwin <david_goodwin@apple.com> Use common code for both ARM and Thumb-2 instruction and register info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
58541fd62707b6856beee3db9e254b0110607bb1 07-Jul-2009 Evan Cheng <evan.cheng@apple.com> 80 col violation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
8b024a5eb5b64b482f7d92aad7a3f0e6cac93f12 02-Jul-2009 Bob Wilson <bob.wilson@apple.com> Add a new addressing mode for NEON load/store instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c9a59b5960088f48c3be234bcc4c79a1ed915d73 30-Jun-2009 David Goodwin <david_goodwin@apple.com> Improve Thumb-2 jump table support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
5e47a9a6e46bd271eba058fb831da1a1edf8707c 30-Jun-2009 David Goodwin <david_goodwin@apple.com> Add conditional and unconditional thumb-2 branch. Add thumb-2 jump table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
055b0310f862b91f33699037ce67d3ab8137c20c 29-Jun-2009 Evan Cheng <evan.cheng@apple.com> Implement Thumb2 ldr.

After much back and forth, I decided to deviate from ARM design and split LDR into 4 instructions (r + imm12, r + imm8, r + r << imm12, constantpool). The advantage of this is 1) it follows the latest ARM technical manual, and 2) makes it easier to reduce the width of the instruction later. The down side is this creates more inconsistency between the two sub-targets. We should split ARM LDR instruction in a similar fashion later. I've added a README entry for this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
39bf051ec2865cd715c41473d2a9fc34ff252534 12-May-2009 Bob Wilson <bob.wilson@apple.com> Fix up a few minor typos in comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
8494526a2396fd9cde027ab6ae11dd28b54ac90e 12-May-2009 Bob Wilson <bob.wilson@apple.com> Fix 80-col violations and remove trailing whitespace. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
777d2306b36816a53bc1ae1244c0dc7d998ae691 09-May-2009 Duncan Sands <baldrick@free.fr> Rename PaddedSize to AllocSize, in the hope that this
will make it more obvious what it represents, and stop
it being confused with the StoreSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b67284057ee130114055309eabe0bcd1af13777d 13-Feb-2009 Dale Johannesen <dalej@apple.com> Remove refs to non-DebugLoc versions of BuildMI from ARM.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
d1e7d9a88b5f4fa5e9a85affc4599c650c591ffb 28-Jan-2009 Evan Cheng <evan.cheng@apple.com> Suppress a compile time warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
ceb4d1aecb9deffe59b3dcdc9a783ffde8477be9 12-Jan-2009 Duncan Sands <baldrick@free.fr> Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
f1bbb9577a42cf7dc3079412f1dd7683e3a03665 08-Nov-2008 Evan Cheng <evan.cheng@apple.com> Use ARMFunctionInfo to track number of constpool entries and jumptables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.cpp
014278e6a11fa0767853b831e5bf51b95bf541c5 13-Sep-2008 Dan Gohman <gohman@apple.com> Remove isImm(), isReg(), and friends, in favor of
isImmediate(), isRegister(), and friends, to avoid confusion
about having two different names with the same meaning. I'm
not attached to the longer names, and would be ok with
changing to the shorter names if others prefer it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.cpp
8e5f2c6f65841542e2a7092553fe42a00048e4c7 08-Jul-2008 Dan Gohman <gohman@apple.com> Pool-allocation for MachineInstrs, MachineBasicBlocks, and
MachineMemOperands. The pools are owned by MachineFunctions.

This drastically reduces the number of calls to malloc/free made
during the "Emit" phase of scheduling, as well as later phases
in CodeGen. Combined with other changes, this speeds up the
"instruction selection" phase of CodeGen by 10% in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
52e724ad7e679ee590f4bd763d55280586a8f1bc 16-Apr-2008 Nicolas Geoffray <nicolas.geoffray@lip6.fr> Infrastructure for getting the machine code size of a function and an instruction. X86, PowerPC and ARM are implemented




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
5080f4d9919d39b367891dc51e739c571a66036c 11-Jan-2008 Chris Lattner <sabre@nondot.org> rename MachineInstr::setInstrDescriptor -> setDesc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.cpp
8aa797aa51cd4ea1ec6f46f4891a6897944b75b2 31-Dec-2007 Chris Lattner <sabre@nondot.org> Add new shorter predicates for testing machine operands for various types:
e.g. MO.isMBB() instead of MO.isMachineBasicBlock(). I don't plan on
switching everything over, so new clients should just start using the
shorter names.

Remove old long accessors, switching everything over to use the short
accessor: getMachineBasicBlock() -> getMBB(),
getConstantPoolIndex() -> getIndex(), setMachineBasicBlock -> setMBB(), etc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
9a1ceaedc282f0cae31f2723f4d6c00c7b88fe90 30-Dec-2007 Chris Lattner <sabre@nondot.org> Use MachineOperand::getImm instead of MachineOperand::getImmedValue. Likewise setImmedValue -> setImm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.cpp
ca0ed744852a7d9625572fbb793f65e81225a3e8 05-Nov-2007 Duncan Sands <baldrick@free.fr> Eliminate the remaining uses of getTypeSize. This
should only effect x86 when using long double. Now
12/16 bytes are output for long double globals (the
exact amount depends on the alignment). This brings
globals in line with the rest of LLVM: the space
reserved for an object is now always the ABI size.
One tricky point is that only 10 bytes should be
output for long double if it is a field in a packed
struct, which is the reason for the additional
argument to EmitGlobalConstant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
66a2a8f8782f55a9668c7f4200ff55b52fcddef6 12-Jul-2007 Dale Johannesen <dalej@apple.com> ARM: make branch folder remove unconditional branches
following jump tables that it earlier inserted. This
would be OK on other targets but is needed for correctness
only on ARM (constant islands needs to find jump tables).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
5d9c4b60204d741c213456e21b87e9af6a3dc627 11-Jul-2007 Dale Johannesen <dalej@apple.com> Fix hang compiling TimberWolf (allow for islands
of size other than 4).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
8202010364e1bfe6111f1ce62f154499b80877fb 11-Jul-2007 Evan Cheng <evan.cheng@apple.com> Didn't mean the last commit. Revert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c608ff22e79bf56b7227e56eb9e88fed2258b5c6 10-Jul-2007 Evan Cheng <evan.cheng@apple.com> Update.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
0e1d37904abbf7e8c4c478408253dd995f3040f4 05-Jul-2007 Evan Cheng <evan.cheng@apple.com> Reflects the chanegs made to PredicateOperand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
2706f9771de8e90ee6379e70afedd91892bb9c8c 16-May-2007 Evan Cheng <evan.cheng@apple.com> Fix comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
44bec52b1b7e9a3ac1efbae90db240b8c1ca2ad4 15-May-2007 Evan Cheng <evan.cheng@apple.com> Add PredicateOperand to all ARM instructions that have the condition field.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.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/Target/ARM/ARMConstantIslandPass.cpp
8593e418555fdae21a070357fd8734b4069c17d0 29-Apr-2007 Dale Johannesen <dalej@apple.com> Rewrite of Thumb constant islands handling (exact allowance for padding
around islands and jump tables).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
185ea1e2aad88b13c3978197851da078601afff3 27-Apr-2007 Evan Cheng <evan.cheng@apple.com> Doh. ARM::LEApcrel is a single instruction MI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
768c9f725bda048b3406b6289beb586ff6e933df 27-Apr-2007 Evan Cheng <evan.cheng@apple.com> Special handling of LEApcrel and tLEApcrel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
56c42ef3e43f8eb75c435e781d0ac8251c7588a1 23-Apr-2007 Dale Johannesen <dalej@apple.com> Make Thumb funcs containing islands 4-byte aligned. Fix bugs maintaining
BBOffsets and BBSizes when adjusting conditional branches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
ed884f3a2f7225a0ea40fc18964b6f949cac3680 04-Apr-2007 Evan Cheng <evan.cheng@apple.com> Remove unused constant pool entries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
d959aa421a8d14fc5aad29141f816db8f4362c7f 02-Apr-2007 Dale Johannesen <dalej@apple.com> fix off by 1 error in displacement computation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
f49407b790d8664d8ff9c103931b115ebe9cc96e 01-Mar-2007 Evan Cheng <evan.cheng@apple.com> - Track which callee-saved registers are spilled.
- Some code clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b71aa2b6ca801d407c702483c412a290ab4af3b2 01-Mar-2007 Dale Johannesen <dalej@apple.com> Changes requested in review of last pass. Also pulled isThumb into a
member, instead of resetting in every function that uses it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34764 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
f1b214d3ca12f2d85f0d092b4920172bcc797bac 28-Feb-2007 Dale Johannesen <dalej@apple.com> Add intelligence about where to break large blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
ce74de46dd2b1ca040bc5d2e17af64832bc0b633 25-Feb-2007 Dale Johannesen <dalej@apple.com> cosmetic changes from review of last patch. obvious


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
598270a68d162ee28cf5033b8cef236fe7ee767f 25-Feb-2007 Dale Johannesen <dalej@apple.com> remove crediting of Evan Cheng and me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
99c49a4b94ffabdd22f55e8274c7f92892e25559 25-Feb-2007 Dale Johannesen <dalej@apple.com> Removed WaterListOffset, inserted BBOffsets. Remove TODO item about this
from README.
When no water available, use end of block if in range. (More to do here.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
88e37ae36652546c8e409cab69a1777af63cf095 23-Feb-2007 Dale Johannesen <dalej@apple.com> rewrite of constant islands


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
e03cff6812ac41598e2bca7854985dc821a07f44 10-Feb-2007 Evan Cheng <evan.cheng@apple.com> These vectors are frequently large. Use std::vector instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c99ef085b90b32952b484e8843fb66ad65215b61 09-Feb-2007 Evan Cheng <evan.cheng@apple.com> Add reference counting to constantpool entries. Delete the unused ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
bd5d3dbdbe46c7325545a7cb8c891c0347375451 03-Feb-2007 Evan Cheng <evan.cheng@apple.com> - Branch max. displacement calculation bug.
- Add debugging info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33811 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
05cc424082f797c5820b19f29f398c9cce9b9928 02-Feb-2007 Evan Cheng <evan.cheng@apple.com> Use MBB.empty() instead of MBB.size() for speed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
1dd6a606ad59847164ef92ba82d533dc645f134c 02-Feb-2007 Evan Cheng <evan.cheng@apple.com> Watch out for empty BB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
556f33c6e25b9f85abccc9568974df7ecc202ec0 01-Feb-2007 Evan Cheng <evan.cheng@apple.com> Pasto. Lots of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
b43216ee4a418257ce5530c02601b77efe86c354 01-Feb-2007 Evan Cheng <evan.cheng@apple.com> - Off by one bugs in maximum displacement calculation / testing.
- In thumb mode, a new constpool island BB size should be 4 + 2 to
compensate for the potential padding due to alignment requirement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
2021abe154e3cac523755b74fc5e62a2c9dad1fc 01-Feb-2007 Evan Cheng <evan.cheng@apple.com> Pessmistically assume the .align 2 before the first constpool entry adds
two bytes padding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
a2e35588c669a70fdc81426df8654fb4efc1d7f4 01-Feb-2007 Evan Cheng <evan.cheng@apple.com> Handle an interesting corner case: the constpool_entry being reference is two
instructions away, i.e. its address is equal to PC.
%r0 = tLDRpci <cp#0>
bx
CONSTPOOL_ENTRY 0 <cp#0>, 4


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33728 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c0dbec7e1038ee60b8525eb1e8e3eaa6a839bd5b 31-Jan-2007 Evan Cheng <evan.cheng@apple.com> When determining whether a pc relative branch / load displacement fits in the
instruction field, adjust it for PC value (4 for thumb, 8 for arm).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33711 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
a9b8b8d62c67e96bc4dc2ed25298c539102f8638 31-Jan-2007 Evan Cheng <evan.cheng@apple.com> Some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
934536dab2585079d72b0218b3d5a2ea07795beb 31-Jan-2007 Evan Cheng <evan.cheng@apple.com> ConstPool island bug: watch out for cases where UserMI is the last MI of the BB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
0c61584d05894a5543f690803191a8b0da05b8fc 31-Jan-2007 Evan Cheng <evan.cheng@apple.com> - Added Thumb constpool island support.
- Islands are inserted right after the user MI since thumb LDR cannot encode
negative offset.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
d1b2c1e88fe4a7728ca9739b0f1c6fd90a19c5fd 30-Jan-2007 Evan Cheng <evan.cheng@apple.com> - In thumb mode, if size of MachineFunction is >= 2048, force LR to be
spilled (if it is not already).
- If LR is spilled, use BL to implement far jumps. LR is not used as a GPR
in thumb mode so it can be clobbered if it is properly spilled / restored
in prologue / epilogue.
- If LR is force spilled but no far jump has been emitted, try undo'ing the
spill by:
push lr -> delete
pop pc -> bx lr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
29836c330ff33e3c6a250a89b3e78abb3a1970c9 30-Jan-2007 Evan Cheng <evan.cheng@apple.com> Factor GetInstSize() out of constpool island pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
d85ac4d07966a56b3101598f29393f4532acc50f 27-Jan-2007 Evan Cheng <evan.cheng@apple.com> Thumb jumptable support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
43aeab68a69e443c528092b4424a498d813f96b7 26-Jan-2007 Evan Cheng <evan.cheng@apple.com> Conditional branch being fixed up is not the last MI in the BB, there is a
unconditional branch following it. Simply invert the condition and swap
destinations if the conditional branch can reach the destination of the
unconditional branch:
beq L1
b L2
=>
bne L2
b L1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
1ee29257428960fede862fcfdbe80d5d007927e9 26-Jan-2007 Jim Laskey <jlaskey@mac.com> Make LABEL a builtin opcode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
dd353b8ad747a8731a191848ff5db978a70bd0fb 26-Jan-2007 Evan Cheng <evan.cheng@apple.com> SplitBlockBeforeInstr() insert a unconditional branch to the next BB. This
is unnecessary when we are fixing up a conditional branch since we will be
adding a unconditional branch to the destination of the original branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
7755facd76c518b09ed634f383170e8f3bcafc0d 26-Jan-2007 Evan Cheng <evan.cheng@apple.com> Need to scan the function for branches even if there aren't any constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
a0bf794eb60b6795a121efcb9ff759e9e0955772 26-Jan-2007 Evan Cheng <evan.cheng@apple.com> Forgot to update this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
c285414988ba026d01e5d8acc07a21cd06fd5732 26-Jan-2007 Evan Cheng <evan.cheng@apple.com> Add comment, fix typo, reduce memory usage, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
743fa032a781c18a03e474e0a34f013598439ba5 25-Jan-2007 Evan Cheng <evan.cheng@apple.com> Doh. Skip JT branches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
af5cbcb809bdbd30ebacab942994721c134d16a2 25-Jan-2007 Evan Cheng <evan.cheng@apple.com> Added (preliminary) branch shortening capability to constantpool island pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
012f2d97b78e4eb9128f1d491f2c177768dbe527 24-Jan-2007 Evan Cheng <evan.cheng@apple.com> Use PC relative ldr to load from a constantpool in Thumb mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
a8e2989ece6dc46df59b0768184028257f913843 19-Jan-2007 Evan Cheng <evan.cheng@apple.com> ARM backend contribution from Apple.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp