oota-llvm.git
13 years agoAdd more comments... err debug statements to the fast allocator.
Eric Christopher [Tue, 12 Apr 2011 22:17:44 +0000 (22:17 +0000)]
Add more comments... err debug statements to the fast allocator.

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

13 years agoFix compiler command line used by lit.py when working with NMake
Oscar Fuentes [Tue, 12 Apr 2011 22:10:38 +0000 (22:10 +0000)]
Fix compiler command line used by lit.py when working with NMake
generators. It may improve robustness when testing from VS too.

Based on a patch by David Neto!

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

13 years agoThe Thumb2 RFE instructions need to have their second halfword fully specified.
Johnny Chen [Tue, 12 Apr 2011 21:41:51 +0000 (21:41 +0000)]
The Thumb2 RFE instructions need to have their second halfword fully specified.
In addition, the base register is not rGPR, but GPR with th exception that:

    if n == 15 then UNPREDICTABLE

rdar://problem/9273836

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

13 years agoSparseBitVector is SLOW.
Jakob Stoklund Olesen [Tue, 12 Apr 2011 21:30:53 +0000 (21:30 +0000)]
SparseBitVector is SLOW.

Use a Bitvector instead, we didn't need the smaller memory footprint anyway.
This makes the greedy register allocator 10% faster.

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

13 years agoMCJIT lazy relocation resolution and symbol address re-assignment.
Jim Grosbach [Tue, 12 Apr 2011 21:20:41 +0000 (21:20 +0000)]
MCJIT lazy relocation resolution and symbol address re-assignment.

Add handling for tracking the relocations on symbols and resolving them.
Keep track of the relocations even after they are resolved so that if
the RuntimeDyld client moves the object, it can update the address and any
relocations to that object will be updated.

For our trival object file load/run test harness (llvm-rtdyld), this enables
relocations between functions located in the same object module. It should
be trivially extendable to load multiple objects with mutual references.

As a simple example, the following now works (running on x86_64 Darwin 10.6):

$ cat t.c
int bar() {
  return 65;
}

int main() {
  return bar();
}
$ clang t.c -fno-asynchronous-unwind-tables -o t.o -c
$ otool -vt t.o
t.o:
(__TEXT,__text) section
_bar:
0000000000000000  pushq %rbp
0000000000000001  movq  %rsp,%rbp
0000000000000004  movl  $0x00000041,%eax
0000000000000009  popq  %rbp
000000000000000a  ret
000000000000000b  nopl  0x00(%rax,%rax)
_main:
0000000000000010  pushq %rbp
0000000000000011  movq  %rsp,%rbp
0000000000000014  subq  $0x10,%rsp
0000000000000018  movl  $0x00000000,0xfc(%rbp)
000000000000001f  callq 0x00000024
0000000000000024  addq  $0x10,%rsp
0000000000000028  popq  %rbp
0000000000000029  ret
$ llvm-rtdyld t.o -debug-only=dyld ; echo $?
Function sym: '_bar' @ 0
Function sym: '_main' @ 16
Extracting function: _bar from [0, 15]
    allocated to 0x100153000
Extracting function: _main from [16, 41]
    allocated to 0x100154000
Relocation at '_main' + 16 from '_bar(Word1: 0x2d000000)
Resolving relocation at '_main' + 16 (0x100154010) from '_bar (0x100153000)(pcrel, type: 2, Size: 4).
loaded '_main' at: 0x100154000
65
$

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

13 years agoAdd bad register checks for Thumb2 Ld/St instructions.
Johnny Chen [Tue, 12 Apr 2011 21:17:51 +0000 (21:17 +0000)]
Add bad register checks for Thumb2 Ld/St instructions.

rdar://problem/9269047

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

13 years agoRevert 129383. It causes some targets to hit a scheduler assert.
Andrew Trick [Tue, 12 Apr 2011 20:14:07 +0000 (20:14 +0000)]
Revert 129383. It causes some targets to hit a scheduler assert.

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

13 years agoPrint our uint64_t with the more portable (C99 and C++0x) %PRIu64 format
Nick Lewycky [Tue, 12 Apr 2011 20:06:50 +0000 (20:06 +0000)]
Print our uint64_t with the more portable (C99 and C++0x) %PRIu64 format
specifier.

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

13 years agoPreRA scheduler heuristic fixes: VRegCycle, TokenFactor latency.
Andrew Trick [Tue, 12 Apr 2011 19:54:36 +0000 (19:54 +0000)]
PreRA scheduler heuristic fixes: VRegCycle, TokenFactor latency.

UnitsSharePred was a source of randomness in the scheduler: node
priority depended on the queue data structure. I rewrote the recent
VRegCycle heuristics to completely replace the old heuristic without
any randomness. To make these heuristic adjustments to node latency work,
I also needed to do something a little more reasonable with TokenFactor. I
gave it zero latency to its consumers and always schedule it as low as
possible.

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

13 years agoDocument how to build a LLVM pass with CMake out of source.
Oscar Fuentes [Tue, 12 Apr 2011 19:40:35 +0000 (19:40 +0000)]
Document how to build a LLVM pass with CMake out of source.

Patch by arrowdodger!

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

13 years agoThe counters are unsigned.
Nick Lewycky [Tue, 12 Apr 2011 19:35:45 +0000 (19:35 +0000)]
The counters are unsigned.

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

13 years agoCreate new intervals for isolated blocks during region splitting.
Jakob Stoklund Olesen [Tue, 12 Apr 2011 19:32:53 +0000 (19:32 +0000)]
Create new intervals for isolated blocks during region splitting.

This merges the behavior of splitSingleBlocks into splitAroundRegion, so the
RS_Region and RS_Block register stages can be coalesced. That means the leftover
intervals after region splitting go directly to spilling instead of a second
pass of per-block splitting.

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

13 years agoRemove LastOffset from the asm parser.
Rafael Espindola [Tue, 12 Apr 2011 18:53:30 +0000 (18:53 +0000)]
Remove LastOffset from the asm parser.

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

13 years agoThe Thumb2 Ld, St, and Preload instructions with the i12 forms should have its Inst{23}
Johnny Chen [Tue, 12 Apr 2011 18:48:00 +0000 (18:48 +0000)]
The Thumb2 Ld, St, and Preload instructions with the i12 forms should have its Inst{23}
be specified as '1' (add = TRUE).

Also add a utility function for Thumb2.

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

13 years agoAdd SplitKit API to query and select the current interval being worked on.
Jakob Stoklund Olesen [Tue, 12 Apr 2011 18:11:31 +0000 (18:11 +0000)]
Add SplitKit API to query and select the current interval being worked on.

This makes it possible to target multiple registers in one pass.

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

13 years agoFix a bug in RegAllocBase::addMBBLiveIns() where a basic block could accidentally...
Jakob Stoklund Olesen [Tue, 12 Apr 2011 18:11:28 +0000 (18:11 +0000)]
Fix a bug in RegAllocBase::addMBBLiveIns() where a basic block could accidentally be skipped.

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

13 years agoRemove dead typedef.
Devang Patel [Tue, 12 Apr 2011 17:43:12 +0000 (17:43 +0000)]
Remove dead typedef.

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

13 years agoRefactor CompileUnit into a separate header.
Devang Patel [Tue, 12 Apr 2011 17:40:32 +0000 (17:40 +0000)]
Refactor CompileUnit into a separate header.

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

13 years agoPrint out a debug message when the reglist fails the sanity check for Thumb Ld/St...
Johnny Chen [Tue, 12 Apr 2011 17:09:04 +0000 (17:09 +0000)]
Print out a debug message when the reglist fails the sanity check for Thumb Ld/St Multiple.

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

13 years agoFix the case of a .cfi_rel_offset before any .cfi_def_cfa_offset.
Rafael Espindola [Tue, 12 Apr 2011 16:12:03 +0000 (16:12 +0000)]
Fix the case of a .cfi_rel_offset before any .cfi_def_cfa_offset.

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

13 years agoImplement .cfi_same_value.
Rafael Espindola [Tue, 12 Apr 2011 15:31:05 +0000 (15:31 +0000)]
Implement  .cfi_same_value.

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

13 years agoAdded new FIXME note
Garrison Venn [Tue, 12 Apr 2011 12:30:10 +0000 (12:30 +0000)]
Added new FIXME note

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

13 years agoSplit a store of a VMOVDRR into two integer stores to avoid mixing NEON and ARM
Cameron Zwarich [Tue, 12 Apr 2011 02:24:17 +0000 (02:24 +0000)]
Split a store of a VMOVDRR into two integer stores to avoid mixing NEON and ARM
stores of arguments in the same cache line. This fixes the second half of
<rdar://problem/8674845>.

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

13 years agolib/Transforms/Instrumentation/CMakeLists.txt: Add LineProfiling.cpp to fix up r129340.
NAKAMURA Takumi [Tue, 12 Apr 2011 01:54:40 +0000 (01:54 +0000)]
lib/Transforms/Instrumentation/CMakeLists.txt: Add LineProfiling.cpp to fix up r129340.

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

13 years agoAdd support for line profiling. Very work-in-progress.
Nick Lewycky [Tue, 12 Apr 2011 01:06:09 +0000 (01:06 +0000)]
Add support for line profiling. Very work-in-progress.

Use debug info in the IR to find the directory/file:line:col. Each time that location changes, bump a counter.

Unlike the existing profiling system, we don't try to look at argv[], and thusly don't require main() to be present in the IR. This matches GCC's technique where you specify the profiling flag when producing each .o file.

The runtime library is minimal, currently just calling printf at program shutdown time. The API is designed to make it possible to emit GCOV data later on.

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

13 years agoConsider ConstantAggregateZero as well as ConstantArray/Struct.
Nick Lewycky [Tue, 12 Apr 2011 01:02:45 +0000 (01:02 +0000)]
Consider ConstantAggregateZero as well as ConstantArray/Struct.

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

13 years agoFix typo.
Eric Christopher [Tue, 12 Apr 2011 00:48:08 +0000 (00:48 +0000)]
Fix typo.

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

13 years agoMake IRBuilder support StringRef for building strings.
Nick Lewycky [Tue, 12 Apr 2011 00:29:07 +0000 (00:29 +0000)]
Make IRBuilder support StringRef for building strings.

Also document that the global variables produced are mergable.

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

13 years agoTidy up a bit now that we're using the MemoryManager interface.
Jim Grosbach [Tue, 12 Apr 2011 00:23:32 +0000 (00:23 +0000)]
Tidy up a bit now that we're using the MemoryManager interface.

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

13 years agoAdd one test case (svc).
Johnny Chen [Tue, 12 Apr 2011 00:21:48 +0000 (00:21 +0000)]
Add one test case (svc).

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

13 years agoMatch case for invalid constant error messages and add a new
Eric Christopher [Tue, 12 Apr 2011 00:18:03 +0000 (00:18 +0000)]
Match case for invalid constant error messages and add a new
test for invalid hexadecimals.

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

13 years agoA8.6.16 B
Johnny Chen [Tue, 12 Apr 2011 00:14:49 +0000 (00:14 +0000)]
A8.6.16 B
Encoding T1 (tBcc)
if cond == '1110' then UNDEFINED;

rdar://problem/9268681

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

13 years agoFix reassociate to use a worklist instead of recursing when new
Dan Gohman [Tue, 12 Apr 2011 00:11:56 +0000 (00:11 +0000)]
Fix reassociate to use a worklist instead of recursing when new
reassociation opportunities are exposed. This fixes a bug where
the nested reassociation expects to be the IR to be consistent,
but it isn't, because the outer reassociation has disconnected
some of the operands.  rdar://9167457

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

13 years agoTest for invalid constant expr addition - bad octal constant.
Eric Christopher [Tue, 12 Apr 2011 00:03:38 +0000 (00:03 +0000)]
Test for invalid constant expr addition - bad octal constant.

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

13 years agoTo avoid printing out multiple error messages for cases like:
Eric Christopher [Tue, 12 Apr 2011 00:03:13 +0000 (00:03 +0000)]
To avoid printing out multiple error messages for cases like:

.long 80+08

go ahead and assume that if we've got an Error token that we handled it
already. Otherwise if it's a token we can't handle then go ahead and
return the default error.

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

13 years agoReuse live interval union between functions. This saves a bit of compile time
Jakob Stoklund Olesen [Mon, 11 Apr 2011 23:57:14 +0000 (23:57 +0000)]
Reuse live interval union between functions. This saves a bit of compile time
when compiling many small functions.

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

13 years agoThumb disassembler was erroneously rejecting "blx sp" instruction.
Johnny Chen [Mon, 11 Apr 2011 23:33:30 +0000 (23:33 +0000)]
Thumb disassembler was erroneously rejecting "blx sp" instruction.

rdar://problem/9267838

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

13 years agocomment cleanup, use moveBefore instead of removeFromParent+insertBefore.
Chris Lattner [Mon, 11 Apr 2011 23:24:57 +0000 (23:24 +0000)]
comment cleanup, use moveBefore instead of removeFromParent+insertBefore.

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

13 years agoTableGen: Keep the order of DECL_CONTEXT() for DeclNodes.td. RecordVector may be...
NAKAMURA Takumi [Mon, 11 Apr 2011 23:20:28 +0000 (23:20 +0000)]
TableGen: Keep the order of DECL_CONTEXT() for DeclNodes.td. RecordVector may be used instead of RecordSet.

The result of DeclNodes.inc was unstable on msys, Windows 7 x64.

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

13 years agoremove the StructRetPromotion pass. It is unused, not maintained and
Chris Lattner [Mon, 11 Apr 2011 23:09:44 +0000 (23:09 +0000)]
remove the StructRetPromotion pass.  It is unused, not maintained and
has some bugs.  If this is interesting functionality, it should be
reimplemented in the argpromotion pass.

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

13 years agoFix an error in the MBlaze delay slot filler.
Wesley Peck [Mon, 11 Apr 2011 22:45:02 +0000 (22:45 +0000)]
Fix an error in the MBlaze delay slot filler.

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

13 years agobuild: Add support for a SHOW_DIAGNOSTICS build variable.
Daniel Dunbar [Mon, 11 Apr 2011 22:37:39 +0000 (22:37 +0000)]
build: Add support for a SHOW_DIAGNOSTICS build variable.

If enabled, this will attempt to use the CC_LOG_DIAGNOSTICS feature I dropped
into Clang to print a log of all the diagnostics generated during an individual
build (from the top-level). Not sure if this will actually be useful, but for
now it is handy for testing the option.

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

13 years agoAdd scheduling information for the MBlaze backend.
Wesley Peck [Mon, 11 Apr 2011 22:31:52 +0000 (22:31 +0000)]
Add scheduling information for the MBlaze backend.

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

13 years agoLex, and then fail on invalid constants.
Eric Christopher [Mon, 11 Apr 2011 22:24:56 +0000 (22:24 +0000)]
Lex, and then fail on invalid constants.

Testcase forthcoming.

rdar://8490596

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

13 years agoJust because a GlobalVariable's initializer is [N x { i32, void ()* }] doesn't
Nick Lewycky [Mon, 11 Apr 2011 22:11:20 +0000 (22:11 +0000)]
Just because a GlobalVariable's initializer is [N x { i32, void ()* }] doesn't
mean that it has to be ConstantArray of ConstantStruct. We might have
ConstantAggregateZero, at either level, so don't crash on that.

Also, semi-deprecate the sentinal value. The linker isn't aware of sentinals so
we end up with the two lists appended, each with their "sentinals" on them.
Different parts of LLVM treated sentinals differently, so make them all just
ignore the single entry and continue on with the rest of the list.

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

13 years agoImplement cfi_rel_offset
Rafael Espindola [Mon, 11 Apr 2011 21:49:50 +0000 (21:49 +0000)]
Implement cfi_rel_offset

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

13 years agoSpeed up eviction by stopping collectInterferingVRegs as soon as the spill
Jakob Stoklund Olesen [Mon, 11 Apr 2011 21:47:01 +0000 (21:47 +0000)]
Speed up eviction by stopping collectInterferingVRegs as soon as the spill
weight limit has been exceeded.

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

13 years agoAdd test for previous commit.
Rafael Espindola [Mon, 11 Apr 2011 21:41:34 +0000 (21:41 +0000)]
Add test for previous commit.

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

13 years agoDon't crash on invalid instructions when disassembling MBlaze code.
Wesley Peck [Mon, 11 Apr 2011 21:35:21 +0000 (21:35 +0000)]
Don't crash on invalid instructions when disassembling MBlaze code.
This fixes http://llvm.org/bugs/show_bug.cgi?id=9653

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

13 years agoThe default of the dispatch switch statement was to branch to a BB that executed
Bill Wendling [Mon, 11 Apr 2011 21:32:34 +0000 (21:32 +0000)]
The default of the dispatch switch statement was to branch to a BB that executed
the 'unwind' instruction. However, later on that instruction was converted into
a jump to the basic block it was located in, causing an infinite loop when we
get there.

It turns out, we get there if the _Unwind_Resume_or_Rethrow call returns (which
it's not supposed to do). It returns if it cannot find a place to unwind
to. Thus we would get what appears to be a "hang" when in reality it's just that
the EH couldn't be propagated further along.

Instead of infinitely looping (or calling `unwind', which none of our back-ends
support (it's lowered into nothing...)), call the @llvm.trap() intrinsic
instead. This may not conform to specific rules of a particular language, but
it's rather better than infinitely looping.

<rdar://problem/9175843&9233582>

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

13 years agoFix the bug where the immediate shift amount for Thumb logical shift instructions...
Johnny Chen [Mon, 11 Apr 2011 21:14:35 +0000 (21:14 +0000)]
Fix the bug where the immediate shift amount for Thumb logical shift instructions are incorrectly disassembled.

rdar://problem/9266265

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

13 years agoLook pass copies when determining whether hoisting would end up inserting more copies...
Evan Cheng [Mon, 11 Apr 2011 21:09:18 +0000 (21:09 +0000)]
Look pass copies when determining whether hoisting would end up inserting more copies. rdar://9266679

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

13 years agoimplement .cfi_adjust_cfa_offset.
Rafael Espindola [Mon, 11 Apr 2011 20:29:16 +0000 (20:29 +0000)]
implement .cfi_adjust_cfa_offset.

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

13 years agoGet rid of useless comment; if a file uses functions from a given header,
Eli Friedman [Mon, 11 Apr 2011 20:16:05 +0000 (20:16 +0000)]
Get rid of useless comment; if a file uses functions from a given header,
it is obvious that it should be included.

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

13 years agoFix another using-CPSR-twice bug in my ADCS/SBCS cleanups, and make proper use of...
Owen Anderson [Mon, 11 Apr 2011 20:12:19 +0000 (20:12 +0000)]
Fix another using-CPSR-twice bug in my ADCS/SBCS cleanups, and make proper use of the Commutable bit.

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

13 years agoSkip a binary search when possible.
Jakob Stoklund Olesen [Mon, 11 Apr 2011 20:01:44 +0000 (20:01 +0000)]
Skip a binary search when possible.

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

13 years agoUse a faster algorithm for computing MBB live-in registers after register allocation.
Jakob Stoklund Olesen [Mon, 11 Apr 2011 20:01:41 +0000 (20:01 +0000)]
Use a faster algorithm for computing MBB live-in registers after register allocation.

LiveIntervals::findLiveInMBBs has to do a full binary search for each segment.

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

13 years agoBecause some systems have reported that this example would not build the
Garrison Venn [Mon, 11 Apr 2011 19:52:49 +0000 (19:52 +0000)]
Because some systems have reported that this example would not build the
header file cstdio was added as an include.

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

13 years agoTrivial comment fix.
Johnny Chen [Mon, 11 Apr 2011 18:51:50 +0000 (18:51 +0000)]
Trivial comment fix.

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

13 years agoFix a couple of places where changes are made but not tracked.
Evan Cheng [Mon, 11 Apr 2011 18:47:20 +0000 (18:47 +0000)]
Fix a couple of places where changes are made but not tracked.

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

13 years agoCheck invalid register encodings for LdFrm/StFrm ARM instructions and flag them as
Johnny Chen [Mon, 11 Apr 2011 18:34:12 +0000 (18:34 +0000)]
Check invalid register encodings for LdFrm/StFrm ARM instructions and flag them as
invalid instructions.

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

13 years agoAdding support for printing operands symbolically to llvm's public 'C'
Kevin Enderby [Mon, 11 Apr 2011 18:08:50 +0000 (18:08 +0000)]
Adding support for printing operands symbolically to llvm's public 'C'
disassembler API.  Hooked this up to the ARM target so such tools as Darwin's
otool(1) can now print things like branch targets for example this:
  blx _puts
instead of this:
  blx #-36
And even print the expression encoded in the Mach-O relocation entried for
things like this:
  movt r0, :upper16:((_foo-_bar)+1234)

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

13 years agoDon't add live ranges for sub-registers when clobbering a physical register.
Jakob Stoklund Olesen [Mon, 11 Apr 2011 18:08:10 +0000 (18:08 +0000)]
Don't add live ranges for sub-registers when clobbering a physical register.

Both coalescing and register allocation already check aliases for interference,
so these extra segments are only slowing us down.

This speeds up both linear scan and the greedy register allocator.

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

13 years agoSpeed up LiveIntervalUnion::unify by handling end insertion specially.
Jakob Stoklund Olesen [Mon, 11 Apr 2011 15:00:44 +0000 (15:00 +0000)]
Speed up LiveIntervalUnion::unify by handling end insertion specially.

This particularly helps with the initial transfer of fixed intervals.

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

13 years agoTime the initial seeding of live registers
Jakob Stoklund Olesen [Mon, 11 Apr 2011 15:00:42 +0000 (15:00 +0000)]
Time the initial seeding of live registers

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

13 years agoDon't shrink live ranges after dead code elimination unless it is going to help.
Jakob Stoklund Olesen [Mon, 11 Apr 2011 15:00:39 +0000 (15:00 +0000)]
Don't shrink live ranges after dead code elimination unless it is going to help.

In particular, don't repeatedly recompute the PIC base live range after rematerialization.

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

13 years agoCMake: remove some unnecesary code and ToDos.
Oscar Fuentes [Mon, 11 Apr 2011 14:52:39 +0000 (14:52 +0000)]
CMake: remove some unnecesary code and ToDos.

Patch by arrowdodger!

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

13 years agoFix or remove code which seemed to think that the operand of a Constant
Jay Foad [Mon, 11 Apr 2011 09:48:55 +0000 (09:48 +0000)]
Fix or remove code which seemed to think that the operand of a Constant
was always a User.

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

13 years agoDon't include Operator.h from InstrTypes.h.
Jay Foad [Mon, 11 Apr 2011 09:35:34 +0000 (09:35 +0000)]
Don't include Operator.h from InstrTypes.h.

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

13 years agoPhi nodes always use an even number of operands, so don't ever allocate
Jay Foad [Mon, 11 Apr 2011 09:25:51 +0000 (09:25 +0000)]
Phi nodes always use an even number of operands, so don't ever allocate
an odd number.

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

13 years agodocs/CommandGuide/index.html: Fix CSS url to relative.
NAKAMURA Takumi [Mon, 11 Apr 2011 03:27:38 +0000 (03:27 +0000)]
docs/CommandGuide/index.html: Fix CSS url to relative.

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

13 years agodocs/CommandLine.html: &quot;ize.
NAKAMURA Takumi [Mon, 11 Apr 2011 03:27:31 +0000 (03:27 +0000)]
docs/CommandLine.html: &quot;ize.

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

13 years agoRevert r129235 pending a vetting of the EH rewrite.
Bill Wendling [Sun, 10 Apr 2011 23:18:04 +0000 (23:18 +0000)]
Revert r129235 pending a vetting of the EH rewrite.
--- Reverse-merging r129235 into '.':
D    test/Feature/bb_attrs.ll
U    include/llvm/BasicBlock.h
U    include/llvm/Bitcode/LLVMBitCodes.h
U    lib/VMCore/AsmWriter.cpp
U    lib/VMCore/BasicBlock.cpp
U    lib/AsmParser/LLParser.cpp
U    lib/AsmParser/LLLexer.cpp
U    lib/AsmParser/LLToken.h
U    lib/Bitcode/Reader/BitcodeReader.cpp
U    lib/Bitcode/Writer/BitcodeWriter.cpp

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

13 years agoBugfix in the Cpp backend after API change on PHINode::Create.
Nicolas Geoffray [Sun, 10 Apr 2011 17:39:40 +0000 (17:39 +0000)]
Bugfix in the Cpp backend after API change on PHINode::Create.

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

13 years agoCMake: support for using LLVM from client projects with find_package.
Oscar Fuentes [Sun, 10 Apr 2011 16:17:49 +0000 (16:17 +0000)]
CMake: support for using LLVM from client projects with find_package.

Patch by arrowdodger!

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

13 years agoFixed more best practices, and explicit/implicit style guide issues.
Garrison Venn [Sun, 10 Apr 2011 14:06:52 +0000 (14:06 +0000)]
Fixed more best practices, and explicit/implicit style guide issues.

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

13 years agoReword instructions for running tests on Visual Studio.
Oscar Fuentes [Sun, 10 Apr 2011 01:41:55 +0000 (01:41 +0000)]
Reword instructions for running tests on Visual Studio.

Suggested by Maël Hörz.

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

13 years agoBeginning of the Great Exception Handling Rewrite.
Bill Wendling [Sun, 10 Apr 2011 00:04:27 +0000 (00:04 +0000)]
Beginning of the Great Exception Handling Rewrite.

* Add a "landing pad" attribute to the BasicBlock.
* Modify the bitcode reader and writer to handle said attribute.

Later: The verifier will ensure that the landing pad attribute is used in the
appropriate manner. I.e., not applied to the entry block, and applied only to
basic blocks that are branched to via a `dispatch' instruction.

(This is a work-in-progress.)

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

13 years agodrive by bug fix: DenseMapInfo::isEqual should be determined according to
Chris Lattner [Sat, 9 Apr 2011 21:20:23 +0000 (21:20 +0000)]
drive by bug fix: DenseMapInfo::isEqual should be determined according to
isEqual of its members, not operator==.

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

13 years agoLLVMCC_EMITIR_FLAG is already either -emit-llvm or -fplugin-arg-dragonegg-emit-ir...
Chris Lattner [Sat, 9 Apr 2011 19:56:28 +0000 (19:56 +0000)]
LLVMCC_EMITIR_FLAG is already either -emit-llvm or -fplugin-arg-dragonegg-emit-ir, so don't add an extra leading -.  Clang doesn't accept --emit-llvm.

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

13 years agomake stuff work when LLVMCC_OPTION is something like installed-clang, not just clang.
Chris Lattner [Sat, 9 Apr 2011 19:53:16 +0000 (19:53 +0000)]
make stuff work when LLVMCC_OPTION is something like installed-clang, not just clang.

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

13 years agofix rdar://8735979 - "int 3" doesn't match to "int3". Unfortunately,
Chris Lattner [Sat, 9 Apr 2011 19:41:05 +0000 (19:41 +0000)]
fix rdar://8735979 - "int 3" doesn't match to "int3".  Unfortunately,
InstAlias doesn't allow matching immediate operands, so we have to write
C++ code to do this.

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

13 years agolook for the verboten argument slot access in any order, thanks to Frits
Chris Lattner [Sat, 9 Apr 2011 17:00:34 +0000 (17:00 +0000)]
look for the verboten argument slot access in any order, thanks to Frits
for pointing this out

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

13 years agoFix potential buffer overflow on win32.
Benjamin Kramer [Sat, 9 Apr 2011 14:06:12 +0000 (14:06 +0000)]
Fix potential buffer overflow on win32.

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

13 years agoDon't store Twine temporaries, it's not safe.
Benjamin Kramer [Sat, 9 Apr 2011 11:26:27 +0000 (11:26 +0000)]
Don't store Twine temporaries, it's not safe.

And don't append the name over and over again in the loop.

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

13 years agoMake error message more useful.
Benjamin Kramer [Sat, 9 Apr 2011 10:10:35 +0000 (10:10 +0000)]
Make error message more useful.

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

13 years agodocs/*.html: Make W3C HTML 4.01 Strict more compliant.
NAKAMURA Takumi [Sat, 9 Apr 2011 09:51:57 +0000 (09:51 +0000)]
docs/*.html: Make W3C HTML 4.01 Strict more compliant.

FIXME: The logo handling in ReleaseNotes.html

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

13 years agoAdd back a couple checks removed by r129128; the fact that an intitializer
Eli Friedman [Sat, 9 Apr 2011 09:11:09 +0000 (09:11 +0000)]
Add back a couple checks removed by r129128; the fact that an intitializer
is an array of structures doesn't imply it's a ConstantArray of
ConstantStruct.

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

13 years agofix PR9523, a crash in looprotate on a non-canonical loop made out of indirectbr.
Chris Lattner [Sat, 9 Apr 2011 07:25:58 +0000 (07:25 +0000)]
fix PR9523, a crash in looprotate on a non-canonical loop made out of indirectbr.

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

13 years agoFix a bug where RecursivelyDeleteTriviallyDeadInstructions could
Chris Lattner [Sat, 9 Apr 2011 07:05:44 +0000 (07:05 +0000)]
Fix a bug where RecursivelyDeleteTriviallyDeadInstructions could
delete the instruction pointed to by CGP's current instruction
iterator, leading to a crash on the testcase.  This fixes PR9578.

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

13 years agoAvoid excess precision issues that lead to generating host-compiler-specific code.
Chris Lattner [Sat, 9 Apr 2011 06:57:13 +0000 (06:57 +0000)]
Avoid excess precision issues that lead to generating host-compiler-specific code.
Switch lowering probably shouldn't be using FP for this.  This resolves PR9581.

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

13 years agoPR9604; try to deal with RAUW updates correctly in the AST. I'm not convinced
Eli Friedman [Sat, 9 Apr 2011 06:55:46 +0000 (06:55 +0000)]
PR9604; try to deal with RAUW updates correctly in the AST.  I'm not convinced
it's completely safe to cache the AST across LICM runs even with this fix,
but this fix can't hurt.

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

13 years agoTest for r129190.
Eli Friedman [Sat, 9 Apr 2011 06:39:43 +0000 (06:39 +0000)]
Test for r129190.

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

13 years agofix PR9629 - We were lowering regexes like a{{b|c}}d into ab|cd, which
Chris Lattner [Sat, 9 Apr 2011 06:37:03 +0000 (06:37 +0000)]
fix PR9629 - We were lowering regexes like a{{b|c}}d into ab|cd, which
is substantially different than a(b|c)d.  Form the latter regex instead.
This found a few problems in the testsuite, which serves as its test.

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

13 years agofix two completely broken tests, which were matching due to PR9629.
Chris Lattner [Sat, 9 Apr 2011 06:34:38 +0000 (06:34 +0000)]
fix two completely broken tests, which were matching due to PR9629.

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

13 years agoremove a bunch of CHECK lines that aren't checking what
Chris Lattner [Sat, 9 Apr 2011 06:31:06 +0000 (06:31 +0000)]
remove a bunch of CHECK lines that aren't checking what
they thought they were, because alternation was expanding
wrong in {{}}'s.

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

13 years agoregexes are allowed to match empty things, e.g. {{.*}} in filecheck.
Chris Lattner [Sat, 9 Apr 2011 06:29:24 +0000 (06:29 +0000)]
regexes are allowed to match empty things, e.g. {{.*}} in filecheck.

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

13 years agovarious cleanups, no functionality change.
Chris Lattner [Sat, 9 Apr 2011 06:18:02 +0000 (06:18 +0000)]
various cleanups, no functionality change.

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

13 years agorevert accidental commit.
Chris Lattner [Sat, 9 Apr 2011 06:01:28 +0000 (06:01 +0000)]
revert accidental commit.

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

13 years agofix a potentially serious bug in AliasSet::removeCallSite
Chris Lattner [Sat, 9 Apr 2011 05:51:34 +0000 (05:51 +0000)]
fix a potentially serious bug in AliasSet::removeCallSite
where we shrunk the list without updating the end iterator.
By inspection, from PR9639.

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