oota-llvm.git
13 years agoFix fast-isel address mode folding to avoid folding instructions
Dan Gohman [Tue, 22 Mar 2011 00:04:35 +0000 (00:04 +0000)]
Fix fast-isel address mode folding to avoid folding instructions
outside of the current basic block. This fixes PR9500, rdar://9156159.

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

13 years agoAdd support for Thumb interworking addresses for symbol offsets that get constant...
Owen Anderson [Mon, 21 Mar 2011 23:13:43 +0000 (23:13 +0000)]
Add support for Thumb interworking addresses for symbol offsets that get constant folded very early.
This fixes SPASS with -integrated-as.  <rdar://problem/9165399>

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

13 years agoTry again to make this test darwin only.
Devang Patel [Mon, 21 Mar 2011 23:11:08 +0000 (23:11 +0000)]
Try again to make this test darwin only.

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

13 years agoBuild the new RuntimeDyld library.
Oscar Fuentes [Mon, 21 Mar 2011 23:07:53 +0000 (23:07 +0000)]
Build the new RuntimeDyld library.

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

13 years agoRemoved workaround for unspecified build problem on MinGW.
Oscar Fuentes [Mon, 21 Mar 2011 22:53:51 +0000 (22:53 +0000)]
Removed workaround for unspecified build problem on MinGW.

Tested that MinGW/MSYS builds fine without that.

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

13 years agoLibrary-ize the dyld components of llvm-rtdyld.
Jim Grosbach [Mon, 21 Mar 2011 22:15:52 +0000 (22:15 +0000)]
Library-ize the dyld components of llvm-rtdyld.

Move the dynamic linking functionality of the llvm-rtdyld program into an
ExecutionEngine support library. Update llvm-rtdyld to just load an object
file into memory, use the library to process it, then run the _main()
function, if one is found.

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

13 years agoSimplify.
Devang Patel [Mon, 21 Mar 2011 22:04:45 +0000 (22:04 +0000)]
Simplify.

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

13 years agoFix INT_MIN gotcha pointed out by Eli Friedman.
Nick Lewycky [Mon, 21 Mar 2011 21:40:32 +0000 (21:40 +0000)]
Fix INT_MIN gotcha pointed out by Eli Friedman.

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

13 years agoForce x86_64.
Devang Patel [Mon, 21 Mar 2011 21:37:52 +0000 (21:37 +0000)]
Force x86_64.

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

13 years agoCall static functions so that they aren't left unused.
Bill Wendling [Mon, 21 Mar 2011 21:08:27 +0000 (21:08 +0000)]
Call static functions so that they aren't left unused.

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

13 years agoEnable this test only for Darwin.
Devang Patel [Mon, 21 Mar 2011 20:32:56 +0000 (20:32 +0000)]
Enable this test only for Darwin.

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

13 years agoProvide a means for CrashRecovery clients to determine if code is currently running...
Ted Kremenek [Mon, 21 Mar 2011 18:38:03 +0000 (18:38 +0000)]
Provide a means for CrashRecovery clients to determine if code is currently running while crash recovery cleanups are being processed.

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

13 years agoAllow a client to clear an IntrustiveRefCntPtr (deliberately leaking the referenced...
Ted Kremenek [Mon, 21 Mar 2011 18:37:59 +0000 (18:37 +0000)]
Allow a client to clear an IntrustiveRefCntPtr (deliberately leaking the referenced object).

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

13 years agoFix unused param warning.
Eric Christopher [Mon, 21 Mar 2011 18:06:32 +0000 (18:06 +0000)]
Fix unused param warning.

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

13 years agoGrammar-o.
Eric Christopher [Mon, 21 Mar 2011 18:06:21 +0000 (18:06 +0000)]
Grammar-o.

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

13 years agoFix typos in assert messages.
Jay Foad [Mon, 21 Mar 2011 16:38:22 +0000 (16:38 +0000)]
Fix typos in assert messages.

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

13 years agoMore cleanups to the OptimizeEmptyGlobalCXXDtors GlobalOpt function.
Anders Carlsson [Mon, 21 Mar 2011 14:54:40 +0000 (14:54 +0000)]
More cleanups to the OptimizeEmptyGlobalCXXDtors GlobalOpt function.

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

13 years agoA WIP commit of the InstAlias printing cleanup. This code will soon replace the
Bill Wendling [Mon, 21 Mar 2011 08:59:17 +0000 (08:59 +0000)]
A WIP commit of the InstAlias printing cleanup. This code will soon replace the
code below it. Even though it looks very similar, it will match more precisely
and geneate better functions in the long run.

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

13 years agoAdd the IAPrinter class.
Bill Wendling [Mon, 21 Mar 2011 08:40:31 +0000 (08:40 +0000)]
Add the IAPrinter class.

This is a helper class that will make it easier to say which InstAliases can be
printed and which cannot (because of ambiguity).

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

13 years ago* Add classes that support the "feature" information.
Bill Wendling [Mon, 21 Mar 2011 08:31:53 +0000 (08:31 +0000)]
* Add classes that support the "feature" information.
* Move the code that emits the reg in reg class matching into its own function.

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

13 years agoWe need to pass the TargetMachine object to the InstPrinter if we are printing
Bill Wendling [Mon, 21 Mar 2011 04:13:46 +0000 (04:13 +0000)]
We need to pass the TargetMachine object to the InstPrinter if we are printing
the alias of an InstAlias instead of the thing being aliased. Because we need to
know the features that are valid for an InstAlias.

This is part of a work-in-progress.

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

13 years agoAs suggested by Nick Lewycky, ignore debugging intrinsics when trying to decide wheth...
Anders Carlsson [Mon, 21 Mar 2011 02:42:27 +0000 (02:42 +0000)]
As suggested by Nick Lewycky, ignore debugging intrinsics when trying to decide whether a destructor is empty or not.

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

13 years agoFix comments
Nick Lewycky [Mon, 21 Mar 2011 02:26:01 +0000 (02:26 +0000)]
Fix comments

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

13 years agoThis README entry was fixed recently.
Eli Friedman [Mon, 21 Mar 2011 01:33:03 +0000 (01:33 +0000)]
This README entry was fixed recently.

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

13 years agoRe-apply r127953 with fixes: eliminate empty return block if it has no predecessors...
Evan Cheng [Mon, 21 Mar 2011 01:19:09 +0000 (01:19 +0000)]
Re-apply r127953 with fixes: eliminate empty return block if it has no predecessors; update dominator tree if cfg is modified.

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

13 years agoDon't try to eliminate invokes to __cxa_atexit.
Anders Carlsson [Sun, 20 Mar 2011 20:21:33 +0000 (20:21 +0000)]
Don't try to eliminate invokes to __cxa_atexit.

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

13 years agoDon't segfault on mutual recursion, as pointed out by Frits.
Anders Carlsson [Sun, 20 Mar 2011 20:16:43 +0000 (20:16 +0000)]
Don't segfault on mutual recursion, as pointed out by Frits.

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

13 years agoAddress comments from Frits van Bommel.
Anders Carlsson [Sun, 20 Mar 2011 19:51:13 +0000 (19:51 +0000)]
Address comments from Frits van Bommel.

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

13 years agoProcess all dead defs after rematerializing during splitting.
Jakob Stoklund Olesen [Sun, 20 Mar 2011 19:46:23 +0000 (19:46 +0000)]
Process all dead defs after rematerializing during splitting.

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

13 years agoWrite the section table and the section data in the same order that
Rafael Espindola [Sun, 20 Mar 2011 18:44:20 +0000 (18:44 +0000)]
Write the section table and the section data in the same order that
gun as does. This makes it a lot easier to compare the output of both
as the addresses are now a lot closer.

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

13 years agoAdd an optimization to GlobalOpt that eliminates calls to __cxa_atexit, if the functi...
Anders Carlsson [Sun, 20 Mar 2011 17:59:11 +0000 (17:59 +0000)]
Add an optimization to GlobalOpt that eliminates calls to __cxa_atexit, if the function passed is empty.

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

13 years agoAvoid initializing posix_spawn_file_actions_t if not used.
Benjamin Kramer [Sun, 20 Mar 2011 15:52:24 +0000 (15:52 +0000)]
Avoid initializing posix_spawn_file_actions_t if not used.

- glibc falls back to fork+exec if a file actions object is present.
- On BSDs this saves a malloc.

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

13 years agoIf a class inherits from RefCountedBaseVPTR allow all its subclasses to be used with...
Argyrios Kyrtzidis [Sun, 20 Mar 2011 06:14:56 +0000 (06:14 +0000)]
If a class inherits from RefCountedBaseVPTR allow all its subclasses to be used with IntrusiveRefCntPtr.

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

13 years agoAlso eliminate redundant spills downstream of inserted reloads.
Jakob Stoklund Olesen [Sun, 20 Mar 2011 05:44:58 +0000 (05:44 +0000)]
Also eliminate redundant spills downstream of inserted reloads.

This can happen when multiple sibling registers are spilled after live range
splitting.

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

13 years agoChange an argument to a LiveInterval instead of a register number to save some redund...
Jakob Stoklund Olesen [Sun, 20 Mar 2011 05:44:55 +0000 (05:44 +0000)]
Change an argument to a LiveInterval instead of a register number to save some redundant lookups.

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

13 years agoDisable test in a way that keeps lit happy.
Daniel Dunbar [Sun, 20 Mar 2011 00:04:51 +0000 (00:04 +0000)]
Disable test in a way that keeps lit happy.

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

13 years agoReplace a broken LiveInterval::MergeValueInAsValue() with something simpler.
Jakob Stoklund Olesen [Sat, 19 Mar 2011 23:02:49 +0000 (23:02 +0000)]
Replace a broken LiveInterval::MergeValueInAsValue() with something simpler.

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

13 years agoAdd debug output.
Jakob Stoklund Olesen [Sat, 19 Mar 2011 23:02:47 +0000 (23:02 +0000)]
Add debug output.

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

13 years agoMake llvm-config.in configuration more MSYS-friendly.
Oscar Fuentes [Sat, 19 Mar 2011 22:52:33 +0000 (22:52 +0000)]
Make llvm-config.in configuration more MSYS-friendly.

Some of those POSIX <-> Windows command line conversions ended on
failure.

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

13 years agoCMake: store TARGET_TRIPLE on llvm-config.in.
Oscar Fuentes [Sat, 19 Mar 2011 22:52:25 +0000 (22:52 +0000)]
CMake: store TARGET_TRIPLE on llvm-config.in.

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

13 years agoUpdate CMake library dependencies.
Oscar Fuentes [Sat, 19 Mar 2011 22:52:13 +0000 (22:52 +0000)]
Update CMake library dependencies.

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

13 years agoRevert r127953, "SimplifyCFG has stopped duplicating returns into predecessors
Daniel Dunbar [Sat, 19 Mar 2011 21:47:14 +0000 (21:47 +0000)]
Revert r127953, "SimplifyCFG has stopped duplicating returns into predecessors
to canonicalize IR", it broke a lot of things.

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

13 years agoSimplifyCFG has stopped duplicating returns into predecessors to canonicalize IR
Evan Cheng [Sat, 19 Mar 2011 17:17:39 +0000 (17:17 +0000)]
SimplifyCFG has stopped duplicating returns into predecessors to canonicalize IR
to have single return block (at least getting there) for optimizations. This
is general goodness but it would prevent some tailcall optimizations.
One specific case is code like this:
int f1(void);
int f2(void);
int f3(void);
int f4(void);
int f5(void);
int f6(void);
int foo(int x) {
  switch(x) {
  case 1: return f1();
  case 2: return f2();
  case 3: return f3();
  case 4: return f4();
  case 5: return f5();
  case 6: return f6();
  }
}

=>
LBB0_2:                                 ## %sw.bb
  callq   _f1
  popq    %rbp
  ret
LBB0_3:                                 ## %sw.bb1
  callq   _f2
  popq    %rbp
  ret
LBB0_4:                                 ## %sw.bb3
  callq   _f3
  popq    %rbp
  ret

This patch teaches codegenprep to duplicate returns when the return value
is a phi and where the phi operands are produced by tail calls followed by
an unconditional branch:

sw.bb7:                                           ; preds = %entry
  %call8 = tail call i32 @f5() nounwind
  br label %return
sw.bb9:                                           ; preds = %entry
  %call10 = tail call i32 @f6() nounwind
  br label %return
return:
  %retval.0 = phi i32 [ %call10, %sw.bb9 ], [ %call8, %sw.bb7 ], ... [ 0, %entry ]
  ret i32 %retval.0

This allows codegen to generate better code like this:

LBB0_2:                                 ## %sw.bb
        jmp     _f1                     ## TAILCALL
LBB0_3:                                 ## %sw.bb1
        jmp     _f2                     ## TAILCALL
LBB0_4:                                 ## %sw.bb3
        jmp     _f3                     ## TAILCALL

rdar://9147433

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

13 years agoMinor code re-structuring.
Evan Cheng [Sat, 19 Mar 2011 17:03:16 +0000 (17:03 +0000)]
Minor code re-structuring.

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

13 years agoAdd support for legalizing UINT_TO_FP of vectors on platforms which do
Nadav Rotem [Sat, 19 Mar 2011 13:09:10 +0000 (13:09 +0000)]
Add support for legalizing UINT_TO_FP of vectors on platforms which do
not have native support for this operation (such as X86).
The legalized code uses two vector INT_TO_FP operations and is faster
than scalarizing.

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

13 years agoUpdate Passes.html, part 3: alphabetize descriptions.
Eli Friedman [Sat, 19 Mar 2011 05:02:14 +0000 (05:02 +0000)]
Update Passes.html, part 3: alphabetize descriptions.

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

13 years agoUpdate Passes.html, part 2: cleanup a bit more dead docs, a few more
Eli Friedman [Sat, 19 Mar 2011 04:55:29 +0000 (04:55 +0000)]
Update Passes.html, part 2: cleanup a bit more dead docs, a few more
description updates.

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

13 years agoUpdate Passes.html, part 1: remove passes which were removed from the tree,
Eli Friedman [Sat, 19 Mar 2011 04:47:52 +0000 (04:47 +0000)]
Update Passes.html, part 1: remove passes which were removed from the tree,
update short descriptions to match those from the options, alphabetize table
of contents.

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

13 years agoDisable test to unbreak Linux. Radar 9156771.
Stuart Hastings [Sat, 19 Mar 2011 03:56:38 +0000 (03:56 +0000)]
Disable test to unbreak Linux.  Radar 9156771.

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

13 years agoReapply 127939 since Daniel fixed the breakage. <rdar://problem/9012638>
Stuart Hastings [Sat, 19 Mar 2011 02:42:31 +0000 (02:42 +0000)]
Reapply 127939 since Daniel fixed the breakage.  <rdar://problem/9012638>

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

13 years agoRevert 127939. <rdar://problem/9012638>
Stuart Hastings [Sat, 19 Mar 2011 02:33:56 +0000 (02:33 +0000)]
Revert 127939.  <rdar://problem/9012638>

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

13 years agoTest case for r127940.
Devang Patel [Sat, 19 Mar 2011 01:40:43 +0000 (01:40 +0000)]
Test case for r127940.

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

13 years agoRevise r126127 to address Daniel's comments. <rdar://problem/9012638>
Stuart Hastings [Sat, 19 Mar 2011 01:32:01 +0000 (01:32 +0000)]
Revise r126127 to address Daniel's comments.  <rdar://problem/9012638>

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

13 years agoFixed an assert by the ARM disassembler for LDRD_PRE/POST.
Johnny Chen [Sat, 19 Mar 2011 01:16:20 +0000 (01:16 +0000)]
Fixed an assert by the ARM disassembler for LDRD_PRE/POST.
The relevant instruction table entries were changed sometime ago to no longer take
<Rt2> as an operand.  Modify ARMDisassemblerCore.cpp to accomodate the change and
add a test case.

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

13 years agoTweak CrashRecoveryContextCleanup to provide an easy method for clients to select...
Ted Kremenek [Sat, 19 Mar 2011 00:59:37 +0000 (00:59 +0000)]
Tweak CrashRecoveryContextCleanup to provide an easy method for clients to select between 'delete' and 'destructor' cleanups, and allow the destructor of CrashRecoveryContextCleanupRegister to be pseudo re-entrant.

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

13 years agoTweak CrashRecoveryContext::GetCurrent() to return quickly if 'gCrsahRecoveryEnabled...
Ted Kremenek [Sat, 19 Mar 2011 00:59:33 +0000 (00:59 +0000)]
Tweak CrashRecoveryContext::GetCurrent() to return quickly if 'gCrsahRecoveryEnabled' is false.  This avoids us needing to go to thread local storage for
the performance sensitive case where we are compiling code.

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

13 years agoFileCheckize a test.
Andrew Trick [Sat, 19 Mar 2011 00:41:39 +0000 (00:41 +0000)]
FileCheckize a test.
(one-by-one until valgrind is happy)

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

13 years agoIf an AllocaInst referred by DbgDeclareInst is used by a LoadInst then the LoadInst...
Devang Patel [Fri, 18 Mar 2011 23:45:43 +0000 (23:45 +0000)]
If an AllocaInst referred by DbgDeclareInst is used by a LoadInst then the LoadInst should also get a corresponding llvm.dbg.value intrinsic.

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

13 years agoRemove dead code.
Devang Patel [Fri, 18 Mar 2011 23:33:58 +0000 (23:33 +0000)]
Remove dead code.

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

13 years agoConsider debug info intrinsics pointing to null value as dead instructions.
Devang Patel [Fri, 18 Mar 2011 23:28:02 +0000 (23:28 +0000)]
Consider debug info intrinsics pointing to null value as dead instructions.

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

13 years agoSilence a warning.
Jim Grosbach [Fri, 18 Mar 2011 22:50:49 +0000 (22:50 +0000)]
Silence a warning.

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

13 years agoAdd support to the ARM asm parser for the register-shifted-register forms of basic...
Owen Anderson [Fri, 18 Mar 2011 22:50:18 +0000 (22:50 +0000)]
Add support to the ARM asm parser for the register-shifted-register forms of basic instructions like ADD.  More work left to be done to support other instances of shifter ops in the ISA.

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

13 years agoBeginnings of MC-JIT code generation.
Jim Grosbach [Fri, 18 Mar 2011 22:48:41 +0000 (22:48 +0000)]
Beginnings of MC-JIT code generation.

Proof-of-concept code that code-gens a module to an in-memory MachO object.
This will be hooked up to a run-time dynamic linker library (see: llvm-rtdyld
for similarly conceptual work for that part) which will take the compiled
object and link it together with the rest of the system, providing back to the
JIT a table of available symbols which will be used to respond to the
getPointerTo*() queries.

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

13 years agoMatch a few more obvious patterns to revsh. rdar://9147637.
Evan Cheng [Fri, 18 Mar 2011 21:52:42 +0000 (21:52 +0000)]
Match a few more obvious patterns to revsh. rdar://9147637.

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

13 years agoExtend live debug values down the dominator tree by following copies.
Jakob Stoklund Olesen [Fri, 18 Mar 2011 21:42:19 +0000 (21:42 +0000)]
Extend live debug values down the dominator tree by following copies.

The llvm.dbg.value intrinsic refers to SSA values, not virtual registers, so we
should be able to extend the range of a value by tracking that value through
register copies. This greatly improves the debug value tracking for function
arguments that for some reason are copied to a second virtual register at the
end of the entry block.

We only extend the debug value range where its register is killed. All original
llvm.dbg.value locations are still respected.

Copies from physical registers are ignored. That should not be a problem since
the entry block already adds DBG_VALUE instructions for the virtual registers
holding the function arguments.

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

13 years agoRevert r127852; it's apparently causing an ICE on mingw.
Eli Friedman [Fri, 18 Mar 2011 21:12:29 +0000 (21:12 +0000)]
Revert r127852; it's apparently causing an ICE on mingw.

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

13 years agoUse lazy parsing in LTO. Unfortunately this is only a 3% time saving for
Rafael Espindola [Fri, 18 Mar 2011 19:51:00 +0000 (19:51 +0000)]
Use lazy parsing in LTO. Unfortunately this is only a 3% time saving for
'ar'. Have to figure out how to make libLTO even lazier.

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

13 years agoClean whitespace.
Owen Anderson [Fri, 18 Mar 2011 19:47:14 +0000 (19:47 +0000)]
Clean whitespace.

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

13 years agoReduce code duplication.
Owen Anderson [Fri, 18 Mar 2011 19:46:58 +0000 (19:46 +0000)]
Reduce code duplication.

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

13 years agoPTX: Fix various codegen issues
Justin Holewinski [Fri, 18 Mar 2011 19:24:28 +0000 (19:24 +0000)]
PTX: Fix various codegen issues

- Emit mad instead of mad.rn for shader model 1.0
- Emit explicit mov.u32 instructions for reading global variables
- (most PTX instructions cannot take global variable immediates)

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

13 years agoAdd llvm-rtdyld support for loading 32-bit code.
Jim Grosbach [Fri, 18 Mar 2011 18:54:32 +0000 (18:54 +0000)]
Add llvm-rtdyld support for loading 32-bit code.

Factor out the 64-bit specific bits into a helper function and add an
equivalent that loads the 32-bit sections. This allows using llvm-rtdyld on ARM.

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

13 years agosetExecutable() should default to success if there's nothing custom for it.
Jim Grosbach [Fri, 18 Mar 2011 18:51:03 +0000 (18:51 +0000)]
setExecutable() should default to success if there's nothing custom for it.

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

13 years agoThumb2 PC-relative loads require a fixup rather than just an immediate.
Owen Anderson [Fri, 18 Mar 2011 17:42:55 +0000 (17:42 +0000)]
Thumb2 PC-relative loads require a fixup rather than just an immediate.

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

13 years agoUpdate list of link components for llvm-rtdyld.
Oscar Fuentes [Fri, 18 Mar 2011 17:27:04 +0000 (17:27 +0000)]
Update list of link components for llvm-rtdyld.

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

13 years agoNaming conventional tidy up.
Jim Grosbach [Fri, 18 Mar 2011 17:24:21 +0000 (17:24 +0000)]
Naming conventional tidy up.

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

13 years agoMachO file loader and execution utility.
Jim Grosbach [Fri, 18 Mar 2011 17:11:39 +0000 (17:11 +0000)]
MachO file loader and execution utility.

Add a bone-simple utility to load a MachO object into memory, look for
a function (main) in it, and run that function directly. This will be used
as a test and development platform for MC-JIT work regarding symbol resolution,
dynamic lookup, etc..

Code by Daniel Dunbar.

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

13 years agoAvoid creating canonical induction variables for non-native types.
Andrew Trick [Fri, 18 Mar 2011 16:50:32 +0000 (16:50 +0000)]
Avoid creating canonical induction variables for non-native types.
For example, on 32-bit architecture, don't promote all uses of the IV
to 64-bits just because one use is a 64-bit cast.
Alternate implementation of the patch by Arnaud de Grandmaison.

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

13 years agoTidy up.
Jim Grosbach [Fri, 18 Mar 2011 16:39:36 +0000 (16:39 +0000)]
Tidy up.

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

13 years agoSupport explicit argument forms for the X86 string instructions.
Joerg Sonnenberger [Fri, 18 Mar 2011 11:59:40 +0000 (11:59 +0000)]
Support explicit argument forms for the X86 string instructions.
For now, only the default segments are supported.

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

13 years agoptx: fix parameter order that is reversed
Che-Liang Chiou [Fri, 18 Mar 2011 11:23:56 +0000 (11:23 +0000)]
ptx: fix parameter order that is reversed

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

13 years agoptx: add unconditional and conditional branch
Che-Liang Chiou [Fri, 18 Mar 2011 11:08:52 +0000 (11:08 +0000)]
ptx: add unconditional and conditional branch

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

13 years agoraw_ostream: [PR6745] Tweak formatting (double)%e for Windows hosts.
NAKAMURA Takumi [Fri, 18 Mar 2011 09:30:10 +0000 (09:30 +0000)]
raw_ostream: [PR6745] Tweak formatting (double)%e for Windows hosts.

On MSVCRT and compatible, output of %e is incompatible to Posix by default. Number of exponent digits should be at least 2. "%+03d"

FIXME: Implement our formatter in future!

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

13 years agoInitialize the only-used-with-PPC-double-double parts of the APFloat class. This
Bill Wendling [Fri, 18 Mar 2011 09:09:44 +0000 (09:09 +0000)]
Initialize the only-used-with-PPC-double-double parts of the APFloat class. This
makes valgrind stop complaining about uninitialized variables being read when it
accesses a bitfield (category) that shares its bits with these variables.

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

13 years agoSimplify the computation of undefined symbols. Instead of walking
Rafael Espindola [Fri, 18 Mar 2011 05:12:38 +0000 (05:12 +0000)]
Simplify the computation of undefined symbols. Instead of walking
functions and initializers, just report the declarations present in
the module.

The motivation is to open the way for using the lazy module parsing,
which should speed up clients that just want a symbol list (nm, ar).

This is slightly less precise, but since both -strip-dead-prototypes
and -globaldce are part of the standard pipeline, this shouldn't
change the result for clang/dragonegg produced binaries.

Any decl in an IL file was also put there because a FE expected it
to be necessary, so this should not be a problem for "-O0 -emit-llvm".

As a sanity check, I have bootstrapped clang on linux and built
firefox on both linux and darwin. A clang bootstrap on darwin
with LTO fails with or without this patch because, ironically,
the linker doesn't like the combination of dead_strip and LTO
when building libLTO.so :-)

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

13 years agoHoist spills when the same value is known to be in less loopy sibling registers.
Jakob Stoklund Olesen [Fri, 18 Mar 2011 04:23:06 +0000 (04:23 +0000)]
Hoist spills when the same value is known to be in less loopy sibling registers.

Stack slot real estate is virtually free compared to registers, so it is
advantageous to spill earlier even though the same value is now kept in both a
register and a stack slot.

Also eliminate redundant spills by extending the stack slot live range
underneath reloaded registers.

This can trigger a dead code elimination, removing copies and even reloads that
were only feeding spills.

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

13 years agoSome release notes.
Rafael Espindola [Fri, 18 Mar 2011 04:07:44 +0000 (04:07 +0000)]
Some release notes.

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

13 years agoTweak CrashRecoveryContextCleanup::createCleanup() to use the 'delete' cleanup as...
Ted Kremenek [Fri, 18 Mar 2011 03:46:21 +0000 (03:46 +0000)]
Tweak CrashRecoveryContextCleanup::createCleanup() to use the 'delete' cleanup as opposed to the 'destructor' cleanup (reclaims more memory).

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

13 years agotools/lto/LTOModule.cpp: Eliminate an unused variable.
NAKAMURA Takumi [Fri, 18 Mar 2011 03:21:11 +0000 (03:21 +0000)]
tools/lto/LTOModule.cpp: Eliminate an unused variable.

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

13 years agollvm-bcanalyzer.cpp: Tweak format string to suppress warnings on mingw32-g++.
NAKAMURA Takumi [Fri, 18 Mar 2011 03:21:04 +0000 (03:21 +0000)]
llvm-bcanalyzer.cpp: Tweak format string to suppress warnings on mingw32-g++.

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

13 years agoAccept instructions that read undefined values.
Jakob Stoklund Olesen [Fri, 18 Mar 2011 03:06:04 +0000 (03:06 +0000)]
Accept instructions that read undefined values.

This is not supposed to happen, but I have seen the x86 rematter getting
confused when rematerializing partial redefs.

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

13 years agoBe more accurate about the slot index reading a register when dealing with defs
Jakob Stoklund Olesen [Fri, 18 Mar 2011 03:06:02 +0000 (03:06 +0000)]
Be more accurate about the slot index reading a register when dealing with defs
and early clobbers.

Assert when trying to find an undefined value.

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

13 years agoAdd new CrashRecoveryContextCleanup subclass: CrashRecoveryContextDeleteCleanup....
Ted Kremenek [Fri, 18 Mar 2011 03:04:18 +0000 (03:04 +0000)]
Add new CrashRecoveryContextCleanup subclass: CrashRecoveryContextDeleteCleanup.  This deletes the object, not just calls its destructor.

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

13 years agoCheck RequiresNullTerminator first, or we might read from an invalid address.
Rafael Espindola [Fri, 18 Mar 2011 02:55:51 +0000 (02:55 +0000)]
Check RequiresNullTerminator first, or we might read from an invalid address.

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

13 years agoAdd a target-specific branchless method for double-width relational
Eli Friedman [Fri, 18 Mar 2011 02:34:11 +0000 (02:34 +0000)]
Add a target-specific branchless method for double-width relational
comparisons on x86.  Essentially, the way this works is that SUB+SBB sets
the relevant flags the same way a double-width CMP would.

This is a substantial improvement over the generic lowering in LLVM. The output
is also shorter than the gcc-generated output; I haven't done any detailed
benchmarking, though.

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

13 years agoAugment CrashRecoveryContext to have registered "cleanup" objects that can be used...
Ted Kremenek [Fri, 18 Mar 2011 02:05:11 +0000 (02:05 +0000)]
Augment CrashRecoveryContext to have registered "cleanup" objects that can be used to release resources during a crash.

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

13 years agoAdd some svn:ignore properties.
Eli Friedman [Fri, 18 Mar 2011 01:24:16 +0000 (01:24 +0000)]
Add some svn:ignore properties.

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

13 years agoFileCheck-ize and update test.
Eli Friedman [Fri, 18 Mar 2011 01:10:31 +0000 (01:10 +0000)]
FileCheck-ize and update test.

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

13 years agoThe disassembler for Thumb was wrongly adding 4 to the computed imm32 offset.
Johnny Chen [Fri, 18 Mar 2011 00:38:03 +0000 (00:38 +0000)]
The disassembler for Thumb was wrongly adding 4 to the computed imm32 offset.
Remove the offending logic and update the test cases.

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

13 years agoRemove TargetData and ValueTracking includes. I didn't mean for them to sneak in...
Andrew Trick [Fri, 18 Mar 2011 00:36:39 +0000 (00:36 +0000)]
Remove TargetData and ValueTracking includes. I didn't mean for them to sneak in my last checkin.

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

13 years agoThere are two pseudos in this case that are Thumb mode, not one.
Owen Anderson [Thu, 17 Mar 2011 23:52:05 +0000 (23:52 +0000)]
There are two pseudos in this case that are Thumb mode, not one.

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