oota-llvm.git
13 years agoThe expression icmp eq (select (icmp eq x, 0), 1, x), 0 folds to false.
Duncan Sands [Fri, 28 Oct 2011 19:01:20 +0000 (19:01 +0000)]
The expression icmp eq (select (icmp eq x, 0), 1, x), 0 folds to false.
Spotted by my super-optimizer in 186.crafty and 450.soplex.  We really
need a proper infrastructure for handling generalizations of this kind
of thing (which occur a lot), however this case is so simple that I decided
to go ahead and implement it directly.

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

13 years agoAdd variable IsO32 to MipsTargetLowering.
Akira Hatanaka [Fri, 28 Oct 2011 18:47:24 +0000 (18:47 +0000)]
Add variable IsO32 to MipsTargetLowering.

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

13 years agoA shift of a power of two is a power of two or zero.
Duncan Sands [Fri, 28 Oct 2011 18:30:05 +0000 (18:30 +0000)]
A shift of a power of two is a power of two or zero.
For completeness - not spotted in the wild.

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

13 years agoFold icmp ugt (udiv X, Y), X to false. Spotted by my super-optimizer
Duncan Sands [Fri, 28 Oct 2011 18:17:44 +0000 (18:17 +0000)]
Fold icmp ugt (udiv X, Y), X to false.  Spotted by my super-optimizer
in 186.crafty.

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

13 years agoReapply r143202, with a manual decoding hook for SWP. This change inadvertantly...
Owen Anderson [Fri, 28 Oct 2011 18:02:13 +0000 (18:02 +0000)]
Reapply r143202, with a manual decoding hook for SWP.  This change inadvertantly exposed a decoding ambiguity between SWP and CPS that the auto-generated decoder can't handle.

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

13 years agoReapply r143177 and r143179 (reverting r143188), with scheduler
Dan Gohman [Fri, 28 Oct 2011 17:55:38 +0000 (17:55 +0000)]
Reapply r143177 and r143179 (reverting r143188), with scheduler
fixes: Use a separate register, instead of SP, as the
calling-convention resource, to avoid spurious conflicts with
actual uses of SP. Also, fix unscheduling of calling sequences,
which can be triggered by pseudo-two-address dependencies.

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

13 years agoRevert r143202.
Owen Anderson [Fri, 28 Oct 2011 17:38:30 +0000 (17:38 +0000)]
Revert r143202.

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

13 years agoSpecify fixed bits on CPS instructions to enable roundtripping.
Owen Anderson [Fri, 28 Oct 2011 17:29:39 +0000 (17:29 +0000)]
Specify fixed bits on CPS instructions to enable roundtripping.

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

13 years agoThumb2 ADD/SUB instructions encoding selection outside IT block.
Jim Grosbach [Fri, 28 Oct 2011 16:57:07 +0000 (16:57 +0000)]
Thumb2 ADD/SUB instructions encoding selection outside IT block.

Outside an IT block, "add r3, #2" should select a 32-bit wide encoding
rather than generating an error indicating the 16-bit encoding is only
legal in an IT block (outside, the 'S' suffic is required for the 16-bit
encoding).

rdar://10348481

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

13 years agoAllow register classes to match a containing class in InstAliases.
Jim Grosbach [Fri, 28 Oct 2011 16:43:40 +0000 (16:43 +0000)]
Allow register classes to match a containing class in InstAliases.

If the register class in the source alias is a subclass of the register class
of the actual instruction, the alias can still match OK since the constraints
are strictly a subset of what the instruction can actually handle.

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

13 years agotest/MC/AsmParser/2011-09-06-NoNewline.s: Add explicit -mtriple=i386. It uses X86...
NAKAMURA Takumi [Fri, 28 Oct 2011 14:12:30 +0000 (14:12 +0000)]
test/MC/AsmParser/2011-09-06-NoNewline.s: Add explicit -mtriple=i386. It uses X86 instruction.

FIXME: Would it be reproduced without target-specific operands?
FIXME: Why run llvm-mc as the same input by 3 times?

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

13 years agoDwarf: [PR11022] Fix emitting DW_AT_const_value(>i64), to be host-endian-neutral.
NAKAMURA Takumi [Fri, 28 Oct 2011 14:12:22 +0000 (14:12 +0000)]
Dwarf: [PR11022] Fix emitting DW_AT_const_value(>i64), to be host-endian-neutral.

Don't assume APInt::getRawData() would hold target-aware endianness nor host-compliant endianness. rawdata[0] holds most lower i64, even on big endian host.

FIXME: Add a testcase for big endian target.

FIXME: Ditto on CompileUnit::addConstantFPValue() ?

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

13 years agouint64 formatted output: replaced %llx with PRIx64 macro.
Stepan Dyatkovskiy [Fri, 28 Oct 2011 13:07:32 +0000 (13:07 +0000)]
uint64 formatted output: replaced %llx with PRIx64 macro.

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

13 years agoUse BranchProbability compare operators.
Benjamin Kramer [Fri, 28 Oct 2011 11:14:31 +0000 (11:14 +0000)]
Use BranchProbability compare operators.

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

13 years agotest/CodeGen/X86/2010-08-10-DbgConstant.ll: Add explicit -mtriple=i686-linux. It...
NAKAMURA Takumi [Fri, 28 Oct 2011 10:50:52 +0000 (10:50 +0000)]
test/CodeGen/X86/2010-08-10-DbgConstant.ll: Add explicit -mtriple=i686-linux. It must be for elf!

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

13 years agoSpeculatively disable Dan's commits 143177 and 143179 to see if
Duncan Sands [Fri, 28 Oct 2011 09:55:57 +0000 (09:55 +0000)]
Speculatively disable Dan's commits 143177 and 143179 to see if
it fixes the dragonegg self-host (it looks like gcc is miscompiled).
Original commit messages:
Eliminate LegalizeOps' LegalizedNodes map and have it just call RAUW
on every node as it legalizes them. This makes it easier to use
hasOneUse() heuristics, since unneeded nodes can be removed from the
DAG earlier.

Make LegalizeOps visit the DAG in an operands-last order. It previously
used operands-first, because LegalizeTypes has to go operands-first, and
LegalizeTypes used to be part of LegalizeOps, but they're now split.
The operands-last order is more natural for several legalization tasks.
For example, it allows lowering code for nodes with floating-point or
vector constants to see those constants directly instead of seeing the
lowered form (often constant-pool loads). This makes some things
somewhat more complicated today, though it ought to allow things to be
simpler in the future. It also fixes some bugs exposed by Legalizing
using RAUW aggressively.

Remove the part of LegalizeOps that attempted to patch up invalid chain
operands on libcalls generated by LegalizeTypes, since it doesn't work
with the new LegalizeOps traversal order. Instead, define what
LegalizeTypes is doing to be correct, and transfer the responsibility
of keeping calls from having overlapping calling sequences into the
scheduler.

Teach the scheduler to model callseq_begin/end pairs as having a
physical register definition/use to prevent calls from having
overlapping calling sequences. This is also somewhat complicated, though
there are ways it might be simplified in the future.

This addresses rdar://9816668, rdar://10043614, rdar://8434668, and others.
Please direct high-level questions about this patch to management.

Delete #if 0 code accidentally left in.

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

13 years agoAlways use the string pool, even when it makes the .o larger. This may help
Nick Lewycky [Fri, 28 Oct 2011 05:29:47 +0000 (05:29 +0000)]
Always use the string pool, even when it makes the .o larger. This may help
tools that read the debug info in the .o files by making the DIE sizes more
consistent.

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

13 years agoLFTR should avoid a type mismatch with null pointer IVs.
Andrew Trick [Fri, 28 Oct 2011 03:45:11 +0000 (03:45 +0000)]
LFTR should avoid a type mismatch with null pointer IVs.

Fixes rdar://10359193 Indvar LinearFunctionTestReplace assertion

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

13 years agoDelete #if 0 code accidentally left in.
Dan Gohman [Fri, 28 Oct 2011 01:41:21 +0000 (01:41 +0000)]
Delete #if 0 code accidentally left in.

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

13 years agoEliminate LegalizeOps' LegalizedNodes map and have it just call RAUW
Dan Gohman [Fri, 28 Oct 2011 01:29:32 +0000 (01:29 +0000)]
Eliminate LegalizeOps' LegalizedNodes map and have it just call RAUW
on every node as it legalizes them. This makes it easier to use
hasOneUse() heuristics, since unneeded nodes can be removed from the
DAG earlier.

Make LegalizeOps visit the DAG in an operands-last order. It previously
used operands-first, because LegalizeTypes has to go operands-first, and
LegalizeTypes used to be part of LegalizeOps, but they're now split.
The operands-last order is more natural for several legalization tasks.
For example, it allows lowering code for nodes with floating-point or
vector constants to see those constants directly instead of seeing the
lowered form (often constant-pool loads). This makes some things
somewhat more complicated today, though it ought to allow things to be
simpler in the future. It also fixes some bugs exposed by Legalizing
using RAUW aggressively.

Remove the part of LegalizeOps that attempted to patch up invalid chain
operands on libcalls generated by LegalizeTypes, since it doesn't work
with the new LegalizeOps traversal order. Instead, define what
LegalizeTypes is doing to be correct, and transfer the responsibility
of keeping calls from having overlapping calling sequences into the
scheduler.

Teach the scheduler to model callseq_begin/end pairs as having a
physical register definition/use to prevent calls from having
overlapping calling sequences. This is also somewhat complicated, though
there are ways it might be simplified in the future.

This addresses rdar://9816668, rdar://10043614, rdar://8434668, and others.
Please direct high-level questions about this patch to management.

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

13 years agoHave llvm-config --cppflags print correct flags when in CMake build directory
Peter Collingbourne [Fri, 28 Oct 2011 01:02:16 +0000 (01:02 +0000)]
Have llvm-config --cppflags print correct flags when in CMake build directory

Previously, if invoked from a CMake build directory, 'llvm-config
--cppflags' and friends would only print a -I flag for the build
directory's header search path, because it would assume that it was
already installed, not recognising its parent directory as being the
build directory.  Teach llvm-config about CMake build directories
so that it prints a -I for both the source and build directory's
search paths.

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

13 years agoARM Allow 'q' registers in VLD/VST vector lists.
Jim Grosbach [Fri, 28 Oct 2011 00:06:50 +0000 (00:06 +0000)]
ARM Allow 'q' registers in VLD/VST vector lists.

Just treat it as if the constituent D registers where specified.

rdar://10348896

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

13 years agoRemove the Alpha backend.
Dan Gohman [Thu, 27 Oct 2011 22:56:32 +0000 (22:56 +0000)]
Remove the Alpha backend.

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

13 years agoAdd testcase for r143162.
Owen Anderson [Thu, 27 Oct 2011 22:54:14 +0000 (22:54 +0000)]
Add testcase for r143162.

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

13 years agoAdd some NEON stores to the VLD decoding hook that were accidentally omitted previously.
Owen Anderson [Thu, 27 Oct 2011 22:53:10 +0000 (22:53 +0000)]
Add some NEON stores to the VLD decoding hook that were accidentally omitted previously.

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

13 years agoAlso set addrmode6 alignment when align==size.
Jakob Stoklund Olesen [Thu, 27 Oct 2011 22:39:16 +0000 (22:39 +0000)]
Also set addrmode6 alignment when align==size.

Previously, we were only setting the alignment bits on over-aligned
loads and stores.

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

13 years agoThe default alias analysis is -noaa; update the docs to reflect that. Patch by Micha...
Eli Friedman [Thu, 27 Oct 2011 22:32:13 +0000 (22:32 +0000)]
The default alias analysis is -noaa; update the docs to reflect that.  Patch by Michael Ilseman.

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

13 years agoARM isel for vld1, opcode selection for register stride post-index pseudos.
Jim Grosbach [Thu, 27 Oct 2011 22:25:42 +0000 (22:25 +0000)]
ARM isel for vld1, opcode selection for register stride post-index pseudos.

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

13 years agoDelete dead code. Nothing ever instantiates this.
Jim Grosbach [Thu, 27 Oct 2011 21:59:17 +0000 (21:59 +0000)]
Delete dead code. Nothing ever instantiates this.

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

13 years agoRevert r143149, stubbing out symbolic disassembly support. The symbolic disassembly...
Owen Anderson [Thu, 27 Oct 2011 21:55:13 +0000 (21:55 +0000)]
Revert r143149, stubbing out symbolic disassembly support.  The symbolic disassembly support is too MC-engrained to be useful in llvm-objdump.

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

13 years agoIf we're searching for a symbol reference to pretty-print a scattered relocation...
Owen Anderson [Thu, 27 Oct 2011 21:53:50 +0000 (21:53 +0000)]
If we're searching for a symbol reference to pretty-print a scattered relocation address, and we don't find a symbol table entry, try section begin addresses as well.

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

13 years agoStub out support for symbol disassembly in llvm-objdump.
Owen Anderson [Thu, 27 Oct 2011 21:46:31 +0000 (21:46 +0000)]
Stub out support for symbol disassembly in llvm-objdump.

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

13 years agoprojects/sample: Switch over to imported Makefile setup.
Daniel Dunbar [Thu, 27 Oct 2011 21:25:09 +0000 (21:25 +0000)]
projects/sample: Switch over to imported Makefile setup.
 - This will require you to manually reconfigure the projects/sample project (by running projects/config/sample/config.status --recheck) if you haven't updated/built since the 1st part of this commit went in.

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

13 years agoAvoid partial CPSR dependency from loop backedges. rdar://10357570
Evan Cheng [Thu, 27 Oct 2011 21:21:05 +0000 (21:21 +0000)]
Avoid partial CPSR dependency from loop backedges. rdar://10357570

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

13 years agotests: Rip out a bunch of now unused test code relating to use of llvm-gcc in LLVM...
Daniel Dunbar [Thu, 27 Oct 2011 20:59:26 +0000 (20:59 +0000)]
tests: Rip out a bunch of now unused test code relating to use of llvm-gcc in LLVM tests.

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

13 years agotests: Remove llvm2cpp, I'm pretty sure no one uses this.
Daniel Dunbar [Thu, 27 Oct 2011 20:59:21 +0000 (20:59 +0000)]
tests: Remove llvm2cpp, I'm pretty sure no one uses this.

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

13 years agolit: Drop some unneeded code from example tests.
Daniel Dunbar [Thu, 27 Oct 2011 20:59:19 +0000 (20:59 +0000)]
lit: Drop some unneeded code from example tests.
 - Also, cleanup site.exp files in example tests.

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

13 years agoFix pretty printing of i386 local sect diff relocations, TLV relocations, and x86_64...
Owen Anderson [Thu, 27 Oct 2011 20:46:09 +0000 (20:46 +0000)]
Fix pretty printing of i386 local sect diff relocations, TLV relocations, and x86_64 TLV relocations in MachO.

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

13 years agoAdd a pinned metadata name for fpaccuracy, and document it
Peter Collingbourne [Thu, 27 Oct 2011 19:19:14 +0000 (19:19 +0000)]
Add a pinned metadata name for fpaccuracy, and document it

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

13 years agoDocument tbaa metadata in LangRef (documentation largely based on
Peter Collingbourne [Thu, 27 Oct 2011 19:19:07 +0000 (19:19 +0000)]
Document tbaa metadata in LangRef (documentation largely based on
comments at top of TypeBasedAliasAnalysis.cpp).

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

13 years agoReapply commit 143028 with a fix: the problem was casting a ConstantExpr Mul
Duncan Sands [Thu, 27 Oct 2011 19:16:21 +0000 (19:16 +0000)]
Reapply commit 143028 with a fix: the problem was casting a ConstantExpr Mul
using BinaryOperator (which only works for instructions) when it should have
been a cast to OverflowingBinaryOperator (which also works for constants).
While there, correct a few other dubious looking uses of BinaryOperator.
Thanks to Chad Rosier for the testcase.  Original commit message:
My super-optimizer noticed that we weren't folding this expression to
true: (x *nsw x) sgt 0, where x = (y | 1).  This occurs in 464.h264ref.

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

13 years agoFixed llvm-objdump uint64_t formatted output.
Stepan Dyatkovskiy [Thu, 27 Oct 2011 18:40:45 +0000 (18:40 +0000)]
Fixed llvm-objdump uint64_t formatted output.

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

13 years ago2>&1 doesn't work here, it just creates an empty file called "&1"
Benjamin Kramer [Thu, 27 Oct 2011 18:27:45 +0000 (18:27 +0000)]
2>&1 doesn't work here, it just creates an empty file called "&1"

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

13 years agoChanged test to check for correct load size instead of shift as the shift might chang...
Pete Cooper [Thu, 27 Oct 2011 18:15:58 +0000 (18:15 +0000)]
Changed test to check for correct load size instead of shift as the shift might change if optimised

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

13 years agoTrailing whitespace.
Jim Grosbach [Thu, 27 Oct 2011 17:44:01 +0000 (17:44 +0000)]
Trailing whitespace.

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

13 years agoChange the sysexit mnemonic (and sysexitl) to never have the REX.W prefix and
Kevin Enderby [Thu, 27 Oct 2011 17:40:41 +0000 (17:40 +0000)]
Change the sysexit mnemonic (and sysexitl) to never have the REX.W prefix and
not depend on In32BitMode.  Use the sysexitq mnemonic for the version with the
REX.W prefix and only allow it only In64BitMode.  rdar://9738584

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

13 years agoThumb2 t2LDMDB[_UPD] assembly parsing to recognize .w suffix.
Jim Grosbach [Thu, 27 Oct 2011 17:33:59 +0000 (17:33 +0000)]
Thumb2 t2LDMDB[_UPD] assembly parsing to recognize .w suffix.

rdar://10348844

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

13 years agoExpose relocation accessors through the libObject C API.
Owen Anderson [Thu, 27 Oct 2011 17:32:36 +0000 (17:32 +0000)]
Expose relocation accessors through the libObject C API.

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

13 years agoThumb2 t2MVNi assembly parsing to recognize ".w" suffix.
Jim Grosbach [Thu, 27 Oct 2011 17:16:55 +0000 (17:16 +0000)]
Thumb2 t2MVNi assembly parsing to recognize ".w" suffix.

rdar://10348584

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

13 years agoAdd relocation iterators to the libObject C API.
Owen Anderson [Thu, 27 Oct 2011 17:15:47 +0000 (17:15 +0000)]
Add relocation iterators to the libObject C API.

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

13 years agoBlockFrequency: Use a smarter overflow check.
Benjamin Kramer [Thu, 27 Oct 2011 16:38:50 +0000 (16:38 +0000)]
BlockFrequency: Use a smarter overflow check.

This trades one 64 bit div for one 64 bit mul and some arithmetic.

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

13 years agoRevert Duncan's r143028 expression folding which appears to be the culprit
Bob Wilson [Thu, 27 Oct 2011 15:47:25 +0000 (15:47 +0000)]
Revert Duncan's r143028 expression folding which appears to be the culprit
behind a compile failure on 483.xalancbmk.

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

13 years agoLLLexer: Factor hex char parsing.
Benjamin Kramer [Thu, 27 Oct 2011 14:08:01 +0000 (14:08 +0000)]
LLLexer: Factor hex char parsing.

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

13 years agoTeach our Dwarf emission to use the string pool.
Nick Lewycky [Thu, 27 Oct 2011 06:44:11 +0000 (06:44 +0000)]
Teach our Dwarf emission to use the string pool.

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

13 years agoDon't crash on 128-bit sdiv by constant. Found by inspection.
Eli Friedman [Thu, 27 Oct 2011 02:06:39 +0000 (02:06 +0000)]
Don't crash on 128-bit sdiv by constant.  Found by inspection.

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

13 years agoIt is not safe to sink an alloca into a stacksave/stackrestore pair, so don't do...
Eli Friedman [Thu, 27 Oct 2011 01:33:51 +0000 (01:33 +0000)]
It is not safe to sink an alloca into a stacksave/stackrestore pair, so don't do that. <rdar://problem/10352360>

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

13 years agoA branch predicated on a constant can just FastEmit an unconditional branch.
Chad Rosier [Thu, 27 Oct 2011 00:21:16 +0000 (00:21 +0000)]
A branch predicated on a constant can just FastEmit an unconditional branch.

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

13 years agoRename NonScalarIntSafe to something more appropriate.
Lang Hames [Wed, 26 Oct 2011 23:50:43 +0000 (23:50 +0000)]
Rename NonScalarIntSafe to something more appropriate.

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

13 years agoAdd a TODO comment. FastISel works by parsing each basic block from the bottom
Chad Rosier [Wed, 26 Oct 2011 23:34:37 +0000 (23:34 +0000)]
Add a TODO comment.  FastISel works by parsing each basic block from the bottom
up.  Thus, improving the support for compares is goodness because it increases
the number of terminator instructions we can handle.  This creates many more
opportunities for target specific fast-isel.

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

13 years agoFactor a little more code into EmitCmp, which should have been done in the first
Chad Rosier [Wed, 26 Oct 2011 23:25:44 +0000 (23:25 +0000)]
Factor a little more code into EmitCmp, which should have been done in the first
place.  No functional change intended.

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

13 years agoUse EmitCmp in SelectBranch. No functional change intended.
Chad Rosier [Wed, 26 Oct 2011 23:17:28 +0000 (23:17 +0000)]
Use EmitCmp in SelectBranch.  No functional change intended.

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

13 years agoReflow lines, fix comments for doxygen style, fix whitespace. No functionality
Nick Lewycky [Wed, 26 Oct 2011 22:55:33 +0000 (22:55 +0000)]
Reflow lines, fix comments for doxygen style, fix whitespace. No functionality
change.

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

13 years agoAdd include-what-you-use to the External Projects list.
Bill Wendling [Wed, 26 Oct 2011 22:55:18 +0000 (22:55 +0000)]
Add include-what-you-use to the External Projects list.

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

13 years agoFactor out an EmitCmp function that can be used by both SelectCmp and
Chad Rosier [Wed, 26 Oct 2011 22:47:55 +0000 (22:47 +0000)]
Factor out an EmitCmp function that can be used by both SelectCmp and
SelectBranch.  No functional change intended.

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

13 years agoTrailing whitespace.
Jim Grosbach [Wed, 26 Oct 2011 22:44:41 +0000 (22:44 +0000)]
Trailing whitespace.

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

13 years agoThumb2 ldr pc-relative encoding fixes.
Jim Grosbach [Wed, 26 Oct 2011 22:22:01 +0000 (22:22 +0000)]
Thumb2 ldr pc-relative encoding fixes.

We were parsing label references to the i12 encoding, which isn't right.
They need to go to the pci variant instead.

More of rdar://10348687

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

13 years agoRun test with -verify-machineinstrs.
Rafael Espindola [Wed, 26 Oct 2011 21:20:26 +0000 (21:20 +0000)]
Run test with -verify-machineinstrs.

Patch by Sanjoy Das.

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

13 years agoFixes an issue reported by -verify-machineinstrs.
Rafael Espindola [Wed, 26 Oct 2011 21:16:41 +0000 (21:16 +0000)]
Fixes an issue reported by -verify-machineinstrs.

Patch by Sanjoy Das.

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

13 years agoARM parse parenthesized expressions for label references.
Jim Grosbach [Wed, 26 Oct 2011 21:14:08 +0000 (21:14 +0000)]
ARM parse parenthesized expressions for label references.

Partial fix for rdar://10348687.

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

13 years agoThis commit introduces two fake instructions MORESTACK_RET and
Rafael Espindola [Wed, 26 Oct 2011 21:12:27 +0000 (21:12 +0000)]
This commit introduces two fake instructions MORESTACK_RET and
MORESTACK_RET_RESTORE_R10; which are lowered to a RET and a RET
followed by a MOV respectively.  Having a fake instruction prevents
the verifier from seeing a MachineBasicBlock end with a
non-terminator (MOV).  It also prevents the rather eccentric case of a
MachineBasicBlock ending with RET but having successors nevertheless.

Patch by Sanjoy Das.

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

13 years agoMake sure short memsets on ARM lower to stores, even when optimizing for size.
Lang Hames [Wed, 26 Oct 2011 20:56:52 +0000 (20:56 +0000)]
Make sure short memsets on ARM lower to stores, even when optimizing for size.

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

13 years agoThe maximum power of 2 dividing a power of 2 is itself. This occurs
Duncan Sands [Wed, 26 Oct 2011 20:55:21 +0000 (20:55 +0000)]
The maximum power of 2 dividing a power of 2 is itself.  This occurs
in 403.gcc and was spotted by my super-optimizer.

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

13 years agoAdd support for scattered relocations to the MachO relocatation pretty printer.
Owen Anderson [Wed, 26 Oct 2011 20:42:54 +0000 (20:42 +0000)]
Add support for scattered relocations to the MachO relocatation pretty printer.

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

13 years agoSome formatting changes.
Bill Wendling [Wed, 26 Oct 2011 18:46:16 +0000 (18:46 +0000)]
Some formatting changes.

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

13 years agoOn an ELF system, ".debug_str" is mergeable and contains null terminated strings
Nick Lewycky [Wed, 26 Oct 2011 18:44:32 +0000 (18:44 +0000)]
On an ELF system, ".debug_str" is mergeable and contains null terminated strings
composed of one byte characters.

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

13 years agoAdd the blurb about the new exception handling.
Bill Wendling [Wed, 26 Oct 2011 18:33:01 +0000 (18:33 +0000)]
Add the blurb about the new exception handling.

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

13 years agoAdd clReflect to the External Projects list.
Bill Wendling [Wed, 26 Oct 2011 18:23:06 +0000 (18:23 +0000)]
Add clReflect to the External Projects list.

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

13 years agoAdd LanguageKit and Pragmatic Smalltalk to the External Projects list.
Bill Wendling [Wed, 26 Oct 2011 18:20:54 +0000 (18:20 +0000)]
Add LanguageKit and Pragmatic Smalltalk to the External Projects list.

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

13 years agoThe order of the two symbol listings in a Macho x86_64 subtractor relocation is rever...
Owen Anderson [Wed, 26 Oct 2011 17:28:49 +0000 (17:28 +0000)]
The order of the two symbol listings in a Macho x86_64 subtractor relocation is reversed from what seems intuitive to me.

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

13 years agoThumb2 remove redundant ".w" suffix from t2MVNCCi pattern.
Jim Grosbach [Wed, 26 Oct 2011 17:28:15 +0000 (17:28 +0000)]
Thumb2 remove redundant ".w" suffix from t2MVNCCi pattern.

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

13 years agoInclude the full 64 bits of relocation data in the type info for MachO relocations...
Owen Anderson [Wed, 26 Oct 2011 17:10:22 +0000 (17:10 +0000)]
Include the full 64 bits of relocation data in the type info for MachO relocations, so that we can recognize scattered relocations.

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

13 years agoExpand relocation type field to 64 bits. MachO scattered relocations require 33...
Owen Anderson [Wed, 26 Oct 2011 17:08:49 +0000 (17:08 +0000)]
Expand relocation type field to 64 bits.  MachO scattered relocations require 33 bits of type info.

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

13 years agoImprove pretty printing of GOT relocations in MachO on x86_64.
Owen Anderson [Wed, 26 Oct 2011 17:05:20 +0000 (17:05 +0000)]
Improve pretty printing of GOT relocations in MachO on x86_64.

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

13 years agoMy super-optimizer noticed that we weren't folding this expression to
Duncan Sands [Wed, 26 Oct 2011 15:31:51 +0000 (15:31 +0000)]
My super-optimizer noticed that we weren't folding this expression to
true: (x *nsw x) sgt 0, where x = (y | 1).  This occurs in 464.h264ref.

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

13 years agoSimplify SplitVecRes_UnaryOp by removing all the code that is
Duncan Sands [Wed, 26 Oct 2011 14:11:18 +0000 (14:11 +0000)]
Simplify SplitVecRes_UnaryOp by removing all the code that is
trying to legalize the operand types when only the result type
is required to be legalized - the type legalization machinery
will get round to the operands later if they need legalizing.
There can be a point to legalizing operands in parallel with
the result: when this saves compile time or results in better
code.  There was only one case in which this was true: when
the operand is also split, so keep the logic for that bit.
As a result of this change, additional operand legalization
methods may need to be introduced to handle nodes where the
result and operand types can differ, like SIGN_EXTEND, but
the testsuite doesn't contain any tests where this is the case.
In any case, it seems better to require such methods (and die
with an assert if they doesn't exist) than to quietly produce
wrong code if we forgot to special case the node in
SplitVecRes_UnaryOp.

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

13 years agoAdd ThreadSanitizer to the External Projects list.
Bill Wendling [Wed, 26 Oct 2011 09:25:01 +0000 (09:25 +0000)]
Add ThreadSanitizer to the External Projects list.

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

13 years agoRevert r142530 at least temporarily while a discussion is had on llvm-commits regardi...
James Molloy [Wed, 26 Oct 2011 08:53:19 +0000 (08:53 +0000)]
Revert r142530 at least temporarily while a discussion is had on llvm-commits regarding exactly how much optsize should optimize for size over performance.

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

13 years agoAdd ZooLib to the External Projects list.
Bill Wendling [Wed, 26 Oct 2011 07:42:45 +0000 (07:42 +0000)]
Add ZooLib to the External Projects list.

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

13 years agoAdd the Stupid D Compiler to the External Projects list.
Bill Wendling [Wed, 26 Oct 2011 07:38:19 +0000 (07:38 +0000)]
Add the Stupid D Compiler to the External Projects list.

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

13 years agoUse a worklist to prevent the iterator from becoming invalidated because of the ...
Bill Wendling [Wed, 26 Oct 2011 07:16:18 +0000 (07:16 +0000)]
Use a worklist to prevent the iterator from becoming invalidated because of the 'removeSuccessor' call. Noticed in a Release+Asserts+Check buildbot.

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

13 years agoFix grammar.
Bill Wendling [Wed, 26 Oct 2011 04:24:15 +0000 (04:24 +0000)]
Fix grammar.

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

13 years agoRemove unused variable.
Eric Christopher [Wed, 26 Oct 2011 03:47:16 +0000 (03:47 +0000)]
Remove unused variable.

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

13 years agoRevert 142997. It doesn't work on Mac OS or the BSDs, which all use the BSD
Charles Davis [Wed, 26 Oct 2011 02:28:32 +0000 (02:28 +0000)]
Revert 142997. It doesn't work on Mac OS or the BSDs, which all use the BSD
version of the install program, which does not have the --strip-program
switch.

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

13 years agoDon't use floating point to do an integer's job.
Jakob Stoklund Olesen [Wed, 26 Oct 2011 01:47:48 +0000 (01:47 +0000)]
Don't use floating point to do an integer's job.

This code makes different decisions when compiled into x87 instructions
because of different rounding behavior.  That caused phase 2/3
miscompares on 32-bit Linux when the phase 1 compiler was built with gcc
(using x87), and the phase 2 compiler was built with clang (using SSE).

This fixes PR11200.

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

13 years agoDisable LICM speculation in high register pressure situation again now that Devang...
Evan Cheng [Wed, 26 Oct 2011 01:26:57 +0000 (01:26 +0000)]
Disable LICM speculation in high register pressure situation again now that Devang has fixed other issues.

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

13 years agoRevert part of r142530. The patch potentially hurts performance especially
Evan Cheng [Wed, 26 Oct 2011 01:17:44 +0000 (01:17 +0000)]
Revert part of r142530. The patch potentially hurts performance especially
on Darwin platforms where -Os means optimize for size without hurting
performance.

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

13 years agoReapply r142920 with fix:
Bill Wendling [Wed, 26 Oct 2011 01:10:25 +0000 (01:10 +0000)]
Reapply r142920 with fix:

An MBB which branches to an EH landing pad shouldn't be considered for tail merging.

In SjLj EH, the jump to the landing pad is not done explicitly through a branch
statement. The EH landing pad is added as a successor to the throwing
BB. Because of that however, the branch folding pass could mistakenly think that
it could merge the throwing BB with another BB. This isn't safe to do.
<rdar://problem/10334833>

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

13 years agoAdd a note about the removal of the atomic intrinsics to the "Major Changes" section...
Eli Friedman [Wed, 26 Oct 2011 00:55:23 +0000 (00:55 +0000)]
Add a note about the removal of the atomic intrinsics to the "Major Changes" section of the release notes.

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

13 years agoSearch for and use the strip program and pass it to install for it
Eric Christopher [Wed, 26 Oct 2011 00:52:13 +0000 (00:52 +0000)]
Search for and use the strip program and pass it to install for it
to use for stripping final executables.

Patch by Simon Atanasyan!

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

13 years agoHandle newer cases for freebsd which is approaching 10.0 and not 1.0.
Eric Christopher [Wed, 26 Oct 2011 00:42:12 +0000 (00:42 +0000)]
Handle newer cases for freebsd which is approaching 10.0 and not 1.0.

Patch by Dimitry Andric!

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