Bill Wendling
410ec4aad1
As Dan pointed out, movzbl, movsbl, and friends are nicer than their alias
...
(movzx/movsx) because they give more information. Revert that part of the patch.
llvm-svn: 129498
2011-04-14 01:46:37 +00:00
Bill Wendling
7e07d6fb69
Have the X86 back-end emit the alias instead of what's being aliased. In most
...
cases, it's much nicer and more informative reading the alias.
llvm-svn: 129497
2011-04-14 01:11:51 +00:00
Bill Wendling
6dd69d9241
Add an option to not print the alias of an instruction. It defaults to "print
...
the alias".
llvm-svn: 129485
2011-04-13 23:36:21 +00:00
Owen Anderson
9c12834eed
During post-legalization DAG combining, be careful to only create shifts where the RHS is of the legal type for the new operation.
...
llvm-svn: 129484
2011-04-13 23:22:23 +00:00
Johnny Chen
d0fb04f437
Thumb disassembler did not handle tBRIND (indirect branch) properly.
...
rdar://problem/9280370
llvm-svn: 129480
2011-04-13 21:59:01 +00:00
Mon P Wang
2e5528f0b2
Vectors with different number of elements of the same element type can have
...
the same allocation size but different primitive sizes(e.g., <3xi32> and
<4xi32>). When ScalarRepl promotes them, it can't use a bit cast but
should use a shuffle vector instead.
llvm-svn: 129472
2011-04-13 21:40:02 +00:00
Johnny Chen
b6a37bff21
Check for unallocated instruction encodings when disassembling Thumb Branch instructions (tBcc and t2Bcc).
...
rdar://problem/9280470
llvm-svn: 129471
2011-04-13 21:35:49 +00:00
Johnny Chen
ffa6378fd6
The LDR*T/STR*T (unpriviledged load/store) operations don't take SP or PC as Rt.
...
rdar://problem/9279440
llvm-svn: 129469
2011-04-13 21:04:32 +00:00
Cameron Zwarich
415b5e8341
Fix a typo in an ARM-specific DAG combine. This fixes <rdar://problem/9278274>.
...
llvm-svn: 129468
2011-04-13 21:01:19 +00:00
Benjamin Kramer
aabc142fce
Fix format string warning.
...
llvm-svn: 129467
2011-04-13 20:41:43 +00:00
Cameron Zwarich
9398197ef1
Fix a regression caused by r102515 where explicit alignment on globals is
...
ignored. There was a test to catch this, but it was just blindly updated in
a large change. This fixes another part of <rdar://problem/9275290>.
llvm-svn: 129466
2011-04-13 20:36:04 +00:00
Devang Patel
2772f662da
Fix debug message.
...
llvm-svn: 129463
2011-04-13 19:47:41 +00:00
Johnny Chen
70591cbc60
Check the corner cases for t2LDRSHi12 correctly and mark invalid encodings as such.
...
rdar://problem/9276651
llvm-svn: 129462
2011-04-13 19:46:05 +00:00
Devang Patel
e141234940
Remove extra bytes that were added for gdb. We do not have good poiner to understand actual reason behind this fixme. Spot checking suggest that newer gdb does not need this.
...
llvm-svn: 129461
2011-04-13 19:41:17 +00:00
Nick Lewycky
58d11415c1
Use positive values since the value type is unsigned. Fixes a warning on the
...
llvm-gcc-native-mingw32 builder.
llvm-svn: 129457
2011-04-13 18:46:22 +00:00
Johnny Chen
0d306a7840
Fix a bug where for t2MOVCCi disassembly, the TIED_TO register operand was not properly handled.
...
rdar://problem/9276427
llvm-svn: 129456
2011-04-13 17:51:02 +00:00
Johnny Chen
b2f9fa1fce
Forgot to add this change for http://llvm.org/viewvc/llvm-project?view=rev&revision=129387 .
...
llvm-svn: 129451
2011-04-13 16:56:08 +00:00
Junjie Gu
377cc31a74
Fixed the revision 129449.
...
llvm-svn: 129450
2011-04-13 16:45:49 +00:00
Junjie Gu
7c3b4593b5
Passing unroll parameters (unroll-count, threshold, and partial unroll) via LoopUnroll class's ctor. Doing so
...
will allow multiple context with different loop unroll parameters to run. This is a minor change and no effect
on existing application.
llvm-svn: 129449
2011-04-13 16:15:29 +00:00
Jim Grosbach
7cb41d787d
Load multiple object files and link them via RuntimeDyld in llvm-rtdyld.
...
Relocations between the object modules are properly resolved, as in the
following trivial example:
$ cat t.c
int foo();
int main() {
return foo();
}
$ cat foo.c
int foo() {
return 65;
}
$ clang -c t.c -fno-asynchronous-unwind-tables
$ clang -c foo.c -fno-asynchronous-unwind-tables
$ llvm-rtdyld t.o foo.o ; echo $?
loaded '_main' at: 0x10015c000
65
llvm-svn: 129448
2011-04-13 15:49:40 +00:00
Rafael Espindola
6aafb64daf
Add the alias analysis to the C api.
...
llvm-svn: 129447
2011-04-13 15:44:58 +00:00
Jim Grosbach
d35159a177
Allow user-specified program entry point for llvm-rtdyld.
...
llvm-svn: 129446
2011-04-13 15:38:30 +00:00
Jim Grosbach
956de1ff66
MCJIT relocation resolution.
...
llvm-svn: 129445
2011-04-13 15:28:10 +00:00
Oscar Fuentes
e2a114791c
Export LLVM_TARGETS_WITH_JIT in LLVMConfig.cmake.in. Without this,
...
component names such as "engine" do not expand to "jit" and hence to
the native target libraries for external users.
Thanks to arrowdodger for reporting and diagnosing the problem.
llvm-svn: 129444
2011-04-13 15:25:31 +00:00
Jay Foad
0091fe8ca1
PR9214: Convert ConstantExpr::getIndices() to return an ArrayRef, plus
...
related tweaks to ExprMapKeyType.
llvm-svn: 129443
2011-04-13 15:22:40 +00:00
Jakob Stoklund Olesen
cda53febec
Stop using dead function.
...
llvm-svn: 129442
2011-04-13 15:00:11 +00:00
Jay Foad
47f89e0f55
Remove some redundant llvm:: prefixes.
...
llvm-svn: 129441
2011-04-13 14:39:42 +00:00
Jay Foad
01b43b885b
Fix a comment.
...
llvm-svn: 129440
2011-04-13 13:48:09 +00:00
Jay Foad
5c984e563b
PR9214: Convert ConstantExpr::getWithOperands() to use ArrayRef.
...
llvm-svn: 129439
2011-04-13 13:46:01 +00:00
Jay Foad
fdb9f6a3ca
Fix typo.
...
llvm-svn: 129437
2011-04-13 13:03:56 +00:00
Jay Foad
603a731de9
Fix typo in comment.
...
llvm-svn: 129436
2011-04-13 12:50:47 +00:00
Jay Foad
3b422a1249
Like the coding standards say, do not use "using namespace std".
...
llvm-svn: 129435
2011-04-13 12:46:01 +00:00
Cameron Zwarich
70be27e913
Fix an obvious problem with an alignment computation. AsmPrinter actually does
...
the max itself, so it is not easy to write a test case for this, but I added a
test case that would fail if the code in AsmPrinter were removed.
llvm-svn: 129432
2011-04-13 09:02:43 +00:00
Cameron Zwarich
8001850ee8
Fix a typo.
...
llvm-svn: 129429
2011-04-13 06:39:16 +00:00
Cameron Zwarich
cdf59f7016
If a global variable has a specified alignment that is less than the preferred
...
alignment for its type, use the minimum of the specified alignment and the ABI
alignment. This fixes <rdar://problem/9275290>.
llvm-svn: 129428
2011-04-13 06:03:16 +00:00
Nick Lewycky
a8150b1c90
Use %ull here.
...
llvm-svn: 129423
2011-04-13 01:05:45 +00:00
Andrew Trick
b53a00d2cb
Recommit r129383. PreRA scheduler heuristic fixes: VRegCycle, TokenFactor latency.
...
Additional fixes:
Do something reasonable for subtargets with generic
itineraries by handle node latency the same as for an empty
itinerary. Now nodes default to unit latency unless an itinerary
explicitly specifies a zero cycle stage or it is a TokenFactor chain.
Original fixes:
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 the ndoe latency adjustments 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.
llvm-svn: 129421
2011-04-13 00:38:32 +00:00
Bill Wendling
b902f1dd88
Reapply r129401 with patch for clang.
...
llvm-svn: 129419
2011-04-13 00:36:11 +00:00
Eric Christopher
28f4c729f7
Temporarily revert r129408 to see if it brings the bots back.
...
llvm-svn: 129417
2011-04-13 00:20:59 +00:00
Rafael Espindola
539d96f01d
Be consistent about being virtual and returning void in the cfi methods.
...
Implement the ones that were missing in the asm streamer.
llvm-svn: 129413
2011-04-12 23:59:07 +00:00
Johnny Chen
3c2f74c9f3
Add sanity check for Ld/St Dual forms of Thumb2 instructions.
...
rdar://problem/9273947
llvm-svn: 129411
2011-04-12 23:31:00 +00:00
Jakob Stoklund Olesen
987164043c
Add @earlyclobber constraints to the writeback register of all ARM store instructions.
...
The ARMARM specifies these instructions as unpredictable when storing the
writeback register. This shouldn't affect code generation much since storing a
pointer to itself is quite rare.
llvm-svn: 129409
2011-04-12 23:27:48 +00:00
Eric Christopher
d829f43c06
Fix a bug where we were counting the alias sets as completely used
...
registers for fast allocation.
Fixes rdar://9207598
llvm-svn: 129408
2011-04-12 23:23:14 +00:00
Devang Patel
0e821f4673
I missed this new file in previous commit.
...
llvm-svn: 129407
2011-04-12 23:21:44 +00:00
Devang Patel
28dce70364
Simplify. There is no need to use static variable.
...
llvm-svn: 129406
2011-04-12 23:10:47 +00:00
Devang Patel
13d47f0ddc
Do not reuse parameter name.
...
llvm-svn: 129405
2011-04-12 23:09:06 +00:00
Dan Gohman
c8454ee995
Fix a hole in the definition of "dependence" used by trap values. Trap
...
values are also transmitted through branches which cause side effects to
be skipped altogether.
llvm-svn: 129404
2011-04-12 23:05:59 +00:00
Bill Wendling
dbfde42468
Revert r129401 for now. Clang is using the old way of doing things.
...
llvm-svn: 129403
2011-04-12 22:59:27 +00:00
Devang Patel
f20c4f715f
This mechanical patch moves type handling into CompileUnit from DwarfDebug. In case of multiple compile unit in one object file, each compile unit is responsible for its own set of type entries anyway. This refactoring makes this obvious.
...
llvm-svn: 129402
2011-04-12 22:53:02 +00:00
Bill Wendling
47c24875a1
Remove the unaligned load intrinsics in favor of using native unaligned loads.
...
Now that we have a first-class way to represent unaligned loads, the unaligned
load intrinsics are superfluous.
First part of <rdar://problem/8460511>.
llvm-svn: 129401
2011-04-12 22:46:31 +00:00
Eric Christopher
de9d58569f
Add more comments... err debug statements to the fast allocator.
...
llvm-svn: 129400
2011-04-12 22:17:44 +00:00
Oscar Fuentes
80cd17c79f
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!
llvm-svn: 129398
2011-04-12 22:10:38 +00:00
Johnny Chen
960eef3db3
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
llvm-svn: 129391
2011-04-12 21:41:51 +00:00
Jakob Stoklund Olesen
c49df2c05a
SparseBitVector is SLOW.
...
Use a Bitvector instead, we didn't need the smaller memory footprint anyway.
This makes the greedy register allocator 10% faster.
llvm-svn: 129390
2011-04-12 21:30:53 +00:00
Jim Grosbach
733d305fee
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
$
llvm-svn: 129388
2011-04-12 21:20:41 +00:00
Johnny Chen
01637b9acb
Add bad register checks for Thumb2 Ld/St instructions.
...
rdar://problem/9269047
llvm-svn: 129387
2011-04-12 21:17:51 +00:00
Andrew Trick
1b60ad6644
Revert 129383. It causes some targets to hit a scheduler assert.
...
llvm-svn: 129385
2011-04-12 20:14:07 +00:00
Nick Lewycky
2b473f8c85
Print our uint64_t with the more portable (C99 and C++0x) %PRIu64 format
...
specifier.
llvm-svn: 129384
2011-04-12 20:06:50 +00:00
Andrew Trick
c5dd24a542
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.
llvm-svn: 129383
2011-04-12 19:54:36 +00:00
Oscar Fuentes
23fe31cc8d
Document how to build a LLVM pass with CMake out of source.
...
Patch by arrowdodger!
llvm-svn: 129381
2011-04-12 19:40:35 +00:00
Nick Lewycky
3c974a6bde
The counters are unsigned.
...
llvm-svn: 129380
2011-04-12 19:35:45 +00:00
Jakob Stoklund Olesen
c70b697a40
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.
llvm-svn: 129379
2011-04-12 19:32:53 +00:00
Rafael Espindola
fd794affe5
Remove LastOffset from the asm parser.
...
llvm-svn: 129378
2011-04-12 18:53:30 +00:00
Johnny Chen
ab86a519f8
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.
llvm-svn: 129377
2011-04-12 18:48:00 +00:00
Jakob Stoklund Olesen
0840f50b76
Add SplitKit API to query and select the current interval being worked on.
...
This makes it possible to target multiple registers in one pass.
llvm-svn: 129374
2011-04-12 18:11:31 +00:00
Jakob Stoklund Olesen
68e84581c5
Fix a bug in RegAllocBase::addMBBLiveIns() where a basic block could accidentally be skipped.
...
llvm-svn: 129373
2011-04-12 18:11:28 +00:00
Devang Patel
4547a9e658
Remove dead typedef.
...
llvm-svn: 129368
2011-04-12 17:43:12 +00:00
Devang Patel
5eb4319dba
Refactor CompileUnit into a separate header.
...
llvm-svn: 129367
2011-04-12 17:40:32 +00:00
Johnny Chen
d0e2be39ea
Print out a debug message when the reglist fails the sanity check for Thumb Ld/St Multiple.
...
llvm-svn: 129365
2011-04-12 17:09:04 +00:00
Rafael Espindola
1ec0f46169
Fix the case of a .cfi_rel_offset before any .cfi_def_cfa_offset.
...
llvm-svn: 129362
2011-04-12 16:12:03 +00:00
Rafael Espindola
2e1c9d2188
Implement .cfi_same_value.
...
llvm-svn: 129361
2011-04-12 15:31:05 +00:00
Garrison Venn
a0f6ecb01f
Added new FIXME note
...
llvm-svn: 129360
2011-04-12 12:30:10 +00:00
Cameron Zwarich
fbcd69b96a
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>.
llvm-svn: 129345
2011-04-12 02:24:17 +00:00
NAKAMURA Takumi
3f28443a07
lib/Transforms/Instrumentation/CMakeLists.txt: Add LineProfiling.cpp to fix up r129340.
...
llvm-svn: 129343
2011-04-12 01:54:40 +00:00
Nick Lewycky
9d60e373cf
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.
llvm-svn: 129340
2011-04-12 01:06:09 +00:00
Nick Lewycky
fbc5a4004c
Consider ConstantAggregateZero as well as ConstantArray/Struct.
...
llvm-svn: 129338
2011-04-12 01:02:45 +00:00
Eric Christopher
c37833625a
Fix typo.
...
llvm-svn: 129334
2011-04-12 00:48:08 +00:00
Nick Lewycky
11168326f8
Make IRBuilder support StringRef for building strings.
...
Also document that the global variables produced are mergable.
llvm-svn: 129330
2011-04-12 00:29:07 +00:00
Jim Grosbach
3ed03f18d1
Tidy up a bit now that we're using the MemoryManager interface.
...
llvm-svn: 129328
2011-04-12 00:23:32 +00:00
Johnny Chen
f130b7f0f5
Add one test case (svc).
...
llvm-svn: 129327
2011-04-12 00:21:48 +00:00
Eric Christopher
ffc0e1f6e6
Match case for invalid constant error messages and add a new
...
test for invalid hexadecimals.
llvm-svn: 129326
2011-04-12 00:18:03 +00:00
Johnny Chen
672ef14a62
A8.6.16 B
...
Encoding T1 (tBcc)
if cond == '1110' then UNDEFINED;
rdar://problem/9268681
llvm-svn: 129325
2011-04-12 00:14:49 +00:00
Dan Gohman
1c6c34834b
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
llvm-svn: 129324
2011-04-12 00:11:56 +00:00
Eric Christopher
0a68959604
Test for invalid constant expr addition - bad octal constant.
...
llvm-svn: 129323
2011-04-12 00:03:38 +00:00
Eric Christopher
104af0619e
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.
llvm-svn: 129322
2011-04-12 00:03:13 +00:00
Jakob Stoklund Olesen
507992e909
Reuse live interval union between functions. This saves a bit of compile time
...
when compiling many small functions.
llvm-svn: 129321
2011-04-11 23:57:14 +00:00
Johnny Chen
dc8bf9ec08
Thumb disassembler was erroneously rejecting "blx sp" instruction.
...
rdar://problem/9267838
llvm-svn: 129320
2011-04-11 23:33:30 +00:00
Chris Lattner
7d4cdae564
comment cleanup, use moveBefore instead of removeFromParent+insertBefore.
...
llvm-svn: 129319
2011-04-11 23:24:57 +00:00
NAKAMURA Takumi
408c228367
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.
llvm-svn: 129317
2011-04-11 23:20:28 +00:00
Chris Lattner
e81d045d94
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.
llvm-svn: 129314
2011-04-11 23:09:44 +00:00
Wesley Peck
f30a0e2d80
Fix an error in the MBlaze delay slot filler.
...
llvm-svn: 129313
2011-04-11 22:45:02 +00:00
Daniel Dunbar
0625b1f860
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.
llvm-svn: 129312
2011-04-11 22:37:39 +00:00
Wesley Peck
1914c39bd4
Add scheduling information for the MBlaze backend.
...
llvm-svn: 129311
2011-04-11 22:31:52 +00:00
Eric Christopher
64749f2a89
Lex, and then fail on invalid constants.
...
Testcase forthcoming.
rdar://8490596
llvm-svn: 129309
2011-04-11 22:24:56 +00:00
Nick Lewycky
0f85789800
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.
llvm-svn: 129307
2011-04-11 22:11:20 +00:00
Rafael Espindola
82065cb6cf
Implement cfi_rel_offset
...
llvm-svn: 129306
2011-04-11 21:49:50 +00:00
Jakob Stoklund Olesen
0f175ebc32
Speed up eviction by stopping collectInterferingVRegs as soon as the spill
...
weight limit has been exceeded.
llvm-svn: 129305
2011-04-11 21:47:01 +00:00
Rafael Espindola
4f46abc15e
Add test for previous commit.
...
llvm-svn: 129304
2011-04-11 21:41:34 +00:00
Wesley Peck
e3685217d0
Don't crash on invalid instructions when disassembling MBlaze code.
...
This fixes http://llvm.org/bugs/show_bug.cgi?id=9653
llvm-svn: 129303
2011-04-11 21:35:21 +00:00
Bill Wendling
1e1f1c9ce1
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>
llvm-svn: 129302
2011-04-11 21:32:34 +00:00
Johnny Chen
f79d5365de
Fix the bug where the immediate shift amount for Thumb logical shift instructions are incorrectly disassembled.
...
rdar://problem/9266265
llvm-svn: 129298
2011-04-11 21:14:35 +00:00
Evan Cheng
ef42bea704
Look pass copies when determining whether hoisting would end up inserting more copies. rdar://9266679
...
llvm-svn: 129297
2011-04-11 21:09:18 +00:00
Rafael Espindola
ffd2e5163b
implement .cfi_adjust_cfa_offset.
...
llvm-svn: 129296
2011-04-11 20:29:16 +00:00
Eli Friedman
2c81975bae
Get rid of useless comment; if a file uses functions from a given header,
...
it is obvious that it should be included.
llvm-svn: 129295
2011-04-11 20:16:05 +00:00
Owen Anderson
5140802cd9
Fix another using-CPSR-twice bug in my ADCS/SBCS cleanups, and make proper use of the Commutable bit.
...
llvm-svn: 129294
2011-04-11 20:12:19 +00:00
Jakob Stoklund Olesen
b16e948029
Skip a binary search when possible.
...
llvm-svn: 129293
2011-04-11 20:01:44 +00:00
Jakob Stoklund Olesen
7d05bce70c
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.
llvm-svn: 129292
2011-04-11 20:01:41 +00:00
Garrison Venn
56c5ca2ee1
Because some systems have reported that this example would not build the
...
header file cstdio was added as an include.
llvm-svn: 129291
2011-04-11 19:52:49 +00:00
Johnny Chen
74adbddade
Trivial comment fix.
...
llvm-svn: 129288
2011-04-11 18:51:50 +00:00
Evan Cheng
fe917efc8b
Fix a couple of places where changes are made but not tracked.
...
llvm-svn: 129287
2011-04-11 18:47:20 +00:00
Johnny Chen
66fab75920
Check invalid register encodings for LdFrm/StFrm ARM instructions and flag them as
...
invalid instructions.
llvm-svn: 129286
2011-04-11 18:34:12 +00:00
Kevin Enderby
9377a52c12
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)
llvm-svn: 129284
2011-04-11 18:08:50 +00:00
Jakob Stoklund Olesen
f8beafe207
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.
llvm-svn: 129283
2011-04-11 18:08:10 +00:00
Jakob Stoklund Olesen
4fbbe3689d
Speed up LiveIntervalUnion::unify by handling end insertion specially.
...
This particularly helps with the initial transfer of fixed intervals.
llvm-svn: 129277
2011-04-11 15:00:44 +00:00
Jakob Stoklund Olesen
bfabc494f5
Time the initial seeding of live registers
...
llvm-svn: 129276
2011-04-11 15:00:42 +00:00
Jakob Stoklund Olesen
96d04c8e00
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.
llvm-svn: 129275
2011-04-11 15:00:39 +00:00
Oscar Fuentes
c6f2d0a4cf
CMake: remove some unnecesary code and ToDos.
...
Patch by arrowdodger!
llvm-svn: 129274
2011-04-11 14:52:39 +00:00
Jay Foad
0159a1ee11
Fix or remove code which seemed to think that the operand of a Constant
...
was always a User.
llvm-svn: 129272
2011-04-11 09:48:55 +00:00
Jay Foad
7c14a558fe
Don't include Operator.h from InstrTypes.h.
...
llvm-svn: 129271
2011-04-11 09:35:34 +00:00
Jay Foad
29426e87c1
Phi nodes always use an even number of operands, so don't ever allocate
...
an odd number.
llvm-svn: 129270
2011-04-11 09:25:51 +00:00
NAKAMURA Takumi
62920834fa
docs/CommandGuide/index.html: Fix CSS url to relative.
...
llvm-svn: 129268
2011-04-11 03:27:38 +00:00
NAKAMURA Takumi
2a7024fa6c
docs/CommandLine.html: "ize.
...
llvm-svn: 129267
2011-04-11 03:27:31 +00:00
Bill Wendling
35a9c3cd72
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
llvm-svn: 129259
2011-04-10 23:18:04 +00:00
Nicolas Geoffray
9137ee85de
Bugfix in the Cpp backend after API change on PHINode::Create.
...
llvm-svn: 129248
2011-04-10 17:39:40 +00:00
Oscar Fuentes
dbe99ba37d
CMake: support for using LLVM from client projects with find_package.
...
Patch by arrowdodger!
llvm-svn: 129247
2011-04-10 16:17:49 +00:00
Garrison Venn
88bd9d6bb8
Fixed more best practices, and explicit/implicit style guide issues.
...
llvm-svn: 129245
2011-04-10 14:06:52 +00:00
Oscar Fuentes
fe40844fb6
Reword instructions for running tests on Visual Studio.
...
Suggested by Maël Hörz.
llvm-svn: 129237
2011-04-10 01:41:55 +00:00
Bill Wendling
3d5450d809
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.)
llvm-svn: 129235
2011-04-10 00:04:27 +00:00
Chris Lattner
b799b2d4be
drive by bug fix: DenseMapInfo::isEqual should be determined according to
...
isEqual of its members, not operator==.
llvm-svn: 129233
2011-04-09 21:20:23 +00:00
Chris Lattner
077f0179bb
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.
...
llvm-svn: 129232
2011-04-09 19:56:28 +00:00
Chris Lattner
96d2507e79
make stuff work when LLVMCC_OPTION is something like installed-clang, not just clang.
...
llvm-svn: 129229
2011-04-09 19:53:16 +00:00
Chris Lattner
fc4fe00a65
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.
llvm-svn: 129223
2011-04-09 19:41:05 +00:00
Chris Lattner
214f114aa7
look for the verboten argument slot access in any order, thanks to Frits
...
for pointing this out
llvm-svn: 129217
2011-04-09 17:00:34 +00:00
Benjamin Kramer
26e7768f38
Fix potential buffer overflow on win32.
...
llvm-svn: 129214
2011-04-09 14:06:12 +00:00
Benjamin Kramer
2b6c96b43d
Don't store Twine temporaries, it's not safe.
...
And don't append the name over and over again in the loop.
llvm-svn: 129210
2011-04-09 11:26:27 +00:00
Benjamin Kramer
2792f2b86b
Make error message more useful.
...
llvm-svn: 129209
2011-04-09 10:10:35 +00:00
NAKAMURA Takumi
6bd36d56e4
docs/*.html: Make W3C HTML 4.01 Strict more compliant.
...
FIXME: The logo handling in ReleaseNotes.html
llvm-svn: 129208
2011-04-09 09:51:57 +00:00
Eli Friedman
9cca0715aa
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.
llvm-svn: 129207
2011-04-09 09:11:09 +00:00
Chris Lattner
88974f4625
fix PR9523, a crash in looprotate on a non-canonical loop made out of indirectbr.
...
llvm-svn: 129203
2011-04-09 07:25:58 +00:00
Chris Lattner
af1bccec68
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.
llvm-svn: 129200
2011-04-09 07:05:44 +00:00
Chris Lattner
cfe5aa65d2
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.
llvm-svn: 129199
2011-04-09 06:57:13 +00:00
Eli Friedman
17822fcde9
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.
llvm-svn: 129198
2011-04-09 06:55:46 +00:00
Eli Friedman
4db39cefdb
Test for r129190.
...
llvm-svn: 129197
2011-04-09 06:39:43 +00:00
Chris Lattner
e53c95f180
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.
llvm-svn: 129196
2011-04-09 06:37:03 +00:00
Chris Lattner
418b1037b0
fix two completely broken tests, which were matching due to PR9629.
...
llvm-svn: 129195
2011-04-09 06:34:38 +00:00
Chris Lattner
ea6afab4b0
remove a bunch of CHECK lines that aren't checking what
...
they thought they were, because alternation was expanding
wrong in {{}}'s.
llvm-svn: 129194
2011-04-09 06:31:06 +00:00
Chris Lattner
0687ec7051
regexes are allowed to match empty things, e.g. {{.*}} in filecheck.
...
llvm-svn: 129193
2011-04-09 06:29:24 +00:00
Chris Lattner
53e0679d6f
various cleanups, no functionality change.
...
llvm-svn: 129192
2011-04-09 06:18:02 +00:00
Chris Lattner
8872ec3ff0
revert accidental commit.
...
llvm-svn: 129191
2011-04-09 06:01:28 +00:00
Chris Lattner
2bd7015de5
fix a potentially serious bug in AliasSet::removeCallSite
...
where we shrunk the list without updating the end iterator.
By inspection, from PR9639.
llvm-svn: 129190
2011-04-09 05:51:34 +00:00
Jakob Stoklund Olesen
ed47ed4e80
Build the Hopfield network incrementally when splitting global live ranges.
...
It is common for large live ranges to have few basic blocks with register uses
and many live-through blocks without any uses. This approach grows the Hopfield
network incrementally around the use blocks, completely avoiding checking
interference for some through blocks.
llvm-svn: 129188
2011-04-09 02:59:09 +00:00
Jakob Stoklund Olesen
4ad6c160a5
Precompute interference for neighbor blocks as long as there is no interference.
...
This doesn't require seeking in the live interval union, so it is very cheap.
llvm-svn: 129187
2011-04-09 02:59:05 +00:00
Chris Lattner
0359101df2
fix doc comment bug, noticed by Jochen
...
llvm-svn: 129186
2011-04-09 02:33:29 +00:00
Chris Lattner
41c80e89f3
have dag combine zap "store undef", which can be formed during call lowering
...
with undef arguments.
llvm-svn: 129185
2011-04-09 02:32:02 +00:00
Chris Lattner
1c42a4d159
don't test for codegen of 'store undef'
...
llvm-svn: 129184
2011-04-09 02:31:26 +00:00
NAKAMURA Takumi
e8a8fd658f
docs/tutorial/OCamlLangImpl7.html: Fix a href to missing Chapter 8.
...
llvm-svn: 129183
2011-04-09 02:14:41 +00:00
NAKAMURA Takumi
b10df26061
docs: Fix some in-package URLs.
...
(eg. trim http://llvm.org/docs/foo -> foo)
llvm-svn: 129182
2011-04-09 02:13:48 +00:00
NAKAMURA Takumi
ca46f5a3b5
docs: Canonicalize URLs.
...
llvm-svn: 129181
2011-04-09 02:13:37 +00:00
Sean Callanan
1426351c83
Redirected errors from the AsmParser to the proper
...
error stream, in cases where the AsmParser is
being invoked by EDDisassembler. Before, they
were being sent to errs() because no error handler
was installed in the SourceMgr.
llvm-svn: 129177
2011-04-09 00:37:25 +00:00
Sean Callanan
7ccf375622
Moved an access to an object past a NULL check,
...
making the MC disassembler tester more robust.
llvm-svn: 129175
2011-04-09 00:21:04 +00:00
Devang Patel
12599c2187
Add radar number for future reference.
...
llvm-svn: 129172
2011-04-08 23:52:04 +00:00
Devang Patel
778947c203
Simplify array bound checks and clarify comments. One element array can have same non-zero number as lower bound as well as upper bound.
...
llvm-svn: 129170
2011-04-08 23:39:38 +00:00
Nick Lewycky
bd10af96bd
Add a function for profiling to run at shutdown. Unlike the existing API, this
...
can be used even when main() isn't present in the Module, but it means that you
don't get to read argv[].
llvm-svn: 129163
2011-04-08 22:19:52 +00:00
Matt Beaumont-Gay
4e1796e8d1
Fix an apparent typo that made GCC complain
...
llvm-svn: 129160
2011-04-08 21:59:49 +00:00
Devang Patel
e39647951b
Do not emit DW_AT_upper_bound and DW_AT_lower_bound for unbouded array.
...
If lower bound is more then upper bound then consider it is an unbounded array.
An array is unbounded if non-zero lower bound is same as upper bound.
If lower bound and upper bound are zero than array has one element.
llvm-svn: 129156
2011-04-08 21:55:10 +00:00
Bill Wendling
c5d44ae3f4
Missing closed tag.
...
llvm-svn: 129155
2011-04-08 21:43:08 +00:00
Evan Cheng
74d92c1924
Change -arm-trap-func= into a non-arm specific option. Now Intrinsic::trap is lowered into a call to the specified trap function at sdisel time.
...
llvm-svn: 129152
2011-04-08 21:37:21 +00:00
Jim Grosbach
ecd7043883
Workaround g++ 4.2.1 warning diagnostic false positive.
...
llvm-svn: 129149
2011-04-08 21:11:20 +00:00
Johnny Chen
f2faf4e53a
Check opcoe (dmb, dsb) instead of bitfields matching.
...
llvm-svn: 129148
2011-04-08 20:03:46 +00:00
Johnny Chen
a9570f77d5
Hanlde the checking of bad regs for SMMLAR properly, instead of asserting.
...
PR9650
rdar://problem/9257565
llvm-svn: 129147
2011-04-08 19:41:22 +00:00
Johnny Chen
875e0e4626
Sanity check the option operand for DMB/DSB.
...
PR9648
rdar://problem/9257634
llvm-svn: 129146
2011-04-08 19:18:07 +00:00
Jim Grosbach
a5dcd98a47
Mark hasExtraDefRegAllocReq=1 on LDRD.
...
The previous cleanup of LDRD got overzealous and removed it, causing post-RA
scheduling to get overzealous in breaking antidependencies and invalidate these instructions. Hilarity and invalid assembly ensued.
rdar://9244161
llvm-svn: 129144
2011-04-08 18:47:05 +00:00
Chris Lattner
a868bbbb66
reindent this whole file and do a variety of stylistic cleanups.
...
This code is still a long way from following best practices.
llvm-svn: 129140
2011-04-08 18:02:51 +00:00
Chris Lattner
ca320f54da
fix this to build with the recent StructType changes.
...
llvm-svn: 129139
2011-04-08 17:56:47 +00:00
Jim Grosbach
18b81c52bb
Refactor MCJIT 32-bit section loading.
...
Teach 32-bit section loading to use the Memory Manager interface, just like
the 64-bit loading does. Tidy up a few other things here and there.
llvm-svn: 129138
2011-04-08 17:31:24 +00:00
Johnny Chen
74c74ba81c
MOVi16 and MOVTi16 does not allow pc as the dest register, while MOVi allows it.
...
Add tests for that.
llvm-svn: 129137
2011-04-08 17:29:58 +00:00
Nick Lewycky
466d0c1f93
llvm.global_[cd]tor is defined to be either external, or appending with an array
...
of { i32, void ()* }. Teach the verifier to verify that, deleting copies of
checks strewn about.
llvm-svn: 129128
2011-04-08 07:30:21 +00:00
Bill Wendling
33984c6973
Only emit the AvailableFeatures variable if it's used.
...
llvm-svn: 129124
2011-04-08 04:08:57 +00:00
Bruno Cardoso Lopes
a21d470870
Also add the late notes for Mips in the current release note
...
llvm-svn: 129122
2011-04-08 03:06:22 +00:00
Johnny Chen
7e51b4640f
Add sanity checking for bad register specifier(s) for the DPFrm instructions.
...
Add more test cases to exercise the logical branches related to the above change.
llvm-svn: 129117
2011-04-08 00:29:09 +00:00
Rafael Espindola
9a1a34b105
Update tests
...
llvm-svn: 129116
2011-04-07 23:51:25 +00:00
Rafael Espindola
b80875edee
Micro optimization and improved similarity with gas' output:
...
When two section names share a suffix, reuse the entry in shstrtab.
llvm-svn: 129115
2011-04-07 23:21:52 +00:00
Devang Patel
bc3d8b212f
Do not let debug info interfer with branch folding.
...
llvm-svn: 129114
2011-04-07 23:11:25 +00:00
Johnny Chen
165a07adf9
Add a VEXT test.
...
llvm-svn: 129111
2011-04-07 22:04:01 +00:00
Bill Wendling
bc3f79044a
Replace the old algorithm that emitted the "print the alias for an instruction"
...
with the newer, cleaner model. It uses the IAPrinter class to hold the
information that is needed to match an instruction with its alias. This also
takes into account the available features of the platform.
There is one bit of ugliness. The way the logic determines if a pattern is
unique is O(N**2), which is gross. But in reality, the number of items it's
checking against isn't large. So while it's N**2, it shouldn't be a massive time
sink.
llvm-svn: 129110
2011-04-07 21:20:06 +00:00
Rafael Espindola
ece7c9c282
If present, use gold's support for getting a file view. This prevents having
...
to map the file both in the linker and in the plugin.
llvm-svn: 129109
2011-04-07 21:11:00 +00:00
Evan Cheng
9a3f2772f0
Add option to emit @llvm.trap as a function call instead of a trap instruction. rdar://9249183.
...
llvm-svn: 129107
2011-04-07 20:31:12 +00:00
Rafael Espindola
88bc341061
Add support for .skip.
...
Patch by Roman Divacky.
Fixes PR9361.
llvm-svn: 129106
2011-04-07 20:26:23 +00:00
Akira Hatanaka
052163e6d3
Fix indentation.
...
llvm-svn: 129105
2011-04-07 20:25:10 +00:00
Akira Hatanaka
94ee37e487
Update ATUsed every time after expandRegLargeImmPair is called.
...
llvm-svn: 129104
2011-04-07 20:23:26 +00:00
Mon P Wang
27f3330132
Fixed encoding for VEXTqf
...
llvm-svn: 129101
2011-04-07 19:56:12 +00:00
Andrew Trick
2ad0b37318
Added a check in the preRA scheduler for potential interference on a
...
induction variable. The preRA scheduler is unaware of induction vars,
so we look for potential "virtual register cycles" instead.
Fixes <rdar://problem/8946719> Bad scheduling prevents coalescing
llvm-svn: 129100
2011-04-07 19:54:57 +00:00
Akira Hatanaka
d6f1c58914
Fix handling of functions with internal linkage.
...
llvm-svn: 129099
2011-04-07 19:51:44 +00:00
Johnny Chen
04efb8f6ce
Add sanity checking for invalid register encodings for signed/unsigned extend instructions.
...
Add some test cases.
llvm-svn: 129098
2011-04-07 19:28:58 +00:00
Johnny Chen
07606661f9
Add sanity checking for invalid register encodings for saturating instructions.
...
llvm-svn: 129096
2011-04-07 19:02:08 +00:00
Jakob Stoklund Olesen
64beb47783
Recompute hasPHIKill flags when shrinking live intervals.
...
PHI values may be deleted, causing the flags to be wrong. This fixes PR9616.
llvm-svn: 129092
2011-04-07 18:43:14 +00:00
Johnny Chen
194a2267ad
Add some more comments about checkings of invalid register numbers.
...
And two test cases.
llvm-svn: 129090
2011-04-07 18:33:19 +00:00
Rafael Espindola
e4e4e37580
Expose more passes to the C API.
...
llvm-svn: 129087
2011-04-07 18:20:46 +00:00
Jakob Stoklund Olesen
994c16833c
Avoid moving iterators when the previous block was just visited.
...
llvm-svn: 129081
2011-04-07 17:27:50 +00:00
Jakob Stoklund Olesen
1c0db0fd21
Prefer multiplications to divisions.
...
llvm-svn: 129080
2011-04-07 17:27:48 +00:00