oota-llvm.git
13 years agomore notes to self.
Chris Lattner [Tue, 5 Apr 2011 18:38:45 +0000 (18:38 +0000)]
more notes to self.

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

13 years agoConstants with multiple encodings (ARM):
Johnny Chen [Tue, 5 Apr 2011 18:02:46 +0000 (18:02 +0000)]
Constants with multiple encodings (ARM):
An alternative syntax is available for a modified immediate constant that permits the programmer to specify
the encoding directly. In this syntax, #<const> is instead written as #<byte>,#<rot>, where:

    <byte> is the numeric value of abcdefgh, in the range 0-255
    <rot> is twice the numeric value of rotation, an even number in the range 0-30.

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

13 years agoCheck for invalid register encodings for UMAAL and friends where:
Johnny Chen [Tue, 5 Apr 2011 17:43:10 +0000 (17:43 +0000)]
Check for invalid register encodings for UMAAL and friends where:
    if dLo == 15 || dHi == 15 || n == 15 || m == 15 then UNPREDICTABLE;
    if dHi == dLo then UNPREDICTABLE;

rdar://problem/9230202

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

13 years agoConvert ADCS and SBCS instructions into pseudos that are expanded to the ADC/ABC...
Owen Anderson [Tue, 5 Apr 2011 17:24:25 +0000 (17:24 +0000)]
Convert ADCS and SBCS instructions into pseudos that are expanded to the ADC/ABC with the appropriate S-bit input value.

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

13 years agoARM doesn't support byval yet. XFAIL this test until it does.
Stuart Hastings [Tue, 5 Apr 2011 17:16:21 +0000 (17:16 +0000)]
ARM doesn't support byval yet.  XFAIL this test until it does.

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

13 years agoRename LLVMConfig.cmake to LLVM-Config.cmake. The *Config.cmake naming
Oscar Fuentes [Tue, 5 Apr 2011 17:02:48 +0000 (17:02 +0000)]
Rename LLVMConfig.cmake to LLVM-Config.cmake. The *Config.cmake naming
scheme is used by the functionality related to find_package.

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

13 years agoEnsure all defs referring to a virtual register are marked dead by addRegisterDead().
Jakob Stoklund Olesen [Tue, 5 Apr 2011 16:53:50 +0000 (16:53 +0000)]
Ensure all defs referring to a virtual register are marked dead by addRegisterDead().

There can be multiple defs for a single virtual register when they are defining
sub-registers.

The missing <dead> flag was stopping the inline spiller from eliminating dead
code after rematerialization.

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

13 years agoPrint visibility info for external variables.
Rafael Espindola [Tue, 5 Apr 2011 15:51:32 +0000 (15:51 +0000)]
Print visibility info for external variables.

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

13 years agoUse std::unique instead of a SmallPtrSet to ensure unique instructions in UseSlots.
Jakob Stoklund Olesen [Tue, 5 Apr 2011 15:18:18 +0000 (15:18 +0000)]
Use std::unique instead of a SmallPtrSet to ensure unique instructions in UseSlots.

This allows us to always keep the smaller slot for an instruction which is what
we want when a register has early clobber defines.

Drop the UsingInstrs set and the UsingBlocks map. They are no longer needed.

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

13 years agoInstCombine optimizes gep(bitcast(x)) even when the bitcasts casts away address
Nadav Rotem [Tue, 5 Apr 2011 14:29:52 +0000 (14:29 +0000)]
InstCombine optimizes gep(bitcast(x)) even when the bitcasts casts away address
space info. We crash with an assert in this case. This change checks that the
address space of the bitcasted pointer is the same as the gep ptr.

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

13 years agodocs/ReleaseNotes.html: Add a few notes to MCCOFF and x64. FIXME: fixme!
NAKAMURA Takumi [Tue, 5 Apr 2011 08:24:22 +0000 (08:24 +0000)]
docs/ReleaseNotes.html: Add a few notes to MCCOFF and x64. FIXME: fixme!

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

13 years agodocs/GettingStarted.html: FIXME: dg, lit, and source tree layout.
NAKAMURA Takumi [Tue, 5 Apr 2011 08:24:15 +0000 (08:24 +0000)]
docs/GettingStarted.html: FIXME: dg, lit, and source tree layout.

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

13 years agoadd a bunch of notes to myself, this is not intended to be gramatic or
Chris Lattner [Tue, 5 Apr 2011 07:19:28 +0000 (07:19 +0000)]
add a bunch of notes to myself, this is not intended to be gramatic or
make sense to anyone else.

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

13 years agoStop precomputing last split points, query the SplitAnalysis cache on demand.
Jakob Stoklund Olesen [Tue, 5 Apr 2011 04:20:29 +0000 (04:20 +0000)]
Stop precomputing last split points, query the SplitAnalysis cache on demand.

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

13 years agoCache the fairly expensive last split point computation and provide a fast
Jakob Stoklund Olesen [Tue, 5 Apr 2011 04:20:27 +0000 (04:20 +0000)]
Cache the fairly expensive last split point computation and provide a fast
inlined path for the common case.

Most basic blocks don't contain a call that may throw, so the last split point
os simply the first terminator.

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

13 years agoRevamp the SjLj "dispatch setup" intrinsic.
Bill Wendling [Tue, 5 Apr 2011 01:37:43 +0000 (01:37 +0000)]
Revamp the SjLj "dispatch setup" intrinsic.

It needed to be moved closer to the setjmp statement, because the code directly
after the setjmp needs to know about values that are on the stack. Also, the
'bitcast' of the function context was causing a dead load. This wouldn't be too
horrible, except that at -O0 it wasn't optimized out, and because it wasn't
using the correct base pointer (if there is a VLA), it would try to access a
value from a garbage address.
<rdar://problem/9130540>

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

13 years agoFix up testcase for previous commit.
Eric Christopher [Tue, 5 Apr 2011 00:56:01 +0000 (00:56 +0000)]
Fix up testcase for previous commit.

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

13 years agoJust use BL all the time. It's safer that way.
Eric Christopher [Tue, 5 Apr 2011 00:39:26 +0000 (00:39 +0000)]
Just use BL all the time. It's safer that way.

Fixes rdar://9184526

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

13 years agoRevert 123704; it broke threaded LLVM.
Stuart Hastings [Tue, 5 Apr 2011 00:37:28 +0000 (00:37 +0000)]
Revert 123704; it broke threaded LLVM.

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

13 years agoFix register-dependent X86 tests.
Jakob Stoklund Olesen [Tue, 5 Apr 2011 00:32:44 +0000 (00:32 +0000)]
Fix register-dependent X86 tests.

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

13 years agoFix SRS/SRSW encoding bits.
Johnny Chen [Tue, 5 Apr 2011 00:16:18 +0000 (00:16 +0000)]
Fix SRS/SRSW encoding bits.
rdar://problem/9230801 ARM disassembler discrepancy: erroneously accepting SRS

Plus add invalid-RFEorLDMIA-arm.txt test which should have been checked in with
http://llvm.org/viewvc/llvm-project?view=rev&revision=128859.

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

13 years agoA8.6.105 MUL
Johnny Chen [Mon, 4 Apr 2011 23:57:05 +0000 (23:57 +0000)]
A8.6.105 MUL
Inst{15-12} should be specified as 0b0000.

rdar://problem/9231168 ARM disassembler discrepancy: erroneously accepting MUL

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

13 years agoAdd info on where to get 2.9 final svn sources.
Bill Wendling [Mon, 4 Apr 2011 23:42:51 +0000 (23:42 +0000)]
Add info on where to get 2.9 final svn sources.

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

13 years agoRFE encoding should also specify the "should be" encoding bits.
Johnny Chen [Mon, 4 Apr 2011 23:39:08 +0000 (23:39 +0000)]
RFE encoding should also specify the "should be" encoding bits.

rdar://problem/9229922 ARM disassembler discrepancy: erroneously accepting RFE

Also LDC/STC instructions are predicated while LDC2/STC2 instructions are not, fixed while
doing regression testings.

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

13 years agoAdd missing file from r128851.
Jim Grosbach [Mon, 4 Apr 2011 23:20:40 +0000 (23:20 +0000)]
Add missing file from r128851.

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

13 years agoLayer the memory manager between the JIT and the runtime Dyld.
Jim Grosbach [Mon, 4 Apr 2011 23:04:39 +0000 (23:04 +0000)]
Layer the memory manager between the JIT and the runtime Dyld.

The JITMemory manager references LLVM IR constructs directly, while the
runtime Dyld works at a lower level and can handle objects which may not
originate from LLVM IR. Introduce a new layer for the memory manager to
handle the interface between them. For the MCJIT, this layer will be almost
entirely simply a call-through w/ translation between the IR objects and
symbol names.

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

13 years agoMake OpcodeMask an unsigned long long literal to deal with overflow.
Joerg Sonnenberger [Mon, 4 Apr 2011 21:38:17 +0000 (21:38 +0000)]
Make OpcodeMask an unsigned long long literal to deal with overflow.

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

13 years agoAllow coalescing with reserved physregs in certain cases:
Jakob Stoklund Olesen [Mon, 4 Apr 2011 21:00:03 +0000 (21:00 +0000)]
Allow coalescing with reserved physregs in certain cases:

When a virtual register has a single value that is defined as a copy of a
reserved register, permit that copy to be joined. These virtual register are
usually copies of the stack pointer:

  %vreg75<def> = COPY %ESP; GR32:%vreg75
  MOV32mr %vreg75, 1, %noreg, 0, %noreg, %vreg74<kill>
  MOV32mi %vreg75, 1, %noreg, 8, %noreg, 0
  MOV32mi %vreg75<kill>, 1, %noreg, 4, %noreg, 0
  CALLpcrel32 ...

Coalescing these virtual registers early decreases register pressure.
Previously, they were coalesced by RALinScan::attemptTrivialCoalescing after
register allocation was completed.

The lower register pressure causes the mcinst-lowering-cmp0.ll test case to fail
because it depends on linear scan spilling a particular register.

I am deleting 2008-08-05-SpillerBug.ll because it is counting the number of
instructions emitted, and its revision history shows the 'correct' count being
edited many times.

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

13 years agoExtract physreg joining policy to a separate method.
Jakob Stoklund Olesen [Mon, 4 Apr 2011 20:59:59 +0000 (20:59 +0000)]
Extract physreg joining policy to a separate method.

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

13 years agoFix incorrect alignment for NEON VST2b32_UPD.
Johnny Chen [Mon, 4 Apr 2011 20:35:31 +0000 (20:35 +0000)]
Fix incorrect alignment for NEON VST2b32_UPD.

rdar://problem/9225433

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

13 years agoUpdate BreakpointPrinter to emit original function names only.
Devang Patel [Mon, 4 Apr 2011 19:51:17 +0000 (19:51 +0000)]
Update BreakpointPrinter to emit original function names only.

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

13 years agoInsert code in the right location when lowering PowerPC atomics.
Jakob Stoklund Olesen [Mon, 4 Apr 2011 17:57:29 +0000 (17:57 +0000)]
Insert code in the right location when lowering PowerPC atomics.

This causes defs to dominate uses, no instructions after terminators, and other
goodness.

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

13 years agoDisable the PowerPC/Atomics-64 test.
Jakob Stoklund Olesen [Mon, 4 Apr 2011 17:57:26 +0000 (17:57 +0000)]
Disable the PowerPC/Atomics-64 test.

The code inserted by PPCTargetLowering::EmitInstrWithCustomInserter for ppc64 is
wrong, and I don't know how to fix it. It seems to be using the correct register
classes for pointers, but it inserts all 32-bit instructions.

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

13 years agoRemove unused function.
Eric Christopher [Mon, 4 Apr 2011 17:36:11 +0000 (17:36 +0000)]
Remove unused function.

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

13 years ago- Implement asm parsing support for LDRSBT, LDRHT, LDRSHT and STRHT
Bruno Cardoso Lopes [Mon, 4 Apr 2011 17:18:19 +0000 (17:18 +0000)]
- Implement asm parsing support for LDRSBT, LDRHT, LDRSHT and STRHT
  also fix the encoding of the later.
- Add a new encoding bit to describe the index mode used in AM3.
- Teach printAddrMode3Operand to check by the addressing mode which
  index mode to print.
- Testcases.

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

13 years agosilence an unused function warning.
Chris Lattner [Mon, 4 Apr 2011 17:17:57 +0000 (17:17 +0000)]
silence an unused function warning.

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

13 years agoMove transformation of JmpLink and related nodes done during instruction selection...
Akira Hatanaka [Mon, 4 Apr 2011 17:11:07 +0000 (17:11 +0000)]
Move transformation of JmpLink and related nodes done during instruction selection to Legalize phase.

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

13 years agoPowerPC atomic pseudos clobber CR0, they don't read it.
Jakob Stoklund Olesen [Mon, 4 Apr 2011 17:07:09 +0000 (17:07 +0000)]
PowerPC atomic pseudos clobber CR0, they don't read it.

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

13 years agoUse X0 instead of R0 for the zero register on ppc64.
Jakob Stoklund Olesen [Mon, 4 Apr 2011 17:07:06 +0000 (17:07 +0000)]
Use X0 instead of R0 for the zero register on ppc64.

The 32-bit R0 cannot be used where a 64-bit register is expected.

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

13 years agoFix PowerPC tests to be register allocator independent.
Jakob Stoklund Olesen [Mon, 4 Apr 2011 17:07:03 +0000 (17:07 +0000)]
Fix PowerPC tests to be register allocator independent.

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

13 years agoAdd support for the VIA PadLock instructions.
Joerg Sonnenberger [Mon, 4 Apr 2011 16:58:13 +0000 (16:58 +0000)]
Add support for the VIA PadLock instructions.

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

13 years agoUse array_lengthof
Joerg Sonnenberger [Mon, 4 Apr 2011 16:25:38 +0000 (16:25 +0000)]
Use array_lengthof

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

13 years agoExpand Op0Mask by one bit in preparation for the PadLock prefixes.
Joerg Sonnenberger [Mon, 4 Apr 2011 15:58:30 +0000 (15:58 +0000)]
Expand Op0Mask by one bit in preparation for the PadLock prefixes.
Define most shift masks incrementally to reduce the redundant
hard-coding. Introduce new shift for the VEX flags to replace the
magic constant 32 in various places.

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

13 years agoStop caching basic block index ranges now that SlotIndexes can keep up.
Jakob Stoklund Olesen [Mon, 4 Apr 2011 15:32:15 +0000 (15:32 +0000)]
Stop caching basic block index ranges now that SlotIndexes can keep up.

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

13 years agoDelete leftover data members.
Jakob Stoklund Olesen [Mon, 4 Apr 2011 15:32:11 +0000 (15:32 +0000)]
Delete leftover data members.

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

13 years agoChange loops to derive the number of tables automatically
Joerg Sonnenberger [Mon, 4 Apr 2011 14:42:22 +0000 (14:42 +0000)]
Change loops to derive the number of tables automatically

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

13 years agoDragonegg release notes.
Duncan Sands [Mon, 4 Apr 2011 11:09:08 +0000 (11:09 +0000)]
Dragonegg release notes.

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

13 years agoRemove some support for ReturnInsts with multiple operands, and for
Jay Foad [Mon, 4 Apr 2011 07:44:02 +0000 (07:44 +0000)]
Remove some support for ReturnInsts with multiple operands, and for
returning a scalar value in a function whose return type is a single-
element structure or array.

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

13 years agoRegion: Allow user control the printing style of the print function.
Tobias Grosser [Mon, 4 Apr 2011 07:19:18 +0000 (07:19 +0000)]
Region: Allow user control the printing style of the print function.

Contributed by: etherzhhb@gmail.com

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

13 years agoIntrusiveRefCntPtr: in RefCountedBase and RefCountedBaseVPTR, make
Peter Collingbourne [Mon, 4 Apr 2011 00:57:03 +0000 (00:57 +0000)]
IntrusiveRefCntPtr: in RefCountedBase and RefCountedBaseVPTR, make
ref_cnt mutable and Retain/Release const to enable reference counted
pointers to const objects

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

13 years agoAttempt to fix breakage from r128782 reported by Francois Pichet on
Eli Friedman [Mon, 4 Apr 2011 00:37:38 +0000 (00:37 +0000)]
Attempt to fix breakage from r128782 reported by Francois Pichet on
llvm-commits.  (Not sure why it only breaks on Windows; maybe it has
something to do with the iterator representation...)

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

13 years agoStart migrating mach-o dumping facilities to the object file out of a
Eric Christopher [Sun, 3 Apr 2011 23:51:47 +0000 (23:51 +0000)]
Start migrating mach-o dumping facilities to the object file out of a
separate executable.

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

13 years agoMove Object.cpp out of VMCore and into Object.
Eric Christopher [Sun, 3 Apr 2011 23:07:51 +0000 (23:07 +0000)]
Move Object.cpp out of VMCore and into Object.

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

13 years agoAssorted bugfixes in object file handling:
Eric Christopher [Sun, 3 Apr 2011 22:53:19 +0000 (22:53 +0000)]
Assorted bugfixes in object file handling:

 - Adds support for sniffing PE/COFF files on win32 (.exe and .dll)
   which are COFF files that have an MS-DOS compatibility stub on
   the front of them.

 - Fixes a bug in the COFFObjectFile's support for the Microsoft COFF
   extension for long symbol names, wherein it was attempting to parse
   the leading '/' in an extended symbol name reference as part of the
   integer offset.

 - Fixes bugs in COFFObjectFile and ELFObjectFile wherein section
   and symbol iterators were being returned with uninitialized bytes;
   the type DataRefImpl is a union between 2 32-bit words (d.a and d.b)
   and a single intptr_t word (p). Only p was being initialized, so in
   32-bit builds the result would be iterators with random upper 32-bit
   words in their DataRefImpls. This caused random failures when
   seeking around in object files.

Patch by Graydon Hoare!

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

13 years agoAdd a set of C bindings for the Object interface.
Eric Christopher [Sun, 3 Apr 2011 22:34:07 +0000 (22:34 +0000)]
Add a set of C bindings for the Object interface.

Patch by Patrick Walton!

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

13 years agoRemove the LLVMContext& arguments from *Folder constructors, as they don't seem to...
Frits van Bommel [Sun, 3 Apr 2011 19:46:28 +0000 (19:46 +0000)]
Remove the LLVMContext& arguments from *Folder constructors, as they don't seem to be used anywhere.

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

13 years agoFix typos on LLVM.cmake. Export LLVM_ON_UNIX & LLVM_ON_WIN32.
Oscar Fuentes [Sun, 3 Apr 2011 16:12:38 +0000 (16:12 +0000)]
Fix typos on LLVM.cmake. Export LLVM_ON_UNIX & LLVM_ON_WIN32.

Patch by arrowdodger!

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

13 years agoPR9446: RecursivelyDeleteTriviallyDeadInstructions can delete the instruction
Eli Friedman [Sat, 2 Apr 2011 22:45:17 +0000 (22:45 +0000)]
PR9446: RecursivelyDeleteTriviallyDeadInstructions can delete the instruction
after the given instruction; make sure to handle that case correctly.
(It's difficult to trigger; the included testcase involves a dead
block, but I don't think that's a requirement.)

While I'm here, get rid of the unnecessary warning about
SimplifyInstructionsInBlock, since it should work correctly as far as I know.

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

13 years agoDon't assume something which might be a constant expression is an instruction.
Eli Friedman [Sat, 2 Apr 2011 22:11:56 +0000 (22:11 +0000)]
Don't assume something which might be a constant expression is an instruction.
Based on PR9429, but no testcase because I can't figure out how to trigger it
anymore given other changes to the relevant code.

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

13 years agoWhile SimplifyDemandedBits constant folds this, we can't rely on it here.
Benjamin Kramer [Sat, 2 Apr 2011 18:50:58 +0000 (18:50 +0000)]
While SimplifyDemandedBits constant folds this, we can't rely on it here.

It's possible to craft an input that hits the recursion limits in a way
that SimplifyDemandedBits doesn't simplify the icmp but ComputeMaskedBits
can infer which bits are zero.

No test case as it depends on too many other things. Fixes PR9609.

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

13 years agoHandle changing of LLVM_ENABLE_FFI.
Oscar Fuentes [Sat, 2 Apr 2011 13:21:12 +0000 (13:21 +0000)]
Handle changing of LLVM_ENABLE_FFI.

If someone first configure build with LLVM_ENABLE_FFI=1 and then turn it
off, the build will fail in lib/ExecutionEngine/Interpreter because
Interpreter will try still to #include <ffi/ffi.h>, but there are no
include_directories(${FFI_INCLUDE_DIR}) now.

This patch unset()'s HAVE_FFI_H and HAVE_FFI_FFI_H from cache file if
LLVM_ENABLE_FFI=0. This forces CMake to update config.h.

Patch by arrowdodger!

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

13 years agoptx: support setp's 4-operand format
Che-Liang Chiou [Sat, 2 Apr 2011 08:51:39 +0000 (08:51 +0000)]
ptx: support setp's 4-operand format

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

13 years agoUse InterferenceCache in RegAllocGreedy.
Jakob Stoklund Olesen [Sat, 2 Apr 2011 06:03:38 +0000 (06:03 +0000)]
Use InterferenceCache in RegAllocGreedy.

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

13 years agoAdd an InterferenceCache class for caching per-block interference ranges.
Jakob Stoklund Olesen [Sat, 2 Apr 2011 06:03:35 +0000 (06:03 +0000)]
Add an InterferenceCache class for caching per-block interference ranges.

When the greedy register allocator is splitting multiple global live ranges, it
tends to look at the same interference data many times. The InterferenceCache
class caches queries for unaltered LiveIntervalUnions.

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

13 years agoUse basic block numbers as indexes when mapping slot index ranges.
Jakob Stoklund Olesen [Sat, 2 Apr 2011 06:03:31 +0000 (06:03 +0000)]
Use basic block numbers as indexes when mapping slot index ranges.

This is more compact and faster than using DenseMap.

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

13 years agoDo some peephole optimizations to remove pointless VMOVs from Neon to integer
Cameron Zwarich [Sat, 2 Apr 2011 02:40:43 +0000 (02:40 +0000)]
Do some peephole optimizations to remove pointless VMOVs from Neon to integer
registers that arise from argument shuffling with the soft float ABI. These
instructions are particularly slow on Cortex A8. This fixes one half of
<rdar://problem/8674845>.

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

13 years agoAdd a RemoveFromWorklist method to DCI. This is needed to do some complicated
Cameron Zwarich [Sat, 2 Apr 2011 02:40:26 +0000 (02:40 +0000)]
Add a RemoveFromWorklist method to DCI. This is needed to do some complicated
transformations in target-specific DAG combines without causing DAGCombiner to
delete the same node twice. If you know of a better way to avoid this (see my
next patch for an example), please let me know.

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

13 years agoFixed a bug in disassembly of STR_POST, where the immediate is the second operand...
Johnny Chen [Sat, 2 Apr 2011 02:24:54 +0000 (02:24 +0000)]
Fixed a bug in disassembly of STR_POST, where the immediate is the second operand in am2offset;
instead of the second operand in addrmode_imm12.

rdar://problem/9225289

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

13 years agoUndo changes mistakenly made in revision 128750.
Akira Hatanaka [Sat, 2 Apr 2011 00:26:12 +0000 (00:26 +0000)]
Undo changes mistakenly made in revision 128750.

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

13 years agoInsert space before ';' to prevent warnings.
Akira Hatanaka [Sat, 2 Apr 2011 00:15:58 +0000 (00:15 +0000)]
Insert space before ';' to prevent warnings.

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

13 years agoFixed MOVr for "should be" encoding bits for Inst{19-16} = 0b0000.
Johnny Chen [Fri, 1 Apr 2011 23:30:25 +0000 (23:30 +0000)]
Fixed MOVr for "should be" encoding bits for Inst{19-16} = 0b0000.

rdar://problem/9224276

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

13 years agoMOVs should have Inst{19-16} as 0b0000, otherwise, the instruction is UNPREDICTABLE.
Johnny Chen [Fri, 1 Apr 2011 23:15:50 +0000 (23:15 +0000)]
MOVs should have Inst{19-16} as 0b0000, otherwise, the instruction is UNPREDICTABLE.

rdar://problem/9224120

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

13 years agoFix the instruction table entries for AI1_adde_sube_s_irs multiclass definition so...
Johnny Chen [Fri, 1 Apr 2011 22:32:51 +0000 (22:32 +0000)]
Fix the instruction table entries for AI1_adde_sube_s_irs multiclass definition so that
all the instruction have:

    let Inst{31-27} = 0b1110; // non-predicated

Before, the ARM decoder was confusing:

> 0x40 0xf3 0xb8 0x80

as:

Opcode=16 Name=ADCSSrs Format=ARM_FORMAT_DPSOREGFRM(5)
 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
-------------------------------------------------------------------------------------------------
| 1: 0: 0: 0| 0: 0: 0: 0| 1: 0: 1: 1| 1: 0: 0: 0| 1: 1: 1: 1| 0: 0: 1: 1| 0: 1: 0: 0| 0: 0: 0: 0|
-------------------------------------------------------------------------------------------------

adcs pc, r8, r0, asr #6

since the cond field for ADCSSrs is a wild card, and so is ADCrs, with the ADCSSrs having Inst{20} as '1'.

Now, the AR decoder behaves correctly:

> 0x40 0xf3 0xb8 0x80
> END
Executing command: /Volumes/data/lldb/llvm/Debug+Asserts/bin/llvm-mc -disassemble -triple=arm-apple-darwin -debug-only=arm-disassembler mc-input.txt

Opcode=19 Name=ADCrs Format=ARM_FORMAT_DPSOREGFRM(5)
 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
-------------------------------------------------------------------------------------------------
| 1: 0: 0: 0| 0: 0: 0: 0| 1: 0: 1: 1| 1: 0: 0: 0| 1: 1: 1: 1| 0: 0: 1: 1| 0: 1: 0: 0| 0: 0: 0: 0|
-------------------------------------------------------------------------------------------------

adcshi pc, r8, r0, asr #6
>

rdar://problem/9223094

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

13 years agoFix comment.
Benjamin Kramer [Fri, 1 Apr 2011 22:29:18 +0000 (22:29 +0000)]
Fix comment.

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

13 years agoTweaks to the icmp+sext-to-shifts optimization to address Frits' comments:
Benjamin Kramer [Fri, 1 Apr 2011 22:22:11 +0000 (22:22 +0000)]
Tweaks to the icmp+sext-to-shifts optimization to address Frits' comments:

- Localize the check if an icmp has one use to a place where we know we're
  introducing something that's likely more expensive than a sext from i1.
- Add an assert to make sure a case that would lead to a miscompilation is
  folded away earlier.
- Fix a typo.

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

13 years agoAvoid de-referencing pass beginning of a basic block. No small test case possible...
Evan Cheng [Fri, 1 Apr 2011 22:09:28 +0000 (22:09 +0000)]
Avoid de-referencing pass beginning of a basic block. No small test case possible. rdar://9216009

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

13 years agoRemove redundant code. There are assignments to variables Base and Offset right after...
Akira Hatanaka [Fri, 1 Apr 2011 21:56:02 +0000 (21:56 +0000)]
Remove redundant code. There are assignments to variables Base and Offset right after the code that is removed.

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

13 years agoSimplifies logic for printing target flags.
Akira Hatanaka [Fri, 1 Apr 2011 21:41:06 +0000 (21:41 +0000)]
Simplifies logic for printing target flags.

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

13 years agoCMake: remove debug code from previous commit.
Oscar Fuentes [Fri, 1 Apr 2011 21:39:38 +0000 (21:39 +0000)]
CMake: remove debug code from previous commit.

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

13 years agoWhen the architecture is explicitly armv6 or thumbv6, we need to mark the object...
Owen Anderson [Fri, 1 Apr 2011 21:07:39 +0000 (21:07 +0000)]
When the architecture is explicitly armv6 or thumbv6, we need to mark the object file appropriately.

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

13 years agoLDRD/STRD instructions should print both Rt and Rt2 in the asm string.
Jim Grosbach [Fri, 1 Apr 2011 20:26:57 +0000 (20:26 +0000)]
LDRD/STRD instructions should print both Rt and Rt2 in the asm string.

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

13 years agotlbgen/MC: StringRef's to temporary objects considered harmful.
Daniel Dunbar [Fri, 1 Apr 2011 20:23:52 +0000 (20:23 +0000)]
tlbgen/MC: StringRef's to temporary objects considered harmful.

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

13 years agoFix a LDRT/LDRBT decoding bug where for Encoding A2, if Inst{4} != 0, we should rejec...
Johnny Chen [Fri, 1 Apr 2011 20:21:38 +0000 (20:21 +0000)]
Fix a LDRT/LDRBT decoding bug where for Encoding A2, if Inst{4} != 0, we should reject the instruction
as invalid.

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

13 years agoFix build.
Benjamin Kramer [Fri, 1 Apr 2011 20:15:16 +0000 (20:15 +0000)]
Fix build.

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

13 years agoInstCombine: Turn icmp + sext into bitwise/integer ops when the input has only one...
Benjamin Kramer [Fri, 1 Apr 2011 20:09:10 +0000 (20:09 +0000)]
InstCombine: Turn icmp + sext into bitwise/integer ops when the input has only one unknown bit.

int test1(unsigned x) { return (x&8) ? 0 : -1; }
int test3(unsigned x) { return (x&8) ? -1 : 0; }

before (x86_64):
_test1:
andl $8, %edi
cmpl $1, %edi
sbbl %eax, %eax
ret
_test3:
andl $8, %edi
cmpl $1, %edi
sbbl %eax, %eax
notl %eax
ret

after:
_test1:
shrl $3, %edi
andl $1, %edi
leal -1(%rdi), %eax
ret
_test3:
shll $28, %edi
movl %edi, %eax
sarl $31, %eax
ret

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

13 years agoInstCombine: Move (sext icmp) transforms into their own method. No intended functiona...
Benjamin Kramer [Fri, 1 Apr 2011 20:09:03 +0000 (20:09 +0000)]
InstCombine: Move (sext icmp) transforms into their own method. No intended functionality change.

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

13 years agoAdd comments.
Evan Cheng [Fri, 1 Apr 2011 19:57:01 +0000 (19:57 +0000)]
Add comments.

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

13 years agoAssign node order numbers to results of call instruction lowering. This should improv...
Evan Cheng [Fri, 1 Apr 2011 19:42:22 +0000 (19:42 +0000)]
Assign node order numbers to results of call instruction lowering. This should improve src line debug info when sdisel is used. rdar://9199118

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

13 years agoFix assignment of -fPIC to CMAKE_C_FLAGS. Configure llvm-config.in.in
Oscar Fuentes [Fri, 1 Apr 2011 19:36:06 +0000 (19:36 +0000)]
Fix assignment of -fPIC to CMAKE_C_FLAGS. Configure llvm-config.in.in
with the contents of CMAKE_C(XX)_FLAGS too, else `llvm-config
--c(xx)flags' doesn't tell the absolute truth.

This comes from PR9603 and is based on a patch by Ryuta Suzuki!

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

13 years agoModifies MipsAsmPrinter::isBlockOnlyReachableByFallthrough so that it handles delay...
Akira Hatanaka [Fri, 1 Apr 2011 18:57:38 +0000 (18:57 +0000)]
Modifies MipsAsmPrinter::isBlockOnlyReachableByFallthrough so that it handles delay slots correctly.

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

13 years agoFix LDRi12 immediate operand, which was changed to be the second operand in $addrmode...
Johnny Chen [Fri, 1 Apr 2011 18:26:38 +0000 (18:26 +0000)]
Fix LDRi12 immediate operand, which was changed to be the second operand in $addrmode_imm12 => (ops GPR:$base, i32imm:$offsimm).

rdar://problem/9219356

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

13 years agoUpdate CMakeLists.txt
Devang Patel [Fri, 1 Apr 2011 18:03:58 +0000 (18:03 +0000)]
Update CMakeLists.txt
Patch by arrowdoger.

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

13 years agoAdd code for analyzing FP branches. Clean up branch Analysis functions.
Akira Hatanaka [Fri, 1 Apr 2011 17:39:08 +0000 (17:39 +0000)]
Add code for analyzing FP branches. Clean up branch Analysis functions.

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

13 years agoInitialize HasVMLxForwarding.
Benjamin Kramer [Fri, 1 Apr 2011 09:20:31 +0000 (09:20 +0000)]
Initialize HasVMLxForwarding.

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

13 years agoVarious Instructions' resizeOperands() methods are only used to grow the
Jay Foad [Fri, 1 Apr 2011 08:00:58 +0000 (08:00 +0000)]
Various Instructions' resizeOperands() methods are only used to grow the
list of operands. Simplify and rename them accordingly.

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

13 years agoAdd test case.
Evan Cheng [Fri, 1 Apr 2011 06:27:25 +0000 (06:27 +0000)]
Add test case.

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

13 years agoFileCheck'ify test.
Evan Cheng [Fri, 1 Apr 2011 03:36:33 +0000 (03:36 +0000)]
FileCheck'ify test.

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

13 years agoWhile testing dragonegg I noticed that isCastable and getCastOpcode
Duncan Sands [Fri, 1 Apr 2011 03:34:54 +0000 (03:34 +0000)]
While testing dragonegg I noticed that isCastable and getCastOpcode
had gotten out of sync: isCastable didn't think it was possible to
cast the x86_mmx type to anything, while it did think it possible
to cast an i64 to x86_mmx.

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

13 years agoAdd annotations to tablegen-generated processor itineraries, or replace them with...
Andrew Trick [Fri, 1 Apr 2011 02:22:47 +0000 (02:22 +0000)]
Add annotations to tablegen-generated processor itineraries, or replace them with something meaningful. I want to be able to read and debug the generated tables.

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

13 years agowhitespace
Andrew Trick [Fri, 1 Apr 2011 01:56:55 +0000 (01:56 +0000)]
whitespace

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