OSDN Git Service
Owen Anderson [Thu, 14 Apr 2011 17:30:49 +0000 (17:30 +0000)]
Fix another instance of the DAG combiner not using the correct type for the RHS of a shift.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129522
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Thu, 14 Apr 2011 15:21:16 +0000 (15:21 +0000)]
tests: Remove a FrontendC test which is no longer valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129519
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 14 Apr 2011 15:18:53 +0000 (15:18 +0000)]
Change ELF systems to use CFI for producing the EH tables. This reduces the
size of the clang binary in Debug builds from 690MB to 679MB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129518
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 14 Apr 2011 14:33:36 +0000 (14:33 +0000)]
Fix whitespace and tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129517
91177308-0d34-0410-b5e6-
96231b3b80d8
Mon P Wang [Thu, 14 Apr 2011 08:04:01 +0000 (08:04 +0000)]
Cleanup r129472 by using a utility routine as suggested by Eli.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129509
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 14 Apr 2011 05:15:06 +0000 (05:15 +0000)]
In the pre-RA scheduler, maintain cmp+br proximity.
This is done by pushing physical register definitions close to their
use, which happens to handle flag definitions if they're not glued to
the branch. This seems to be generally a good thing though, so I
didn't need to add a target hook yet.
The primary motivation is to generate code closer to what people
expect and rule out missed opportunity from enabling macro-op
fusion. As a side benefit, we get several 2-5% gains on x86
benchmarks. There is one regression:
SingleSource/Benchmarks/Shootout/lists slows down be -10%. But this is
an independent scheduler bug that will be tracked separately.
See rdar://problem/
9283108.
Incidentally, pre-RA scheduling is only half the solution. Fixing the
later passes is tracked by:
<rdar://problem/
8932804> [pre-RA-sched] on x86, attempt to schedule CMP/TEST adjacent with condition jump
Fixes:
<rdar://problem/
9262453> Scheduler unnecessary break of cmp/jump fusion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129508
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 14 Apr 2011 05:05:36 +0000 (05:05 +0000)]
Documented bugpoint --compile-custom --compile-command.
I've used it a few times to reduce unit tests and gotten one request for information on it. It's not easy to use correctly because bugpoint doesn't tell you when you're doing it wrong.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129507
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 14 Apr 2011 04:21:42 +0000 (04:21 +0000)]
add a minor missed dag combine that is blocking mid-level optimization
improvements, that will lead to fixing PR6627.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129504
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 14 Apr 2011 04:12:47 +0000 (04:12 +0000)]
sink a call into its only use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129503
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 14 Apr 2011 02:44:53 +0000 (02:44 +0000)]
rework FoldBranchToCommonDest to exit earlier when there is a bonus
instruction around, reducing work.
Greatly simplify handling of debug instructions. There is no need to
build up a vector of them and then move them into the one predecessor
if we're processing a block. Instead just rescan the block and *copy*
them into the pred. If a block gets merged into multiple preds, this
will retain more debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129502
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 14 Apr 2011 02:27:25 +0000 (02:27 +0000)]
fix a couple -Wsign-compare warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129501
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 14 Apr 2011 01:46:37 +0000 (01:46 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129498
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 14 Apr 2011 01:11:51 +0000 (01:11 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129497
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 13 Apr 2011 23:36:21 +0000 (23:36 +0000)]
Add an option to not print the alias of an instruction. It defaults to "print
the alias".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129485
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Wed, 13 Apr 2011 23:22:23 +0000 (23:22 +0000)]
During post-legalization DAG combining, be careful to only create shifts where the RHS is of the legal type for the new operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129484
91177308-0d34-0410-b5e6-
96231b3b80d8
Johnny Chen [Wed, 13 Apr 2011 21:59:01 +0000 (21:59 +0000)]
Thumb disassembler did not handle tBRIND (indirect branch) properly.
rdar://problem/
9280370
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129480
91177308-0d34-0410-b5e6-
96231b3b80d8
Mon P Wang [Wed, 13 Apr 2011 21:40:02 +0000 (21:40 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129472
91177308-0d34-0410-b5e6-
96231b3b80d8
Johnny Chen [Wed, 13 Apr 2011 21:35:49 +0000 (21:35 +0000)]
Check for unallocated instruction encodings when disassembling Thumb Branch instructions (tBcc and t2Bcc).
rdar://problem/
9280470
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129471
91177308-0d34-0410-b5e6-
96231b3b80d8
Johnny Chen [Wed, 13 Apr 2011 21:04:32 +0000 (21:04 +0000)]
The LDR*T/STR*T (unpriviledged load/store) operations don't take SP or PC as Rt.
rdar://problem/
9279440
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129469
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 13 Apr 2011 21:01:19 +0000 (21:01 +0000)]
Fix a typo in an ARM-specific DAG combine. This fixes <rdar://problem/
9278274>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129468
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 13 Apr 2011 20:41:43 +0000 (20:41 +0000)]
Fix format string warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129467
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 13 Apr 2011 20:36:04 +0000 (20:36 +0000)]
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>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129466
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 13 Apr 2011 19:47:41 +0000 (19:47 +0000)]
Fix debug message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129463
91177308-0d34-0410-b5e6-
96231b3b80d8
Johnny Chen [Wed, 13 Apr 2011 19:46:05 +0000 (19:46 +0000)]
Check the corner cases for t2LDRSHi12 correctly and mark invalid encodings as such.
rdar://problem/
9276651
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129462
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 13 Apr 2011 19:41:17 +0000 (19:41 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129461
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Wed, 13 Apr 2011 18:46:22 +0000 (18:46 +0000)]
Use positive values since the value type is unsigned. Fixes a warning on the
llvm-gcc-native-mingw32 builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129457
91177308-0d34-0410-b5e6-
96231b3b80d8
Johnny Chen [Wed, 13 Apr 2011 17:51:02 +0000 (17:51 +0000)]
Fix a bug where for t2MOVCCi disassembly, the TIED_TO register operand was not properly handled.
rdar://problem/
9276427
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129456
91177308-0d34-0410-b5e6-
96231b3b80d8
Johnny Chen [Wed, 13 Apr 2011 16:56:08 +0000 (16:56 +0000)]
Forgot to add this change for llvm.org/viewvc/llvm-project?view=rev&revision=129387.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129451
91177308-0d34-0410-b5e6-
96231b3b80d8
Junjie Gu [Wed, 13 Apr 2011 16:45:49 +0000 (16:45 +0000)]
Fixed the revision 129449.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129450
91177308-0d34-0410-b5e6-
96231b3b80d8
Junjie Gu [Wed, 13 Apr 2011 16:15:29 +0000 (16:15 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129449
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Wed, 13 Apr 2011 15:49:40 +0000 (15:49 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129448
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 13 Apr 2011 15:44:58 +0000 (15:44 +0000)]
Add the alias analysis to the C api.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129447
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Wed, 13 Apr 2011 15:38:30 +0000 (15:38 +0000)]
Allow user-specified program entry point for llvm-rtdyld.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129446
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Wed, 13 Apr 2011 15:28:10 +0000 (15:28 +0000)]
MCJIT relocation resolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129445
91177308-0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Wed, 13 Apr 2011 15:25:31 +0000 (15:25 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129444
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Wed, 13 Apr 2011 15:22:40 +0000 (15:22 +0000)]
PR9214: Convert ConstantExpr::getIndices() to return an ArrayRef, plus
related tweaks to ExprMapKeyType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129443
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 13 Apr 2011 15:00:11 +0000 (15:00 +0000)]
Stop using dead function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129442
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Wed, 13 Apr 2011 14:39:42 +0000 (14:39 +0000)]
Remove some redundant llvm:: prefixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129441
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Wed, 13 Apr 2011 13:48:09 +0000 (13:48 +0000)]
Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129440
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Wed, 13 Apr 2011 13:46:01 +0000 (13:46 +0000)]
PR9214: Convert ConstantExpr::getWithOperands() to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129439
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Wed, 13 Apr 2011 13:03:56 +0000 (13:03 +0000)]
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129437
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Wed, 13 Apr 2011 12:50:47 +0000 (12:50 +0000)]
Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129436
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Wed, 13 Apr 2011 12:46:01 +0000 (12:46 +0000)]
Like the coding standards say, do not use "using namespace std".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129435
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 13 Apr 2011 09:02:43 +0000 (09:02 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129432
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 13 Apr 2011 06:39:16 +0000 (06:39 +0000)]
Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129429
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 13 Apr 2011 06:03:16 +0000 (06:03 +0000)]
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>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129428
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Wed, 13 Apr 2011 01:05:45 +0000 (01:05 +0000)]
Use %ull here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129423
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 13 Apr 2011 00:38:32 +0000 (00:38 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129421
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 13 Apr 2011 00:36:11 +0000 (00:36 +0000)]
Reapply r129401 with patch for clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129419
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 13 Apr 2011 00:20:59 +0000 (00:20 +0000)]
Temporarily revert r129408 to see if it brings the bots back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129417
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 12 Apr 2011 23:59:07 +0000 (23:59 +0000)]
Be consistent about being virtual and returning void in the cfi methods.
Implement the ones that were missing in the asm streamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129413
91177308-0d34-0410-b5e6-
96231b3b80d8
Johnny Chen [Tue, 12 Apr 2011 23:31:00 +0000 (23:31 +0000)]
Add sanity check for Ld/St Dual forms of Thumb2 instructions.
rdar://problem/
9273947
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129411
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 12 Apr 2011 23:27:48 +0000 (23:27 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129409
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 12 Apr 2011 23:23:14 +0000 (23:23 +0000)]
Fix a bug where we were counting the alias sets as completely used
registers for fast allocation.
Fixes rdar://
9207598
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129408
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 12 Apr 2011 23:21:44 +0000 (23:21 +0000)]
I missed this new file in previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129407
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 12 Apr 2011 23:10:47 +0000 (23:10 +0000)]
Simplify. There is no need to use static variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129406
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 12 Apr 2011 23:09:06 +0000 (23:09 +0000)]
Do not reuse parameter name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129405
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 12 Apr 2011 23:05:59 +0000 (23:05 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129404
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 12 Apr 2011 22:59:27 +0000 (22:59 +0000)]
Revert r129401 for now. Clang is using the old way of doing things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129403
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 12 Apr 2011 22:53:02 +0000 (22:53 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129402
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 12 Apr 2011 22:46:31 +0000 (22:46 +0000)]
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>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129401
91177308-0d34-0410-b5e6-
96231b3b80d8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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