oota-llvm.git
12 years agoReorder includes in Target backends to following coding standards. Remove some superf...
Craig Topper [Sat, 17 Mar 2012 18:46:09 +0000 (18:46 +0000)]
Reorder includes in Target backends to following coding standards. Remove some superfluous forward declarations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152997 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMachineInstr: Inline the fast path (non-bundle instruction) of hasProperty.
Benjamin Kramer [Sat, 17 Mar 2012 17:03:45 +0000 (17:03 +0000)]
MachineInstr: Inline the fast path (non-bundle instruction) of hasProperty.

This is particularly helpful as both arguments tend to be constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152991 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix some copy and paste remnants of Cell and SPU in Hexagon files.
Craig Topper [Sat, 17 Mar 2012 09:39:20 +0000 (09:39 +0000)]
Fix some copy and paste remnants of Cell and SPU in Hexagon files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152981 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix typo in file header.
Craig Topper [Sat, 17 Mar 2012 09:28:37 +0000 (09:28 +0000)]
Fix typo in file header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152980 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPass TargetOptions to HexagonTargetMachine constructor by reference to match other...
Craig Topper [Sat, 17 Mar 2012 09:24:09 +0000 (09:24 +0000)]
Pass TargetOptions to HexagonTargetMachine constructor by reference to match other targets and the base class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152979 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReorder includes to match coding standards. Fix an issue or two exposed by that.
Craig Topper [Sat, 17 Mar 2012 07:33:42 +0000 (07:33 +0000)]
Reorder includes to match coding standards. Fix an issue or two exposed by that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152978 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMC asm parser macro argument count was wrong when empty.
Jim Grosbach [Sat, 17 Mar 2012 00:11:42 +0000 (00:11 +0000)]
MC asm parser macro argument count was wrong when empty.

 evaluated to '1' when the argument list was empty (should be '0').

rdar://11057257

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152967 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCheck if we can handle the arguments of a call (and therefore the call) in
Bill Wendling [Fri, 16 Mar 2012 23:11:07 +0000 (23:11 +0000)]
Check if we can handle the arguments of a call (and therefore the call) in
fast-isel before emitting code. If the program bails after code was emitted,
then it could lead to the stack being adjusted more than once (two
CALLSEQ_BEGINs emitted) but being adjuste back only once after the call. This
leads to general badness and gnashing of teeth.
<rdar://problem/11050630>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152959 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r152915. Chapuni's WinWaitReleased refactoring: It doesn't work for me
Francois Pichet [Fri, 16 Mar 2012 22:50:01 +0000 (22:50 +0000)]
Revert r152915. Chapuni's WinWaitReleased refactoring: It doesn't work for me

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152958 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoclarify the coding standards a bit.
Chris Lattner [Fri, 16 Mar 2012 22:34:37 +0000 (22:34 +0000)]
clarify the coding standards a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152957 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM fix silly typo in optional operand alias.
Jim Grosbach [Fri, 16 Mar 2012 22:18:29 +0000 (22:18 +0000)]
ARM fix silly typo in optional operand alias.

rdar://11065671

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152954 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM divided syntax fmrx/fmxr mnemonics.
Jim Grosbach [Fri, 16 Mar 2012 21:06:13 +0000 (21:06 +0000)]
ARM divided syntax fmrx/fmxr mnemonics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152946 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM ldm/stm register lists can be out of order.
Jim Grosbach [Fri, 16 Mar 2012 20:48:38 +0000 (20:48 +0000)]
ARM ldm/stm register lists can be out of order.

It's not a good style idea, as the registers will be laid down in memory in
numerical order, not the order they're in the list, but it's legal. vldm/vstm
are stricter.

rdar://11064740

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152943 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r152907.
Bill Wendling [Fri, 16 Mar 2012 18:20:54 +0000 (18:20 +0000)]
Revert r152907.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152935 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoScheduleDAGInstrs: When adding uses we add them into a set that's empty at the beginn...
Benjamin Kramer [Fri, 16 Mar 2012 17:38:19 +0000 (17:38 +0000)]
ScheduleDAGInstrs: When adding uses we add them into a set that's empty at the beginning, no need to maintain another set for the added regs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152934 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoLimit the number of memory operands in MachineInstr to 2^16 and store the number...
Benjamin Kramer [Fri, 16 Mar 2012 16:39:27 +0000 (16:39 +0000)]
Limit the number of memory operands in MachineInstr to 2^16 and store the number in padding.

Saves one machine word on MachineInstr (88->80 bytes on x86_64, 48->44 on i386).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152930 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCriticalAntiDepBreaker: BasicBlock::size is an expensive operation, reuse the cached...
Benjamin Kramer [Fri, 16 Mar 2012 15:46:47 +0000 (15:46 +0000)]
CriticalAntiDepBreaker: BasicBlock::size is an expensive operation, reuse the cached value.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152927 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agolit/TestRunner.py: [Win32] Check all opened_files[] released, rather than (obsoleted...
NAKAMURA Takumi [Fri, 16 Mar 2012 10:48:10 +0000 (10:48 +0000)]
lit/TestRunner.py: [Win32] Check all opened_files[] released, rather than (obsoleted) written_files[].

In previous case,
RUN: foo -o %t
RUN: FileCheck < %t
RUN: bar -o %t

2nd read handle might prevent manipulation of 3rd %t in bar, to remove and rename.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152916 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agolit/TestRunner.py: [Win32] Rework WinWaitReleased().
NAKAMURA Takumi [Fri, 16 Mar 2012 10:48:03 +0000 (10:48 +0000)]
lit/TestRunner.py: [Win32] Rework WinWaitReleased().

We can simply confirm the handle released to open it with EXCLUSIVE. Attempting renaming was bad.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152915 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThe alignment of the pointer part of the store instruction may have an
Bill Wendling [Fri, 16 Mar 2012 07:40:08 +0000 (07:40 +0000)]
The alignment of the pointer part of the store instruction may have an
alignment. If that's the case, then we want to make sure that we don't increase
the alignment of the store instruction. Because if we increase it to be "more
aligned" than the pointer, code-gen may use instructions which require a greater
alignment than the pointer guarantees.
<rdar://problem/11043589>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152907 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMore const-correcting of FixedLenDecoderEmitter.
Craig Topper [Fri, 16 Mar 2012 06:52:56 +0000 (06:52 +0000)]
More const-correcting of FixedLenDecoderEmitter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152906 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRip out support for 'llvm.noinline'. This thing has a strange history...
Chandler Carruth [Fri, 16 Mar 2012 06:10:15 +0000 (06:10 +0000)]
Rip out support for 'llvm.noinline'. This thing has a strange history...

It was added in 2007 as the first cut at supporting no-inline
attributes, but we didn't have function attributes of any form at the
time. However, it was added without any mention in the LangRef or other
documentation.

Later on, in 2008, Devang added function notes for 'inline=never' and
then turned them into proper function attributes. From that point
onward, as far as I can tell, the world moved on, and no one has touched
'llvm.noinline' in any meaningful way since.

It's time has now come. We have had better mechanisms for doing this for
a long time, all the frontends I'm aware of use them, and this is just
holding back progress. Given that it was never a documented feature of
the IR, I've provided no auto-upgrade support. If people know of real,
in-the-wild bitcode that relies on this, yell at me and I'll add it, but
I *seriously* doubt anyone cares.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152904 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoStart removing the use of an ad-hoc 'never inline' set and instead
Chandler Carruth [Fri, 16 Mar 2012 06:10:13 +0000 (06:10 +0000)]
Start removing the use of an ad-hoc 'never inline' set and instead
directly query the function information which this set was representing.
This simplifies the interface of the inline cost analysis, and makes the
always-inline pass significantly more efficient.

Previously, always-inline would first make a single set of every
function in the module *except* those marked with the always-inline
attribute. It would then query this set at every call site to see if the
function was a member of the set, and if so, refuse to inline it. This
is quite wasteful. Instead, simply check the function attribute directly
when looking at the callsite.

The normal inliner also had similar redundancy. It added every function
in the module with the noinline attribute to its set to ignore, even
though inside the cost analysis function we *already tested* the
noinline attribute and produced the same result.

The only tricky part of removing this is that we have to be able to
correctly remove only the functions inlined by the always-inline pass
when finalizing, which requires a bit of a hack. Still, much less of
a hack than the set of all non-always-inline functions was. While I was
touching this function, I switched a heavy-weight set to a vector with
sort+unique. The algorithm already had a two-phase insert and removal
pattern, we were just needlessly paying the uniquing cost on every
insert.

This probably speeds up some compiles by a small amount (-O0 compiles
with lots of always-inline, so potentially heavy libc++ users), but I've
not tried to measure it.

I believe there is no functional change here, but yell if you spot one.
None are intended.

Finally, the direction this is going in is to greatly simplify the
inline cost query interface so that we can replace its implementation
with a much more clever one. Along the way, all the APIs get simplified,
so it seems incrementally good.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152903 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoConst-correct the FixedLenDecoderEmitter. Pass a few things by const reference instea...
Craig Topper [Fri, 16 Mar 2012 05:58:09 +0000 (05:58 +0000)]
Const-correct the FixedLenDecoderEmitter. Pass a few things by const reference instead of value to avoid some copying.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152899 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPull the implementation of the code metrics out of the inline cost
Chandler Carruth [Fri, 16 Mar 2012 05:51:52 +0000 (05:51 +0000)]
Pull the implementation of the code metrics out of the inline cost
analysis implementation. The header was already separated. Also cleanup
all the comments in the header to follow a nice modern doxygen form.

There is still plenty of cruft here, but some of that will fall out in
subsequent refactorings and this was an easy step in the right
direction. No functionality changed here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152898 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomisched: add DAG edges from vreg defs to ExitSU.
Andrew Trick [Fri, 16 Mar 2012 05:04:25 +0000 (05:04 +0000)]
misched: add DAG edges from vreg defs to ExitSU.

These edges are not really necessary, but it is consistent with the
way we currently create physreg edges. Scheduler heuristics that
expect a DAG edge to the block terminator could benefit from this
change. Although in the future I hope we have a better mechanism for
modeling latency across scheduling regions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152895 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoLSR fix: Add isSimplifiedLoopNest to IVUsers analysis.
Andrew Trick [Fri, 16 Mar 2012 03:16:56 +0000 (03:16 +0000)]
LSR fix: Add isSimplifiedLoopNest to IVUsers analysis.

Only record IVUsers that are dominated by simplified loop
headers. Otherwise SCEVExpander will crash while looking for a
preheader.

I previously tried to work around this in LSR itself, but that was
insufficient. This way, LSR can continue to run if some uses are not
in simple loops, as long as we don't attempt to analyze those users.

Fixes <rdar://problem/11049788> Segmentation fault: 11 in LoopStrengthReduce

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152892 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSpacing fixes. Mostly aligning arguments that spilled onto next line with the opening...
Craig Topper [Fri, 16 Mar 2012 01:19:24 +0000 (01:19 +0000)]
Spacing fixes. Mostly aligning arguments that spilled onto next line with the opening parenthese instead of 2 spaces in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152889 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r152705, which reapplied r152486 as this appears to be causing failures
Chad Rosier [Fri, 16 Mar 2012 01:04:00 +0000 (01:04 +0000)]
Revert r152705, which reapplied r152486 as this appears to be causing failures
on our internal nightly testers.  So, basically revert r152486 again.

Abbreviated original commit message:
Implement a more intelligent way of spilling uses across an invoke boundary.

It looks as if Chander's inlining work, r152737, exposed an issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152887 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove unused field NumVariable from Filter class. Even it was needed the same result...
Craig Topper [Fri, 16 Mar 2012 00:56:01 +0000 (00:56 +0000)]
Remove unused field NumVariable from Filter class. Even it was needed the same result could be found with VariableInstructions.size(). Also fix some typos in comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152885 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn InstCombiner::visitOr, make sure we reverse the operand swap used for checking...
Eli Friedman [Fri, 16 Mar 2012 00:52:42 +0000 (00:52 +0000)]
In InstCombiner::visitOr, make sure we reverse the operand swap used for checking for or-of-xor operations after those checks; a later check expects that any constant will be in Op1.  PR12234.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152884 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM optional operand on MRC/MCR assembly instructions.
Jim Grosbach [Fri, 16 Mar 2012 00:45:58 +0000 (00:45 +0000)]
ARM optional operand on MRC/MCR assembly instructions.

rdar://11058464

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152883 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM vmrs system registers mvfr0 and mvfr1 handling.
Jim Grosbach [Fri, 16 Mar 2012 00:27:18 +0000 (00:27 +0000)]
ARM vmrs system registers mvfr0 and mvfr1 handling.

rdar://11058464

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152881 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDo the right thing on NULL uint64 fields.
Eric Christopher [Fri, 16 Mar 2012 00:21:54 +0000 (00:21 +0000)]
Do the right thing on NULL uint64 fields.

Patch by Clemens Hammacher!

Fixes PR12243

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152880 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r152613 (and r152614), "Inline the d'tor and add an anchor instead." for worka...
NAKAMURA Takumi [Fri, 16 Mar 2012 00:01:55 +0000 (00:01 +0000)]
Revert r152613 (and r152614), "Inline the d'tor and add an anchor instead." for workaround of g++-4.4's miscompilation.

It caused MSP430DAGToDAGISel::SelectIndexedBinOp() to be miscompiled.
When two ReplaceUses()'s are expanded as inline, vtable in base class is stored to latter (ISelUpdater)ISU.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152877 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFor types with a parent of the compile unit make sure and emit
Eric Christopher [Thu, 15 Mar 2012 23:55:40 +0000 (23:55 +0000)]
For types with a parent of the compile unit make sure and emit
the DECL information.

rdar://10855921

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152876 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove inadvertant commit.
Jim Grosbach [Thu, 15 Mar 2012 23:00:30 +0000 (23:00 +0000)]
Remove inadvertant commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152870 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[fast-isel] Address Eli's comments for r152847. Specifically, add a test case
Chad Rosier [Thu, 15 Mar 2012 22:54:20 +0000 (22:54 +0000)]
[fast-isel] Address Eli's comments for r152847.  Specifically, add a test case
and still allow immediate encoding, just not with cmn.
rdar://11038907

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152869 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agodocs: Update TestingGuide to change recommended practice to using LNT to drive
Daniel Dunbar [Thu, 15 Mar 2012 22:19:35 +0000 (22:19 +0000)]
docs: Update TestingGuide to change recommended practice to using LNT to drive
the test-suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152860 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[fast-isel] Don't try to encode LONG_MIN using cmn instructions.
Chad Rosier [Thu, 15 Mar 2012 21:40:23 +0000 (21:40 +0000)]
[fast-isel] Don't try to encode LONG_MIN using cmn instructions.
rdar://11038907

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152847 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM case-insensitive checking for APSR_nzcv.
Jim Grosbach [Thu, 15 Mar 2012 21:34:14 +0000 (21:34 +0000)]
ARM case-insensitive checking for APSR_nzcv.

rdar://11056591

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152846 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWe actually handle AllocaInst via getRegForValue below just fine.
Eric Christopher [Thu, 15 Mar 2012 21:33:47 +0000 (21:33 +0000)]
We actually handle AllocaInst via getRegForValue below just fine.

Part of rdar://8905263

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152845 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd some debugging output into fast isel as well.
Eric Christopher [Thu, 15 Mar 2012 21:33:44 +0000 (21:33 +0000)]
Add some debugging output into fast isel as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152844 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd another debug statement.
Eric Christopher [Thu, 15 Mar 2012 21:33:41 +0000 (21:33 +0000)]
Add another debug statement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152843 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTabs.
Eric Christopher [Thu, 15 Mar 2012 21:33:39 +0000 (21:33 +0000)]
Tabs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152842 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTypo.
Eric Christopher [Thu, 15 Mar 2012 21:33:35 +0000 (21:33 +0000)]
Typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152841 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake MnemonicTable const again. That part of r152202 was OK.
Jakob Stoklund Olesen [Thu, 15 Mar 2012 21:22:53 +0000 (21:22 +0000)]
Make MnemonicTable const again. That part of r152202 was OK.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152840 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM aliases for pre-unified syntax fcmpz[sd] mnemonics.
Jim Grosbach [Thu, 15 Mar 2012 20:48:18 +0000 (20:48 +0000)]
ARM aliases for pre-unified syntax fcmpz[sd] mnemonics.

rdar://11056647

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152834 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't assume all mnemonics fit in 64k.
Jakob Stoklund Olesen [Thu, 15 Mar 2012 20:44:06 +0000 (20:44 +0000)]
Don't assume all mnemonics fit in 64k.

We currently assume that all targets have less than 64k opcodes. We
shouldn't limit it further.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152833 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoline endings
Matt Beaumont-Gay [Thu, 15 Mar 2012 20:24:29 +0000 (20:24 +0000)]
line endings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152832 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoType sizes and fields offsets inside structs are unsigned. This is a highly
Duncan Sands [Thu, 15 Mar 2012 20:14:42 +0000 (20:14 +0000)]
Type sizes and fields offsets inside structs are unsigned.  This is a highly
theoretical fix since it only matters for types with >= 2^63 bits (!) and also
only matters if pointers have more than 64 bits, which is not supported anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152831 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse vmov.f32 to materialize f32 consts on ARM. This relaxes constraints on
Lang Hames [Thu, 15 Mar 2012 18:49:02 +0000 (18:49 +0000)]
Use vmov.f32 to materialize f32 consts on ARM. This relaxes constraints on
register allocation by allowing all 32 D-registers to be used. Patch by Cameron
Zwarich.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152824 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r152202: "Use uint16_t to store InstrNameIndices in MCInstrInfo."
Jakob Stoklund Olesen [Thu, 15 Mar 2012 18:05:57 +0000 (18:05 +0000)]
Revert r152202: "Use uint16_t to store InstrNameIndices in MCInstrInfo."

We cannot limit the concatenated instruction names to 64K.  ARM is
already at 32K, and it is easy to imagine a target with more
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152817 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r152105: "Use uint16_t to store indices into string table"
Jakob Stoklund Olesen [Thu, 15 Mar 2012 18:05:54 +0000 (18:05 +0000)]
Revert r152105: "Use uint16_t to store indices into string table"

This patch limited the concatenated register names to 64K which meant
that the total number of registers was many times less than 64K.

If any compilers actually enforce the 64K limit on string literals, and
it turns out to be a problem, we should fix that problem by not using
long string literals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152816 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix VCVT decoding (between floating-point and fixed-point, Floating-point). Patch...
Kristof Beyls [Thu, 15 Mar 2012 17:50:29 +0000 (17:50 +0000)]
Fix VCVT decoding (between floating-point and fixed-point, Floating-point).  Patch by Richard Barton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152814 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix bug found by warning.
Michael J. Spencer [Thu, 15 Mar 2012 17:49:29 +0000 (17:49 +0000)]
Fix bug found by warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152812 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoShort term fix for pr12270 before we change dominates to handle unreachable
Rafael Espindola [Thu, 15 Mar 2012 15:52:59 +0000 (15:52 +0000)]
Short term fix for pr12270 before we change dominates to handle unreachable
code.
While here, reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152803 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse an iterator instead of calling .size() on the worklist every time, which is wasteful.
Bill Wendling [Thu, 15 Mar 2012 11:19:41 +0000 (11:19 +0000)]
Use an iterator instead of calling .size() on the worklist every time, which is wasteful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152794 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement relocation-overflow behavior for PE/COFF.
Michael J. Spencer [Thu, 15 Mar 2012 09:03:03 +0000 (09:03 +0000)]
Implement relocation-overflow behavior for PE/COFF.

This needs a test, but it will take some time to figure
out the best way to get an input that will produce > 2^16 relocs.

Patch by Graydon Hoare!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152787 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen optimizing certain BUILD_VECTOR nodes into other BUILD_VECTOR nodes, add the...
Nadav Rotem [Thu, 15 Mar 2012 08:49:06 +0000 (08:49 +0000)]
When optimizing certain BUILD_VECTOR nodes into other BUILD_VECTOR nodes, add the new node into the work list because there is a potential for further optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152784 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert the removal of DW_AT_MIPS_linkage_name when we aren't putting
Eric Christopher [Thu, 15 Mar 2012 08:19:33 +0000 (08:19 +0000)]
Revert the removal of DW_AT_MIPS_linkage_name when we aren't putting
out the DW_AT_name. Older gdbs unfortunately still use it to
disambiguate member functions in templated classes (gdb.cp/templates.exp).

rdar://11043421 (which is now deferred for a bit)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152782 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFollow-up to r152620: restore JIT event listener tests to unittest/ExecutionEngine/JIT
Eli Bendersky [Thu, 15 Mar 2012 06:49:31 +0000 (06:49 +0000)]
Follow-up to r152620: restore JIT event listener tests to unittest/ExecutionEngine/JIT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152780 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a xform to the DAG combiner.
Bill Wendling [Thu, 15 Mar 2012 05:12:00 +0000 (05:12 +0000)]
Add a xform to the DAG combiner.

Transform:

        (fsub x, (fadd x, y)) -> (fneg y) and
        (fsub x, (fadd y, x)) -> (fneg y)

if 'unsafe math' is specified.
<rdar://problem/7540295>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152777 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove the basic inliner. This was added in 2007, and hasn't really
Chandler Carruth [Thu, 15 Mar 2012 01:37:56 +0000 (01:37 +0000)]
Remove the basic inliner. This was added in 2007, and hasn't really
changed since. No one was using it. It is yet another consumer of the
InlineCost interface that I'd like to change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152769 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake the swap code here a bit more obvious what its doing... We're
Chandler Carruth [Thu, 15 Mar 2012 00:55:51 +0000 (00:55 +0000)]
Make the swap code here a bit more obvious what its doing... We're
essentially sorting the pair's arguments. I'd love to actually call sort
here, but I'm just not that crazy. ;]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152764 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't assume that the arguments are processed in some particular order.
Chandler Carruth [Thu, 15 Mar 2012 00:50:21 +0000 (00:50 +0000)]
Don't assume that the arguments are processed in some particular order.
This appears to not be the case with dragonegg at least in some
contexts. Hopefully will fix the bootstrap assert failure there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152763 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[avx] Add patterns for VINSERTF128rm.
Chad Rosier [Thu, 15 Mar 2012 00:45:30 +0000 (00:45 +0000)]
[avx] Add patterns for VINSERTF128rm.

This results in things such as

vmovaps -96(%rbx), %xmm1
vinsertf128 $1, %xmm1, %ymm0, %ymm0

to be combined to

vinsertf128 $1, -96(%rbx), %ymm0, %ymm0

rdar://10643481

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152762 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThis pass didn't want the inline cost per-se, it just wants generic code
Chandler Carruth [Thu, 15 Mar 2012 00:29:10 +0000 (00:29 +0000)]
This pass didn't want the inline cost per-se, it just wants generic code
metrics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152760 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove all remnants of partial specialization in the cost computation
Chandler Carruth [Thu, 15 Mar 2012 00:29:08 +0000 (00:29 +0000)]
Remove all remnants of partial specialization in the cost computation
side of things. This is all dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152759 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed a transform crash when setting a negative size value for memset. Fixes PR12202.
Aaron Ballman [Thu, 15 Mar 2012 00:05:31 +0000 (00:05 +0000)]
Fixed a transform crash when setting a negative size value for memset.  Fixes PR12202.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152756 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[tsan] use FunctionBlackList
Kostya Serebryany [Wed, 14 Mar 2012 23:33:24 +0000 (23:33 +0000)]
[tsan] use FunctionBlackList

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152755 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[asan] rename class BlackList to FunctionBlackList and move it into a separate file...
Kostya Serebryany [Wed, 14 Mar 2012 23:22:10 +0000 (23:22 +0000)]
[asan] rename class BlackList to FunctionBlackList and move it into a separate file -- we will need the same functionality in ThreadSanitizer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152753 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExtend the inline cost calculation to account for bonuses due to
Chandler Carruth [Wed, 14 Mar 2012 23:19:53 +0000 (23:19 +0000)]
Extend the inline cost calculation to account for bonuses due to
correlated pairs of pointer arguments at the callsite. This is designed
to recognize the common C++ idiom of begin/end pointer pairs when the
end pointer is a constant offset from the begin pointer. With the
C-based idiom of a pointer and size, the inline cost saw the constant
size calculation, and this provides the same level of information for
begin/end pairs.

In order to propagate this information we have to search for candidate
operations on a pair of pointer function arguments (or derived from
them) which would be simplified if the pointers had a known constant
offset. Then the callsite analysis looks for such pointer pairs in the
argument list, and applies the appropriate bonus.

This helps LLVM detect that half of bounds-checked STL algorithms
(such as hash_combine_range, and some hybrid sort implementations)
disappear when inlined with a constant size input. However, it's not
a complete fix due the inaccuracy of our cost metric for constants in
general. I'm looking into that next.

Benchmarks showed no significant code size change, and very minor
performance changes. However, specific code such as hashing is showing
significantly cleaner inlining decisions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152752 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen an invoke is marked with metadata indicating its unwind edge
Dan Gohman [Wed, 14 Mar 2012 23:05:06 +0000 (23:05 +0000)]
When an invoke is marked with metadata indicating its unwind edge
should be ignored by ARC optimization, don't insert new ARC runtime
calls in the unwind destination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152748 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixes the MSVC build.
Francois Pichet [Wed, 14 Mar 2012 22:36:10 +0000 (22:36 +0000)]
Fixes the MSVC build.
Commit r152704 exposed a latent MSVC limitation (aka bug).
Both ilist and and iplist contains the same function:
  template<class InIt> void insert(iterator where, InIt first, InIt last) {
    for (; first != last; ++first) insert(where, *first);
  }

Also ilist inherits from iplist and ilist contains a "using iplist<NodeTy>::insert".
MSVC doesn't know which one to pick and complain with an error.

I think it is safe to delete ilist::insert since it is redundant anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152746 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoChange where we enable the heuristic that delays inlining into functions
Chandler Carruth [Wed, 14 Mar 2012 20:16:41 +0000 (20:16 +0000)]
Change where we enable the heuristic that delays inlining into functions
which are small enough to themselves be inlined. Delaying in this manner
can be harmful if the function is inelligible for inlining in some (or
many) contexts as it pessimizes the code of the function itself in the
event that inlining does not eventually happen.

Previously the check was written to only do this delaying of inlining
for static functions in the hope that they could be entirely deleted and
in the knowledge that all callers of static functions will have the
opportunity to inline if it is in fact profitable. However, with C++ we
get two other important sources of functions where the definition is
always available for inlining: inline functions and templated functions.
This patch generalizes the inliner to allow linkonce-ODR (the linkage
such C++ routines receive) to also qualify for this delay-based
inlining.

Benchmarking across a range of large real-world applications shows
roughly 2% size increase across the board, but an average speedup of
about 0.5%. Some benhcmarks improved over 2%, and the 'clang' binary
itself (when bootstrapped with this feature) shows a 1% -O0 performance
improvement when run over all Sema, Lex, and Parse source code smashed
into a single file. A clean re-build of Clang+LLVM with a bootstrapped
Clang shows approximately 2% improvement, but that measurement is often
noisy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152737 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSome typos in lit command guide
Eli Bendersky [Wed, 14 Mar 2012 11:34:19 +0000 (11:34 +0000)]
Some typos in lit command guide

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152712 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSilence operator precedence warnings.
Benjamin Kramer [Wed, 14 Mar 2012 11:26:37 +0000 (11:26 +0000)]
Silence operator precedence warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152711 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate the "hello world" example to resemble what we currently output.
Bill Wendling [Wed, 14 Mar 2012 08:07:43 +0000 (08:07 +0000)]
Update the "hello world" example to resemble what we currently output.
Also do some minor reformatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152707 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRefactor the inline cost bonus calculation for constants to use
Chandler Carruth [Wed, 14 Mar 2012 07:32:53 +0000 (07:32 +0000)]
Refactor the inline cost bonus calculation for constants to use
a worklist rather than a recursive call.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152706 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReapply r152486 with a fix for the nightly testers.
Bill Wendling [Wed, 14 Mar 2012 07:28:01 +0000 (07:28 +0000)]
Reapply r152486 with a fix for the nightly testers.

There were cases where a value could be used and it's both crossing an invoke
and NOT crossing an invoke. This could happen in the landing pads. In that case,
we will demote the value to the stack like we did before.
<rdar://problem/10609139>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152705 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoInsert the debugging instructions in one fell-swoop so that it doesn't call the
Bill Wendling [Wed, 14 Mar 2012 07:14:25 +0000 (07:14 +0000)]
Insert the debugging instructions in one fell-swoop so that it doesn't call the
expensive "getFirstTerminator" call. This reduces the time of compilation in
PR12258 from >10 minutes to < 10 seconds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152704 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoClean up removed file after r152620
Eli Bendersky [Wed, 14 Mar 2012 06:16:57 +0000 (06:16 +0000)]
Clean up removed file after r152620

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152703 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTypo in lit command guide
Eli Bendersky [Wed, 14 Mar 2012 06:09:20 +0000 (06:09 +0000)]
Typo in lit command guide

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152702 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomisched: implemented a framework for top-down or bottom-up scheduling.
Andrew Trick [Wed, 14 Mar 2012 04:00:41 +0000 (04:00 +0000)]
misched: implemented a framework for top-down or bottom-up scheduling.

New flags: -misched-topdown, -misched-bottomup. They can be used with
the default scheduler or with -misched=shuffle. Without either
topdown/bottomup flag -misched=shuffle now alternates scheduling
direction.

LiveIntervals update is unimplemented with bottom-up scheduling, so
only -misched-topdown currently works.

Capped the ScheduleDAG hierarchy with a concrete ScheduleDAGMI class.
ScheduleDAGMI is aware of the top and bottom of the unscheduled zone
within the current region. Scheduling policy can be plugged into
the ScheduleDAGMI driver by implementing MachineSchedStrategy.
ConvergingScheduler is now the default scheduling algorithm.
It exercises the new driver but still does no reordering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152700 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomisched comments
Andrew Trick [Wed, 14 Mar 2012 04:00:38 +0000 (04:00 +0000)]
misched comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152699 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove the DW_AT_MIPS_linkage name attribute when we don't need it
Eric Christopher [Wed, 14 Mar 2012 02:59:17 +0000 (02:59 +0000)]
Remove the DW_AT_MIPS_linkage name attribute when we don't need it
output (we're emitting a specification already and the information
isn't changing).

Saves 1% on the debug information for a build of llvm.

Fixes rdar://11043421

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152697 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove APInt::operator[] inline.
Benjamin Kramer [Wed, 14 Mar 2012 00:38:15 +0000 (00:38 +0000)]
Move APInt::operator[] inline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152692 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove APInt::operator! inline, it's small and fuses well with surrounding code when...
Benjamin Kramer [Wed, 14 Mar 2012 00:01:35 +0000 (00:01 +0000)]
Move APInt::operator! inline, it's small and fuses well with surrounding code when inlined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152688 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFortify r152675 a bit. Although I'm not able to come up with a test case that would...
Evan Cheng [Tue, 13 Mar 2012 22:16:11 +0000 (22:16 +0000)]
Fortify r152675 a bit. Although I'm not able to come up with a test case that would trigger the truncation case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152678 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDAG combine incorrectly optimize (i32 vextract (v4i16 load $addr), c) to
Evan Cheng [Tue, 13 Mar 2012 22:00:52 +0000 (22:00 +0000)]
DAG combine incorrectly optimize (i32 vextract (v4i16 load $addr), c) to
(i16 load $addr+c*sizeof(i16)) and replace uses of (i32 vextract) with the
i16 load. It should issue an extload instead: (i32 extload $addr+c*sizeof(i16)).

rdar://11035895

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152675 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTarget override to allow CodeGenPrepare to sink address operands to intrinsics in...
Pete Cooper [Tue, 13 Mar 2012 20:59:56 +0000 (20:59 +0000)]
Target override to allow CodeGenPrepare to sink address operands to intrinsics in the same way it current does for loads and stores

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152666 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a sanity check in MemoryBuffer::getOpenFile() to make sure we don't hang
Argyrios Kyrtzidis [Tue, 13 Mar 2012 20:18:42 +0000 (20:18 +0000)]
Add a sanity check in MemoryBuffer::getOpenFile() to make sure we don't hang
if the passed in FileSize is inaccurate.

rdar://11034179

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152662 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove an old hack for pre-2005 MSVC. We don't support ancient microsoft compilers...
Benjamin Kramer [Tue, 13 Mar 2012 20:07:36 +0000 (20:07 +0000)]
Remove an old hack for pre-2005 MSVC. We don't support ancient microsoft compilers anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152659 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agos/SjLjEHPass/SjLjEHPrepare/
Bill Wendling [Tue, 13 Mar 2012 20:04:21 +0000 (20:04 +0000)]
s/SjLjEHPass/SjLjEHPrepare/
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152658 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoChange the X86 assembler to not require a segment register on string
Kevin Enderby [Tue, 13 Mar 2012 19:47:55 +0000 (19:47 +0000)]
Change the X86 assembler to not require a segment register on string
instruction's destination operand like it does for the source operand.
Also fix a typo in the comment for X86AsmParser::isSrcOp().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152654 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoenhance jump threading to preserve TBAA information when PRE'ing loads,
Chris Lattner [Tue, 13 Mar 2012 18:07:41 +0000 (18:07 +0000)]
enhance jump threading to preserve TBAA information when PRE'ing loads,
fixing rdar://11039258, an issue that came up when inspecting clang's
bootstrapped codegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152635 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach globalopt how to evaluate an invoke with a non-void return type.
Dan Gohman [Tue, 13 Mar 2012 18:01:37 +0000 (18:01 +0000)]
Teach globalopt how to evaluate an invoke with a non-void return type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152634 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoGeneralize the "trunc(ptrtoint(x)) - trunc(ptrtoint(y)) ->
Duncan Sands [Tue, 13 Mar 2012 14:07:05 +0000 (14:07 +0000)]
Generalize the "trunc(ptrtoint(x)) - trunc(ptrtoint(y)) ->
trunc(ptrtoint(x-y))" optimization introduced by Chandler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152626 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed comments for SwitchInst::addCase and for SwitchInst::removeCase.
Stepan Dyatkovskiy [Tue, 13 Mar 2012 12:37:10 +0000 (12:37 +0000)]
Fixed comments for SwitchInst::addCase and for SwitchInst::removeCase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152624 91177308-0d34-0410-b5e6-96231b3b80d8