oota-llvm.git
12 years agoThumb2 asm aliases for wide bitwise w/ immediate instructions.
Jim Grosbach [Fri, 24 Feb 2012 19:06:05 +0000 (19:06 +0000)]
Thumb2 asm aliases for wide bitwise w/ immediate instructions.

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

12 years agofix PR12075, a regression in a recent transform I added. In unreachable code, gep...
Chris Lattner [Fri, 24 Feb 2012 19:01:58 +0000 (19:01 +0000)]
fix PR12075, a regression in a recent transform I added.  In unreachable code, gep chains can be infinite.  Just like "stripPointerCasts", use a set to keep track of visited instructions so we don't recurse infinitely.

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

12 years agoAdd WIN_FTOL_* psudo-instructions to model the unique calling convention
Michael J. Spencer [Fri, 24 Feb 2012 19:01:22 +0000 (19:01 +0000)]
Add WIN_FTOL_* psudo-instructions to model the unique calling convention
used by the Win32 _ftol2 runtime function. Patch by Joe Groff!

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

12 years agoAdd a -stress-regalloc=<N> option.
Jakob Stoklund Olesen [Fri, 24 Feb 2012 18:34:20 +0000 (18:34 +0000)]
Add a -stress-regalloc=<N> option.

This will limit all register classes to N registers in order to stress
test register allocation.

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

12 years agoX11/X2 loads around indirect calls on ppc64 should not be deleted.
Hal Finkel [Fri, 24 Feb 2012 17:54:01 +0000 (17:54 +0000)]
X11/X2 loads around indirect calls on ppc64 should not be deleted.

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

12 years agoDon't crash when a glue node contains an internal CopyToReg
Hal Finkel [Fri, 24 Feb 2012 17:53:59 +0000 (17:53 +0000)]
Don't crash when a glue node contains an internal CopyToReg

This is necessary to support the existing ppc lowering code for indirect calls.
Fixes PR12071.

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

12 years agoTeach GVN that x+y is the same as y+x and that x<y is the same as y>x.
Duncan Sands [Fri, 24 Feb 2012 15:16:31 +0000 (15:16 +0000)]
Teach GVN that x+y is the same as y+x and that x<y is the same as y>x.

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

12 years agoSDAGBuilder: Remove register sets that were never read and prune dead code surroundin...
Benjamin Kramer [Fri, 24 Feb 2012 14:01:17 +0000 (14:01 +0000)]
SDAGBuilder: Remove register sets that were never read and prune dead code surrounding it.

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

12 years agotest commit. removing unnecessary whitespace.
Kristof Beyls [Fri, 24 Feb 2012 13:52:45 +0000 (13:52 +0000)]
test commit. removing unnecessary whitespace.

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

12 years agotest/CodeGen/X86/2012-02-23-mmx-inlineasm.ll: Fixup to add -march=x86.
NAKAMURA Takumi [Fri, 24 Feb 2012 13:29:50 +0000 (13:29 +0000)]
test/CodeGen/X86/2012-02-23-mmx-inlineasm.ll: Fixup to add -march=x86.

-mcpu does not choose arch automatically, on non-x86 hosts.

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

12 years agoRemove dead code.
Richard Osborne [Fri, 24 Feb 2012 11:49:08 +0000 (11:49 +0000)]
Remove dead code.

Patch by Ahmed Charles

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

12 years agoWorkaround a miscompilation by gcc-4.3 that showed up as a failure
Duncan Sands [Fri, 24 Feb 2012 09:01:34 +0000 (09:01 +0000)]
Workaround a miscompilation by gcc-4.3 that showed up as a failure
of the StringRef.Split2 unittest on 32 bit machines.

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

12 years agoScheduleDAGInstrs.h:155: warning: suggest parentheses around `&&' within `||'.
Nick Lewycky [Fri, 24 Feb 2012 07:59:05 +0000 (07:59 +0000)]
ScheduleDAGInstrs.h:155: warning: suggest parentheses around `&&' within `||'.

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

12 years agoPostRA sched: speed up physreg tracking by not abusing SparseSet.
Andrew Trick [Fri, 24 Feb 2012 07:04:55 +0000 (07:04 +0000)]
PostRA sched: speed up physreg tracking by not abusing SparseSet.

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

12 years agoARM Thumb symbol references in assembly need the low bit set.
Jim Grosbach [Fri, 24 Feb 2012 05:12:18 +0000 (05:12 +0000)]
ARM Thumb symbol references in assembly need the low bit set.

Add support for a missed case when the symbols in a difference
expression are in the same section but not the same fragment.

rdar://10924681

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

12 years agoTurn avx insert intrinsic calls into INSERT_SUBVECTOR DAG nodes and remove duplicate...
Pete Cooper [Fri, 24 Feb 2012 03:51:49 +0000 (03:51 +0000)]
Turn avx insert intrinsic calls into INSERT_SUBVECTOR DAG nodes and remove duplicate patterns for selecting the intrinsics

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

12 years agocomment fix
Jia Liu [Fri, 24 Feb 2012 02:17:26 +0000 (02:17 +0000)]
comment fix

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

12 years agosome comment fix
Jia Liu [Fri, 24 Feb 2012 02:15:57 +0000 (02:15 +0000)]
some comment fix

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

12 years agocomment fix
Jia Liu [Fri, 24 Feb 2012 02:15:21 +0000 (02:15 +0000)]
comment fix

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

12 years agoreplace a balnk with -
Jia Liu [Fri, 24 Feb 2012 02:05:28 +0000 (02:05 +0000)]
replace a balnk with -

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

12 years agoIf the Address of a variable is an argument then treat the entire
Eric Christopher [Fri, 24 Feb 2012 01:59:08 +0000 (01:59 +0000)]
If the Address of a variable is an argument then treat the entire
variable declaration as an argument because we want that address
anyhow for our debug information.

This seems to fix rdar://9965111, at least we have more debug
information than before and from reading the assembly it appears
to be the correct location.

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

12 years agoTabs, formatting and long lines oh my!
Eric Christopher [Fri, 24 Feb 2012 01:59:01 +0000 (01:59 +0000)]
Tabs, formatting and long lines oh my!

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

12 years ago80 columns of Mips InstPrinter Makefile
Jia Liu [Fri, 24 Feb 2012 01:47:01 +0000 (01:47 +0000)]
80 columns of Mips InstPrinter Makefile

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

12 years agoSwitch ARM target to register masks.
Jakob Stoklund Olesen [Fri, 24 Feb 2012 01:19:29 +0000 (01:19 +0000)]
Switch ARM target to register masks.

I'll let the buildbots determine the compile time improvements from this
change, but 464.h264ref has 5% faster codegen at -O2.

This patch does cause some assembly changes.  Branch folding can make
different decisions about calls with dead return values.
CriticalAntiDepBreaker may choose different registers because its
liveness tracking is affected.  MachineCopyPropagation may sometimes
leave a dead copy behind.

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

12 years agoMake sure the regs are low regs for tMUL size reduction.
Jim Grosbach [Fri, 24 Feb 2012 00:53:11 +0000 (00:53 +0000)]
Make sure the regs are low regs for tMUL size reduction.

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

12 years agoThumb2 size reduction fix for tied operands of tMUL.
Jim Grosbach [Fri, 24 Feb 2012 00:33:36 +0000 (00:33 +0000)]
Thumb2 size reduction fix for tied operands of tMUL.

The tied source operand of tMUL is the second source operand, not the
first like every other two-address thumb instruction. Special case it
in the size reduction pass to make sure we create the tMUL instruction
properly.

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

12 years agoEE/Interpreter/ExternalFunctions.cpp: Staticize lle_X_() entries. They can be mapped...
NAKAMURA Takumi [Fri, 24 Feb 2012 00:20:08 +0000 (00:20 +0000)]
EE/Interpreter/ExternalFunctions.cpp: Staticize lle_X_() entries. They can be mapped in FuncNames[] at the initialization.

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

12 years agoEE/Interpreter/ExternalFunctions.cpp: Prune "C" linkage to suppress warnings with...
NAKAMURA Takumi [Fri, 24 Feb 2012 00:19:58 +0000 (00:19 +0000)]
EE/Interpreter/ExternalFunctions.cpp: Prune "C" linkage to suppress warnings with -Wreturn-type (and MSC's w4190).

In historical reason, Interpreter's external entries had prefix "lle_X_" as C linkage, even for well-known entries in EE/Interpreter.
Now, at least on ToT, they are resolved via FuncNames[] mapper.
We will not need their symbols are expected to be exported any more.

Clang r150128 has introduced the warning <"%0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C">.

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

12 years agoWhen emitting a cmp with 0 for a lowered select, mask out the high
Dan Gohman [Fri, 24 Feb 2012 00:09:36 +0000 (00:09 +0000)]
When emitting a cmp with 0 for a lowered select, mask out the high
bits of the value carying the boolean condition, as their contents
are undefined. This fixes rdar://10887484.

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

12 years agoRelease not for ARM integrated assembler support.
Jim Grosbach [Thu, 23 Feb 2012 23:52:06 +0000 (23:52 +0000)]
Release not for ARM integrated assembler support.

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

12 years agoAllow an integer to be converted into an MMX type when it's used in an inline
Bill Wendling [Thu, 23 Feb 2012 23:25:25 +0000 (23:25 +0000)]
Allow an integer to be converted into an MMX type when it's used in an inline
asm.
<rdar://problem/10106006>

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

12 years agoTypo.
Chad Rosier [Thu, 23 Feb 2012 23:21:22 +0000 (23:21 +0000)]
Typo.

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

12 years agoEmit global ctors into .CRT$XCU instead of .ctors on Win32. Patch by Joe Groff!
Michael J. Spencer [Thu, 23 Feb 2012 21:56:08 +0000 (21:56 +0000)]
Emit global ctors into .CRT$XCU instead of .ctors on Win32. Patch by Joe Groff!

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

12 years agoThe LLVM Getting Started documentation is out of date. It would be nice if
Chad Rosier [Thu, 23 Feb 2012 21:23:24 +0000 (21:23 +0000)]
The LLVM Getting Started documentation is out of date.  It would be nice if
someone could update this, but for now at least reference the Clang Getting
Started document, which is much more current.

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

12 years agoBump SmallString to the minimum required amount for raw_ostream to avoid allocation.
Benjamin Kramer [Thu, 23 Feb 2012 21:15:21 +0000 (21:15 +0000)]
Bump SmallString to the minimum required amount for raw_ostream to avoid allocation.

It's is a bit annoying, we should hide this implementation detail better.

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

12 years agoReplace a DenseSet with SmallPtrSet.
Benjamin Kramer [Thu, 23 Feb 2012 20:53:02 +0000 (20:53 +0000)]
Replace a DenseSet with SmallPtrSet.

SmallSet of pointer is the same as SmallPtrSet, use the latter directly.

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

12 years agoMCize function entry label emission on PowerPC64 properly.
Roman Divacky [Thu, 23 Feb 2012 20:28:39 +0000 (20:28 +0000)]
MCize function entry label emission on PowerPC64 properly.

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

12 years agoBitVectorize loop.
Benjamin Kramer [Thu, 23 Feb 2012 19:29:25 +0000 (19:29 +0000)]
BitVectorize loop.

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

12 years agopost-ra-sched: Turn the KillIndices vector into a bitvector, it only stored two meani...
Benjamin Kramer [Thu, 23 Feb 2012 19:15:40 +0000 (19:15 +0000)]
post-ra-sched: Turn the KillIndices vector into a bitvector, it only stored two meaningful states.

Rename it to LiveRegs to make it more clear what's stored inside.

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

12 years agopost-ra-sched: Replace a std::set of regs with a bitvector.
Benjamin Kramer [Thu, 23 Feb 2012 18:28:32 +0000 (18:28 +0000)]
post-ra-sched: Replace a std::set of regs with a bitvector.

Assuming that a single std::set node adds 3 control words, a bitvector
can store (3*8+4)*8=224 registers in the allocated memory of a single
element in the std::set (x86_64). Also we don't have to call malloc
for every register added.

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

12 years agoUpdated the llvm-mc disassembler C API to support for the X86 target.
Kevin Enderby [Thu, 23 Feb 2012 18:18:17 +0000 (18:18 +0000)]
Updated the llvm-mc disassembler C API to support for the X86 target.
rdar://10873652

As part of this I updated the llvm-mc disassembler C API to always call the
SymbolLookUp call back even if there is no getOpInfo call back.  If there is a
getOpInfo call back that is tried first and then if that gets no information
then the  SymbolLookUp is called.  I also made the code more robust by
memset(3)'ing to zero the LLVMOpInfo1 struct before then setting
SymbolicOp.Value before for the call to getOpInfo.  And also don't use any
values from the  LLVMOpInfo1 struct if getOpInfo returns 0.  And also don't
use any of the ReferenceType or ReferenceName values from SymbolLookUp if it
returns NULL. rdar://10873563 and rdar://10873683

For the X86 target also fixed bugs so the annotations get printed.

Also fixed a few places in the ARM target that was not producing symbolic
operands for some instructions.  rdar://10878166

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

12 years agoFix the numbering of some of the registers and reclassify a couple of them.
Brendon Cahoon [Thu, 23 Feb 2012 18:17:17 +0000 (18:17 +0000)]
Fix the numbering of some of the registers and reclassify a couple of them.
Also, some basic clean up.  Patch by Evandro Menezes.

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

12 years agoMake calls scheduling boundaries post-ra.
Jakob Stoklund Olesen [Thu, 23 Feb 2012 17:54:21 +0000 (17:54 +0000)]
Make calls scheduling boundaries post-ra.

Before register allocation, instructions can be moved across calls in
order to reduce register pressure.  After register allocation, we don't
gain a lot by moving callee-saved defs across calls.  In fact, since the
scheduler doesn't have a good idea how registers are used in the callee,
it can't really make good scheduling decisions.

This changes the schedule in two ways: 1. Latencies to call uses and
defs are no longer accounted for, causing some random shuffling around
calls.  This isn't really a problem since those uses and defs are
inaccurate proxies for what happens inside the callee.  They don't
represent registers used by the call instruction itself.

2. Instructions are no longer moved across calls.  This didn't happen
very often, and the scheduling decision was made on dubious information
anyway.

As with any scheduling change, benchmark numbers shift around a bit,
but there is no positive or negative trend from this change.

This makes the post-ra scheduler 5% faster for ARM targets.

The secret motivation for this patch is the introduction of register
mask operands representing call clobbers.  The most efficient way of
handling regmasks in ScheduleDAGInstrs is to model them as barriers for
physreg live ranges, but not for virtreg live ranges.  That's fine
pre-ra, but post-ra it would have the same effect as this patch.

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

12 years agoReflow code, no functionality change.
Benjamin Kramer [Thu, 23 Feb 2012 17:42:19 +0000 (17:42 +0000)]
Reflow code, no functionality change.

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

12 years agoMake tests less sensitive to scheduling changes.
Jakob Stoklund Olesen [Thu, 23 Feb 2012 17:19:34 +0000 (17:19 +0000)]
Make tests less sensitive to scheduling changes.

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

12 years agoStrip a layer of boilerplate from the VLIWPacketizer by storing the scheduler as...
Benjamin Kramer [Thu, 23 Feb 2012 13:39:13 +0000 (13:39 +0000)]
Strip a layer of boilerplate from the VLIWPacketizer by storing the scheduler as an opaque pointer.

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

12 years agoRemove unused variable.
Duncan Sands [Thu, 23 Feb 2012 11:01:22 +0000 (11:01 +0000)]
Remove unused variable.

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

12 years agoFix to make sure that a comdat group gets generated correctly for a static member
Anton Korobeynikov [Thu, 23 Feb 2012 10:36:04 +0000 (10:36 +0000)]
Fix to make sure that a comdat group gets generated correctly for a static member
of instantiated C++ templates.

Patch by Kristof Beyls!

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

12 years agoUpdate for the removal of Hashing.cpp.
Jay Foad [Thu, 23 Feb 2012 09:33:44 +0000 (09:33 +0000)]
Update for the removal of Hashing.cpp.

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

12 years agoReinstate r151049 now that GeneralHash is fixed.
Jay Foad [Thu, 23 Feb 2012 09:17:40 +0000 (09:17 +0000)]
Reinstate r151049 now that GeneralHash is fixed.

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

12 years agoThe implementation of GeneralHash::addBits broke C++ aliasing rules; fix
Jay Foad [Thu, 23 Feb 2012 09:16:04 +0000 (09:16 +0000)]
The implementation of GeneralHash::addBits broke C++ aliasing rules; fix
it with memcpy. This also fixes a problem on big-endian hosts, where
addUnaligned would return different results depending on the alignment
of the data.

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

12 years agoRemove 'if' from getSuperRegisters, getSubRegisters, and getOverlaps that were added...
Craig Topper [Thu, 23 Feb 2012 08:42:06 +0000 (08:42 +0000)]
Remove 'if' from getSuperRegisters, getSubRegisters, and getOverlaps that were added in r151038.

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

12 years agoAn easy case where GCC should really be able to work out that the value is only
Duncan Sands [Thu, 23 Feb 2012 08:25:25 +0000 (08:25 +0000)]
An easy case where GCC should really be able to work out that the value is only
used if IsInDevelopmentTree is 'true'.  But it doesn't, so help it out.

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

12 years agoGCC warns about a comparison between signed and unsigned values.
Duncan Sands [Thu, 23 Feb 2012 08:23:53 +0000 (08:23 +0000)]
GCC warns about a comparison between signed and unsigned values.

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

12 years agoGCC fails to understand that NextBB is always initialized if EvaluateBlock
Duncan Sands [Thu, 23 Feb 2012 08:23:06 +0000 (08:23 +0000)]
GCC fails to understand that NextBB is always initialized if EvaluateBlock
returns 'true' and emits a warning.  Help it out.

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

12 years agoFix typo.
Rafael Espindola [Thu, 23 Feb 2012 05:38:51 +0000 (05:38 +0000)]
Fix typo.

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

12 years agoMore newline cleanups.
Eric Christopher [Thu, 23 Feb 2012 03:39:43 +0000 (03:39 +0000)]
More newline cleanups.

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

12 years agoAdd some handy-dandy newlines.
Eric Christopher [Thu, 23 Feb 2012 03:39:39 +0000 (03:39 +0000)]
Add some handy-dandy newlines.

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

12 years agomisched: cleanup reaching def computation
Andrew Trick [Thu, 23 Feb 2012 03:16:24 +0000 (03:16 +0000)]
misched: cleanup reaching def computation

Ignore undef uses completely.
Use a more explicit SlotIndex API.
Add more explicit comments.

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

12 years agoCanonicalize (srl (bswap x), 16) to (rotr (bswap x), 16) if the high 16 bits
Evan Cheng [Thu, 23 Feb 2012 02:58:19 +0000 (02:58 +0000)]
Canonicalize (srl (bswap x), 16) to (rotr (bswap x), 16) if the high 16 bits
of x are zero. This optimizes rev + lsr 16 to rev16.

rdar://10750814

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

12 years agoPostRASched: Convert physreg def/use tracking to Jakob's SparseSet.
Andrew Trick [Thu, 23 Feb 2012 01:52:38 +0000 (01:52 +0000)]
PostRASched: Convert physreg def/use tracking to Jakob's SparseSet.

Added array subscript to SparseSet for convenience.
Slight reorg to make it easier to manage the def/use sets.

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

12 years agoHandle regmasks in FixupKills.
Jakob Stoklund Olesen [Thu, 23 Feb 2012 01:22:15 +0000 (01:22 +0000)]
Handle regmasks in FixupKills.

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

12 years agoOptimize a couple of common patterns involving conditional moves where the false
Evan Cheng [Thu, 23 Feb 2012 01:19:06 +0000 (01:19 +0000)]
Optimize a couple of common patterns involving conditional moves where the false
value is zero. Instead of a cmov + op, issue an conditional op instead. e.g.
    cmp   r9, r4
    mov   r4, #0
    moveq r4, #1
    orr   lr, lr, r4

should be:
    cmp   r9, r4
    orreq lr, lr, #1

That is, optimize (or x, (cmov 0, y, cond)) to (or.cond x, y). Similarly extend
this to xor as well as (and x, (cmov -1, y, cond)) => (and.cond x, y).

It's possible to extend this to ADD and SUB but I don't think they are common.

rdar://8659097

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

12 years agoHandle regmasks in CriticalAntiDepBreaker.
Jakob Stoklund Olesen [Thu, 23 Feb 2012 01:15:26 +0000 (01:15 +0000)]
Handle regmasks in CriticalAntiDepBreaker.

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

12 years agoTrack reserved registers separately from RegsAvailable.
Jakob Stoklund Olesen [Thu, 23 Feb 2012 01:13:32 +0000 (01:13 +0000)]
Track reserved registers separately from RegsAvailable.

The bulk masking operations from register mask operands don't account
for reserved registers.

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

12 years agoMC: Fix the MCNullStreamer which was broken in r147763.
Daniel Dunbar [Wed, 22 Feb 2012 23:49:50 +0000 (23:49 +0000)]
MC: Fix the MCNullStreamer which was broken in r147763.

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

12 years agoDon't compute latencies for regmask operands.
Jakob Stoklund Olesen [Wed, 22 Feb 2012 22:52:52 +0000 (22:52 +0000)]
Don't compute latencies for regmask operands.

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

12 years agoHandle regmasks in RegisterScavenging.
Jakob Stoklund Olesen [Wed, 22 Feb 2012 22:50:14 +0000 (22:50 +0000)]
Handle regmasks in RegisterScavenging.

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

12 years agomisched: Use SparseSet for VRegDegs for constant time clear().
Andrew Trick [Wed, 22 Feb 2012 21:59:00 +0000 (21:59 +0000)]
misched: Use SparseSet for VRegDegs for constant time clear().

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

12 years agoAllow the use of an alternate symbol for calculating a function's size.
Hal Finkel [Wed, 22 Feb 2012 21:11:47 +0000 (21:11 +0000)]
Allow the use of an alternate symbol for calculating a function's size.

The standard function epilog includes a .size directive, but ppc64 uses
an alternate local symbol to tag the actual start of each function.

Until recently, binutils accepted the .size directive as:
 .size test1, .Ltmp0-test1
however, using this directive with recent binutils will result in the error:
 .size expression for XXX does not evaluate to a constant
so we must use the label which actually tags the start of the function.

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

12 years agoRemove bad comma from .el file.
Bill Wendling [Wed, 22 Feb 2012 19:38:03 +0000 (19:38 +0000)]
Remove bad comma from .el file.

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

12 years agolibclc is now dual licensed, Tobias and Peter own their respective subprojects.
Chris Lattner [Wed, 22 Feb 2012 19:17:20 +0000 (19:17 +0000)]
libclc is now dual licensed, Tobias and Peter own their respective subprojects.

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

12 years agoProperly emit _fltused with FastISel. Refactor to share code with SDAG.
Michael J. Spencer [Wed, 22 Feb 2012 19:06:13 +0000 (19:06 +0000)]
Properly emit _fltused with FastISel. Refactor to share code with SDAG.
Patch by Joe Groff!

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

12 years agoComment from code review
Andrew Trick [Wed, 22 Feb 2012 18:34:49 +0000 (18:34 +0000)]
Comment from code review

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

12 years agoRemove extra semi-colons.
Chad Rosier [Wed, 22 Feb 2012 17:25:00 +0000 (17:25 +0000)]
Remove extra semi-colons.

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

12 years ago80 col.
Jakob Stoklund Olesen [Wed, 22 Feb 2012 16:50:46 +0000 (16:50 +0000)]
80 col.

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

12 years agoEfficient pattern for store truncate. Patch by Evandro Menezes.
Sirish Pande [Wed, 22 Feb 2012 16:45:10 +0000 (16:45 +0000)]
Efficient pattern for store truncate. Patch by Evandro Menezes.

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

12 years agoAdd Foreach Loop
David Greene [Wed, 22 Feb 2012 16:09:41 +0000 (16:09 +0000)]
Add Foreach Loop

Add some data structures to represent for loops.  These will be
referenced during object processing to do any needed iteration and
instantiation.

Add foreach keyword support to the lexer.

Add a mode to indicate that we're parsing a foreach loop.  This allows
the value parser to early-out when processing the foreach value list.

Add a routine to parse foreach iteration declarations.  This is
separate from ParseDeclaration because the type of the named value
(the iterator) doesn't match the type of the initializer value (the
value list).  It also needs to add two values to the foreach record:
the iterator and the value list.

Add parsing support for foreach.

Add the code to process foreach loops and create defs based
on iterator values.

Allow foreach loops to be matched at the top level.

When parsing an IDValue check if it is a foreach loop iterator for one
of the active loops.  If so, return a VarInit for it.

Add Emacs keyword support for foreach.

Add VIM keyword support for foreach.

Add tests to check foreach operation.

Add TableGen documentation for foreach.

Support foreach with multiple objects.

Support non-braced foreach body with one object.

Do not require types for the foreach declaration.  Assume the iterator
type from the iteration list element type.

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

12 years agoFix typos.
Jakob Stoklund Olesen [Wed, 22 Feb 2012 16:01:54 +0000 (16:01 +0000)]
Fix typos.

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

12 years agoRemove static ctor.
Benjamin Kramer [Wed, 22 Feb 2012 13:42:11 +0000 (13:42 +0000)]
Remove static ctor.

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

12 years agoSupport was removed from LLVM's MIPS backend for the PSP variant of that
Chandler Carruth [Wed, 22 Feb 2012 11:32:54 +0000 (11:32 +0000)]
Support was removed from LLVM's MIPS backend for the PSP variant of that
chip in r139383, and the PSP components of the triple are really
annoying to parse. Let's leave this chapter behind. There is no reason
to expect LLVM to see a PSP-related triple these days, and so no
reasonable motivation to support them.

It might be reasonable to prune a few of the older MIPS triple forms in
general, but as those at least cause no burden on parsing (they aren't
both a chip and an OS!), I'm happy to leave them in for now.

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

12 years agoOnly add DW_AT_prototyped if we're working with a C-like language.
Eric Christopher [Wed, 22 Feb 2012 08:46:21 +0000 (08:46 +0000)]
Only add DW_AT_prototyped if we're working with a C-like language.
Worth another 45k (1%) off of a large C++ testcase.

rdar://10909458

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

12 years agoAdd the source language into the compile unit.
Eric Christopher [Wed, 22 Feb 2012 08:46:13 +0000 (08:46 +0000)]
Add the source language into the compile unit.

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

12 years agoRemove extra semi-colon.
Eric Christopher [Wed, 22 Feb 2012 08:46:02 +0000 (08:46 +0000)]
Remove extra semi-colon.

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

12 years agoDeclare register classes as const. Fix a couple pointers to register classes that...
Craig Topper [Wed, 22 Feb 2012 07:28:11 +0000 (07:28 +0000)]
Declare register classes as const. Fix a couple pointers to register classes that weren't already const.

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

12 years agomisched: DAG builder should not track dependencies for SSA defs.
Andrew Trick [Wed, 22 Feb 2012 06:08:13 +0000 (06:08 +0000)]
misched: DAG builder should not track dependencies for SSA defs.

The vast majority of virtual register definitions don't need an entry
in the DAG builder's VRegDefs set.

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

12 years agoInitialize SUnits before DAG building.
Andrew Trick [Wed, 22 Feb 2012 06:08:11 +0000 (06:08 +0000)]
Initialize SUnits before DAG building.

Affect on SD scheduling and postRA scheduling:
Printing the DAG will display the nodes in top-down topological order.
This matches the order within the MBB and makes my life much easier in general.

Affect on misched:
We don't need to track virtual register uses at all. This is awesome.
I also intend to rely on the SUnit ID as a topo-sort index. So if A < B then we cannot have an edge B -> A.

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

12 years agoMake all pointers to TargetRegisterClass const since they are all pointers to static...
Craig Topper [Wed, 22 Feb 2012 05:59:10 +0000 (05:59 +0000)]
Make all pointers to TargetRegisterClass const since they are all pointers to static data that should not be modified.

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

12 years agoImprove comment. Thanks for Andrew for the suggestion.
Rafael Espindola [Wed, 22 Feb 2012 03:44:46 +0000 (03:44 +0000)]
Improve comment. Thanks for Andrew for the suggestion.

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

12 years agoSemantically revert 151015. Add a comment on why we should be able to assert
Rafael Espindola [Wed, 22 Feb 2012 03:21:39 +0000 (03:21 +0000)]
Semantically revert 151015. Add a comment on why we should be able to assert
the dominance once the dominates method is fixed and why we can use the builder's
insertion point.
Fixes pr12048.

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

12 years agoAdding support for Microsoft's thiscall calling convention. LLVM side of the patch.
Aaron Ballman [Wed, 22 Feb 2012 03:04:40 +0000 (03:04 +0000)]
Adding support for Microsoft's thiscall calling convention.  LLVM side of the patch.

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

12 years agoImprove handling of blockaddresses in bugpoint when splitting a module. Patch by...
Eli Friedman [Wed, 22 Feb 2012 01:43:47 +0000 (01:43 +0000)]
Improve handling of blockaddresses in bugpoint when splitting a module.  Patch by Daniel Reynaud.

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

12 years agoADT/SparseSet.h: Fix up header dependencies.
NAKAMURA Takumi [Wed, 22 Feb 2012 01:19:35 +0000 (01:19 +0000)]
ADT/SparseSet.h: Fix up header dependencies.

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

12 years agoClarify ARM calling conventions.
Jakob Stoklund Olesen [Wed, 22 Feb 2012 01:07:19 +0000 (01:07 +0000)]
Clarify ARM calling conventions.

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

12 years agoUse SparseSet for the RAFast live virtual register map.
Jakob Stoklund Olesen [Wed, 22 Feb 2012 01:02:37 +0000 (01:02 +0000)]
Use SparseSet for the RAFast live virtual register map.

This makes RAFast 4% faster, and it gets rid of the dodgy DenseMap
iteration.

This also revealed that RAFast would sometimes dereference DenseMap
iterators after erasing other elements from the map. That does seem to
work in the current DenseMap implementation, but SparseSet doesn't allow
it.

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

12 years agoAdd a Briggs and Torczon sparse set implementation.
Jakob Stoklund Olesen [Wed, 22 Feb 2012 00:56:08 +0000 (00:56 +0000)]
Add a Briggs and Torczon sparse set implementation.

For objects that can be identified by small unsigned keys, SparseSet
provides constant time clear() and fast deterministic iteration. Insert,
erase, and find operations are typically faster than hash tables.

SparseSet is useful for keeping information about physical registers,
virtual registers, or numbered basic blocks.

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

12 years agoUse a function in MathExtras to do sign extension.
Akira Hatanaka [Wed, 22 Feb 2012 00:16:54 +0000 (00:16 +0000)]
Use a function in MathExtras to do sign extension.

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

12 years agoRemove a bad PowerPC test.
Jakob Stoklund Olesen [Tue, 21 Feb 2012 23:49:18 +0000 (23:49 +0000)]
Remove a bad PowerPC test.

This test case was way too strict, matching the entire assembly output.
Every non-trivial change to the ppc backend  or -O0 pipeline required
the test to be updated.

It should be replaced with a test of the specific vaarg feature.

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

12 years agoCalls don't really change the stack pointer.
Jakob Stoklund Olesen [Tue, 21 Feb 2012 23:47:43 +0000 (23:47 +0000)]
Calls don't really change the stack pointer.

Even if a call instruction has %SP<imp-def> operands, it doesn't change
the value of the stack pointer.

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

12 years agoAdd API "handleMoveIntoBundl" for updating liveness when moving instructions into
Lang Hames [Tue, 21 Feb 2012 22:29:38 +0000 (22:29 +0000)]
Add API "handleMoveIntoBundl" for updating liveness when moving instructions into
bundles. This method takes a bundle start and an MI being bundled, and makes
the intervals for the MI's operands appear to start/end on the bundle start.

Also fixes some minor cosmetic issues (whitespace, naming convention) in the
HMEditor code.

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