oota-llvm.git
15 years agoRevert r75610 (and r75620, which was blocking the revert), in the hopes of
Daniel Dunbar [Tue, 14 Jul 2009 15:57:55 +0000 (15:57 +0000)]
Revert r75610 (and r75620, which was blocking the revert), in the hopes of
unbreaking llvm-gcc (on Darwin).

--- Reverse-merging r75620 into '.':
U    include/llvm/Support/Mangler.h
--- Reverse-merging r75610 into '.':
U    test/CodeGen/X86/loop-hoist.ll
G    include/llvm/Support/Mangler.h
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
U    lib/VMCore/Mangler.cpp

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

15 years agoMake SCEVCallbackVH::allUsesReplacedWith more thorough in removing
Dan Gohman [Tue, 14 Jul 2009 14:34:04 +0000 (14:34 +0000)]
Make SCEVCallbackVH::allUsesReplacedWith more thorough in removing
users from the Scalars map.

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

15 years agoRequire IVUsers after LCSSA, since LCSSA does not preserve IVUsers.
Dan Gohman [Tue, 14 Jul 2009 14:26:23 +0000 (14:26 +0000)]
Require IVUsers after LCSSA, since LCSSA does not preserve IVUsers.
This results in the pass manager running IVUsers only once for
indvars, instead of twice.

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

15 years agoAdd a comment about why ScalarEvolution doesn't recognize non-loop PHIs
Dan Gohman [Tue, 14 Jul 2009 14:06:25 +0000 (14:06 +0000)]
Add a comment about why ScalarEvolution doesn't recognize non-loop PHIs
even when they're obvious.

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

15 years agoAfter converting assert(0) to LLVM_UNREACHABLE we lost file/line location.
Torok Edwin [Tue, 14 Jul 2009 12:49:22 +0000 (12:49 +0000)]
After converting assert(0) to LLVM_UNREACHABLE we lost file/line location.
Fix by making the LLVM_UNREACHABLE pass __FILE__ and __LINE__ to
llvm_unreachable.

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

15 years agoeliminate extra space.
Torok Edwin [Tue, 14 Jul 2009 12:22:58 +0000 (12:22 +0000)]
eliminate extra space.

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

15 years agoAdd extra sign extension to the same bit width before int sign
Anton Korobeynikov [Tue, 14 Jul 2009 09:53:14 +0000 (09:53 +0000)]
Add extra sign extension to the same bit width before int sign
extension to another bit width. This is needed to get correct singed value.
Patch by Artur Pietrek!

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

15 years agoAdd missing break. Patch by Artur Pietrek!
Anton Korobeynikov [Tue, 14 Jul 2009 09:52:47 +0000 (09:52 +0000)]
Add missing break. Patch by Artur Pietrek!

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

15 years agoMove main llvm-prof functionality into a ModulePass.
Daniel Dunbar [Tue, 14 Jul 2009 07:41:11 +0000 (07:41 +0000)]
Move main llvm-prof functionality into a ModulePass.
 - To support using the ProfileInfo analysis results instead of accessing the
   ProfileInfoLoader directly.

 - Based on (part of) a patch by Andreas Neustifter.

 - No functionality change.

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

15 years agoProfileInfo interface tweaks.
Daniel Dunbar [Tue, 14 Jul 2009 06:58:59 +0000 (06:58 +0000)]
ProfileInfo interface tweaks.
 - Add getExecutionCount(const Function).

 - Add helper Edge type.

 - constify.

 - No functionality change.

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

15 years agoUse http instead https for anonymous readonly check out.
Evan Cheng [Tue, 14 Jul 2009 06:23:41 +0000 (06:23 +0000)]
Use http instead https for anonymous readonly check out.

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

15 years agoremove renamed method.
Chris Lattner [Tue, 14 Jul 2009 06:22:15 +0000 (06:22 +0000)]
remove renamed method.

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

15 years agorename getValueName -> getMangledName. These two files have very
Chris Lattner [Tue, 14 Jul 2009 06:21:12 +0000 (06:21 +0000)]
rename getValueName -> getMangledName.  These two files have very
dubious looking things that I need to investigate in more detail.

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

15 years agoRename getValueName -> getMangledName
Chris Lattner [Tue, 14 Jul 2009 06:20:20 +0000 (06:20 +0000)]
Rename getValueName -> getMangledName

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

15 years agorename getValueName -> getMangledName
Chris Lattner [Tue, 14 Jul 2009 06:19:21 +0000 (06:19 +0000)]
rename getValueName -> getMangledName

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

15 years agorename getValueName -> getMangledName
Chris Lattner [Tue, 14 Jul 2009 06:19:07 +0000 (06:19 +0000)]
rename getValueName -> getMangledName

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

15 years agoRename getValueName -> getMangledName.
Chris Lattner [Tue, 14 Jul 2009 06:18:50 +0000 (06:18 +0000)]
Rename getValueName -> getMangledName.

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

15 years agoRemove some tabs and fix other whitespace. No functional changes.
Bob Wilson [Tue, 14 Jul 2009 06:11:12 +0000 (06:11 +0000)]
Remove some tabs and fix other whitespace.  No functional changes.

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

15 years agoFix a comment.
Bob Wilson [Tue, 14 Jul 2009 06:09:50 +0000 (06:09 +0000)]
Fix a comment.

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

15 years agoFix an obvious error.
Bob Wilson [Tue, 14 Jul 2009 06:06:28 +0000 (06:06 +0000)]
Fix an obvious error.

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

15 years agoChange the X86 asmprinter to use the mangler to apply suffixes like "$non_lazy_ptr"
Chris Lattner [Tue, 14 Jul 2009 06:04:35 +0000 (06:04 +0000)]
Change the X86 asmprinter to use the mangler to apply suffixes like "$non_lazy_ptr"
to symbols instead of doing it with "printSuffixedName".  This gets us to the point
where there is a real separation between computing a symbol name and printing it,
something I need for MC printer stuff.

This patch also fixes a corner case bug where unnamed private globals wouldn't get
the private label prefix.

Next up, rename all uses of getValueName -> getMangledName for better greppability,
and then tackle the ppc/arm backends to eliminate "printSuffixedName".

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

15 years agoNew VNInfo alignment patch by Ryan Flynn.
Lang Hames [Tue, 14 Jul 2009 05:46:55 +0000 (05:46 +0000)]
New VNInfo alignment patch by Ryan Flynn.

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

15 years agoChange the internal interface to makeNameProper to take a bool that
Chris Lattner [Tue, 14 Jul 2009 04:50:12 +0000 (04:50 +0000)]
Change the internal interface to makeNameProper to take a bool that
indicates whether the label is private or not, instead of taking
prefix stuff.  One effect of this is that symbols will be generated
with *just* the private prefix, instead of both the private prefix
*and* the user-label-prefix, but this doesn't matter as long as it
is consistent.  For example we'll now get "Lfoo" instead of "L_foo".
These are just assembler temporary labels anyway, so they never even
make it into the .o file.

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

15 years agoUnbroke LiveInterval.
Lang Hames [Tue, 14 Jul 2009 02:17:17 +0000 (02:17 +0000)]
Unbroke LiveInterval.

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

15 years agoTidy up VNInfo alignment code. Patch contributed by Ryan Flynn.
Lang Hames [Tue, 14 Jul 2009 02:05:37 +0000 (02:05 +0000)]
Tidy up VNInfo alignment code. Patch contributed by Ryan Flynn.

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

15 years agoFix trivial todo in instcombine.
Eli Friedman [Tue, 14 Jul 2009 02:01:53 +0000 (02:01 +0000)]
Fix trivial todo in instcombine.

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

15 years ago1. In Thumb mode, select tBx instead of ARM variants.
Evan Cheng [Tue, 14 Jul 2009 01:49:27 +0000 (01:49 +0000)]
1. In Thumb mode, select tBx instead of ARM variants.
2. BX does not "use" the link register, it defines it.
3. Fix a couple more places in thumb td file that still uses pre-UAL syntax.

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

15 years agoUpdate LoopSimplify and LoopUnswitch to use the new makeLoopInvariant
Dan Gohman [Tue, 14 Jul 2009 01:37:59 +0000 (01:37 +0000)]
Update LoopSimplify and LoopUnswitch to use the new makeLoopInvariant
function.

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

15 years agoPort this unittest to use LLVMContext.
Dan Gohman [Tue, 14 Jul 2009 01:26:26 +0000 (01:26 +0000)]
Port this unittest to use LLVMContext.

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

15 years agoRemove hack now that Evan fixed it so that the frame pointer isn't saved twice.
Bill Wendling [Tue, 14 Jul 2009 01:16:18 +0000 (01:16 +0000)]
Remove hack now that Evan fixed it so that the frame pointer isn't saved twice.

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

15 years agoFix indvars to not assume that a loop with a single unique exit
Dan Gohman [Tue, 14 Jul 2009 01:09:02 +0000 (01:09 +0000)]
Fix indvars to not assume that a loop with a single unique exit
block has a single unique exiting block.

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

15 years agoIntroduce a new LoopInfo utility function makeLoopInvariant, which
Dan Gohman [Tue, 14 Jul 2009 01:06:29 +0000 (01:06 +0000)]
Introduce a new LoopInfo utility function makeLoopInvariant, which
works similar to isLoopInvariant, except that it will do trivial
hoisting to try to make the value loop invariant if it isn't already.
This makes it easier for transformation passes to clear trivial
instructions out of the way (the regular LICM pass doesn't run
until relatively late). This is code factored out of LoopSimplify
and other places.

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

15 years agouse getValueName instead of makeNameProper.
Chris Lattner [Tue, 14 Jul 2009 01:01:12 +0000 (01:01 +0000)]
use getValueName instead of makeNameProper.

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

15 years agoFix detection of valid BFC immediates.
David Goodwin [Tue, 14 Jul 2009 00:57:56 +0000 (00:57 +0000)]
Fix detection of valid BFC immediates.

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

15 years agoDo not use Mangler to remove '1' from linkage name.
Devang Patel [Tue, 14 Jul 2009 00:55:28 +0000 (00:55 +0000)]
Do not use Mangler to remove '1' from linkage name.

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

15 years agoCheck for the correct unnamed name.
Bill Wendling [Tue, 14 Jul 2009 00:53:58 +0000 (00:53 +0000)]
Check for the correct unnamed name.

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

15 years agoFix pr4544. When remating, make sure the destination register fits the instruction...
Evan Cheng [Tue, 14 Jul 2009 00:51:06 +0000 (00:51 +0000)]
Fix pr4544. When remating, make sure the destination register fits the instruction definition. It may be mismatched due to sub-register coalescing.
No test case yet because the code doesn't trigger until 75408 is re-applied.

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

15 years agoDon't delete asm's just because their inputs are undefined;
Dale Johannesen [Tue, 14 Jul 2009 00:45:38 +0000 (00:45 +0000)]
Don't delete asm's just because their inputs are undefined;
xor R, R is a common and valid idiom for zeroing a register, for example.

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

15 years agoAdd a newline, now that Value's operator<< doesn't print one.
Dan Gohman [Tue, 14 Jul 2009 00:32:49 +0000 (00:32 +0000)]
Add a newline, now that Value's operator<< doesn't print one.

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

15 years agoFreeInst is trapping.
Dan Gohman [Tue, 14 Jul 2009 00:32:11 +0000 (00:32 +0000)]
FreeInst is trapping.

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

15 years agoFix an obvious copy-and-paste error.
Bob Wilson [Tue, 14 Jul 2009 00:23:44 +0000 (00:23 +0000)]
Fix an obvious copy-and-paste error.

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

15 years agoRevert 75308.
Bob Wilson [Tue, 14 Jul 2009 00:16:03 +0000 (00:16 +0000)]
Revert 75308.

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

15 years agothe mangler can never mangle intrinsics, don't allow this.
Chris Lattner [Tue, 14 Jul 2009 00:15:14 +0000 (00:15 +0000)]
the mangler can never mangle intrinsics, don't allow this.

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

15 years agoFix obvious typo.
Eli Friedman [Tue, 14 Jul 2009 00:09:42 +0000 (00:09 +0000)]
Fix obvious typo.

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

15 years agoRevert 75309.
Bob Wilson [Tue, 14 Jul 2009 00:01:42 +0000 (00:01 +0000)]
Revert 75309.

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

15 years agorename Memo/Count to AnonGlobalIDs/NextAnonGlobalID to be more
Chris Lattner [Tue, 14 Jul 2009 00:01:06 +0000 (00:01 +0000)]
rename Memo/Count to AnonGlobalIDs/NextAnonGlobalID to be more
descriptive.  Thange them to keep track of the ID of a global that is
assigned, not the first mangled name returned for it.  Without doing this,
we are required to always use the same suffix for a global that gets
mangled.  This means that we can mangle the same global once with $stub
and another time with $non_lazy_ptr or whatever.

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

15 years agoMove more functionality over to LLVMContext.
Owen Anderson [Mon, 13 Jul 2009 23:50:59 +0000 (23:50 +0000)]
Move more functionality over to LLVMContext.

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

15 years agoremove Mangler::getTypeID and related data, it was only used for mangling
Chris Lattner [Mon, 13 Jul 2009 23:50:53 +0000 (23:50 +0000)]
remove Mangler::getTypeID and related data, it was only used for mangling
local symbols and we haven't had type planes since llvm 1.9.

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

15 years agoremove mangler support for mangling local names. Mangler should only be
Chris Lattner [Mon, 13 Jul 2009 23:47:27 +0000 (23:47 +0000)]
remove mangler support for mangling local names.  Mangler should only be
used with globals.

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

15 years agofix CBE & MSIL backends to not use the mangler for non-global symbols.
Chris Lattner [Mon, 13 Jul 2009 23:46:46 +0000 (23:46 +0000)]
fix CBE & MSIL backends to not use the mangler for non-global symbols.

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

15 years agodon't print redundant @PLT suffixes
Chris Lattner [Mon, 13 Jul 2009 23:44:13 +0000 (23:44 +0000)]
don't print redundant @PLT suffixes

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

15 years agoRevert an accidental commit.
Evan Cheng [Mon, 13 Jul 2009 23:44:01 +0000 (23:44 +0000)]
Revert an accidental commit.

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

15 years agothe mangler should put suffixes on unnamed global's mangled names as well
Chris Lattner [Mon, 13 Jul 2009 23:20:38 +0000 (23:20 +0000)]
the mangler should put suffixes on unnamed global's mangled names as well
if present.

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

15 years agoMove a bit more functionality to LLVMContext, which apparently wasn't being used...
Owen Anderson [Mon, 13 Jul 2009 23:16:26 +0000 (23:16 +0000)]
Move a bit more functionality to LLVMContext, which apparently wasn't being used anyways.

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

15 years agoAdded llvm-mc support for parsing the .abort directive.
Kevin Enderby [Mon, 13 Jul 2009 23:15:14 +0000 (23:15 +0000)]
Added llvm-mc support for parsing the .abort directive.

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

15 years agoCheck in a reduced version of this testcase.
Dan Gohman [Mon, 13 Jul 2009 23:04:44 +0000 (23:04 +0000)]
Check in a reduced version of this testcase.

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

15 years agoPrint a newline after printing a Value, now that Value's operator<<
Dan Gohman [Mon, 13 Jul 2009 23:03:05 +0000 (23:03 +0000)]
Print a newline after printing a Value, now that Value's operator<<
doesn't print a newline.

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

15 years ago#include "llvm/Assembly/Writer.h" to get the declaration for WriteAsOperand.
Dan Gohman [Mon, 13 Jul 2009 22:56:37 +0000 (22:56 +0000)]
#include "llvm/Assembly/Writer.h" to get the declaration for WriteAsOperand.

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

15 years agoTwo changes:
Chris Lattner [Mon, 13 Jul 2009 22:48:46 +0000 (22:48 +0000)]
Two changes:
1) unique globals with the existing "Count" local in Mangler, not with
atomic nonsense.  Using atomics will give us nondeterminstic output
from the compiler when using multiple threads, which is bad.

2) Do not mangle an unknown global name with a type suffix.  We don't
   need this anymore now that llvm ir doesn't have type planes.

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

15 years agoUse assertion.
Devang Patel [Mon, 13 Jul 2009 22:46:19 +0000 (22:46 +0000)]
Use assertion.

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

15 years agoPR4548: optimize zext+udiv+trunc to udiv.
Eli Friedman [Mon, 13 Jul 2009 22:46:01 +0000 (22:46 +0000)]
PR4548: optimize zext+udiv+trunc to udiv.

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

15 years agoInline EvalVectorOp in order to get rid of passing-pointer-to-static-methods behavior.
Owen Anderson [Mon, 13 Jul 2009 22:41:06 +0000 (22:41 +0000)]
Inline EvalVectorOp in order to get rid of passing-pointer-to-static-methods behavior.

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

15 years agoCleanup the global emission and refactor some code
Bruno Cardoso Lopes [Mon, 13 Jul 2009 22:40:39 +0000 (22:40 +0000)]
Cleanup the global emission and refactor some code

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

15 years agoFix the build.
Owen Anderson [Mon, 13 Jul 2009 22:40:32 +0000 (22:40 +0000)]
Fix the build.

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

15 years agoNewNightlyTest.pl - Add -configure-args option.
Daniel Dunbar [Mon, 13 Jul 2009 22:31:58 +0000 (22:31 +0000)]
NewNightlyTest.pl - Add -configure-args option.
 - For adding arbitrary arguments to pass to configure.

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

15 years agoFix bug in run-line.
Eli Friedman [Mon, 13 Jul 2009 22:31:30 +0000 (22:31 +0000)]
Fix bug in run-line.

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

15 years agoAdd testcases for PR4538, PR4537, and PR4534.
Dan Gohman [Mon, 13 Jul 2009 22:30:31 +0000 (22:30 +0000)]
Add testcases for PR4538, PR4537, and PR4534.

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

15 years agoclean up some syntax.
Chris Lattner [Mon, 13 Jul 2009 22:28:21 +0000 (22:28 +0000)]
clean up some syntax.

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

15 years agoCanonicalize boolean +/- a constant to a select.
Eli Friedman [Mon, 13 Jul 2009 22:27:52 +0000 (22:27 +0000)]
Canonicalize boolean +/- a constant to a select.

(I think it's reasonably clear that we want to have a canonical form for
constructs like this; if anyone thinks that a select is not the best
canonical form, please tell me.)

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

15 years agoFix a few assertion strings.
Dan Gohman [Mon, 13 Jul 2009 22:20:53 +0000 (22:20 +0000)]
Fix a few assertion strings.

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

15 years agoForward-declare Loop and LoopInfo instead of #including LoopInfo.h.
Dan Gohman [Mon, 13 Jul 2009 22:19:41 +0000 (22:19 +0000)]
Forward-declare Loop and LoopInfo instead of #including LoopInfo.h.

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

15 years agoThese don't really need contexts either.
Owen Anderson [Mon, 13 Jul 2009 22:18:28 +0000 (22:18 +0000)]
These don't really need contexts either.

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

15 years agoNewNightlyTest.pl - Add -noremoveatend option.
Daniel Dunbar [Mon, 13 Jul 2009 22:17:49 +0000 (22:17 +0000)]
NewNightlyTest.pl - Add -noremoveatend option.
 - Like -noremove, except the build directory is still purged prior to building
   but isn't removed at the end of the test run (so the build products can be
   examined if need be).

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

15 years agoeliminate a bunch of code in print_pcrel_imm for printing symbols, using
Chris Lattner [Mon, 13 Jul 2009 22:07:30 +0000 (22:07 +0000)]
eliminate a bunch of code in print_pcrel_imm for printing symbols, using
printSymbolOperand instead.

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

15 years agoWhitespace cleanups.
Dan Gohman [Mon, 13 Jul 2009 22:05:32 +0000 (22:05 +0000)]
Whitespace cleanups.

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

15 years agoFix an 80-column violation.
Dan Gohman [Mon, 13 Jul 2009 22:04:06 +0000 (22:04 +0000)]
Fix an 80-column violation.

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

15 years agoMove isLCSSAForm, isLoopInvariant, getCanonicalInductionVariable,
Dan Gohman [Mon, 13 Jul 2009 22:02:44 +0000 (22:02 +0000)]
Move isLCSSAForm, isLoopInvariant, getCanonicalInductionVariable,
and related functions out of LoopBase and into Loop, since they
are specific to BasicBlock-based loops. This also allows the code
to be moved out-of-line.

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

15 years agoCMake: Refuses to work for out-of-source builds when tablegenned files
Oscar Fuentes [Mon, 13 Jul 2009 21:58:44 +0000 (21:58 +0000)]
CMake: Refuses to work for out-of-source builds when tablegenned files
are found mixed with the sources. Fixes PR 4522.

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

15 years agomove a method and add a comment, no functionality change.
Chris Lattner [Mon, 13 Jul 2009 21:53:19 +0000 (21:53 +0000)]
move a method and add a comment, no functionality change.

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

15 years agoMake Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,
Dan Gohman [Mon, 13 Jul 2009 21:51:15 +0000 (21:51 +0000)]
Make Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,
using the Curiously Recurring Template Pattern with LoopBase.

This will help further refactoring, and future functionality for
Loop. Also, Headers can now foward-declare Loop, instead of pulling
in LoopInfo.h or doing tricks.

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

15 years agorefactor operand printing to remove hte last of the "mem" modifier hack. The
Chris Lattner [Mon, 13 Jul 2009 21:48:33 +0000 (21:48 +0000)]
refactor operand printing to remove hte last of the "mem" modifier hack.  The
only remaining modifier is "subreg".

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

15 years agoUse AsmPrinter's Mangler to remove leading '1' from linkage names.
Devang Patel [Mon, 13 Jul 2009 21:48:26 +0000 (21:48 +0000)]
Use AsmPrinter's Mangler to remove leading '1' from linkage names.

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

15 years agoMisc simplifications to InstCombiner::commonIntCastTransforms. Most of
Eli Friedman [Mon, 13 Jul 2009 21:45:57 +0000 (21:45 +0000)]
Misc simplifications to InstCombiner::commonIntCastTransforms.  Most of
the changes are allowed by not calling this function for bitcasts.
The Instruction::AShr case is dead because
SimplifyDemandedInstructionBits handles that case.

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

15 years agoFix FP elimination code to work for Thumb-2 addrmode AddrModeT2_so. This fixes Single...
David Goodwin [Mon, 13 Jul 2009 21:43:08 +0000 (21:43 +0000)]
Fix FP elimination code to work for Thumb-2 addrmode AddrModeT2_so. This fixes SingleSource/Benchmarks/Stanford/Queens (among others).

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

15 years agorefactor symbol printing so the whole "mem" thing is handled in fewer places.
Chris Lattner [Mon, 13 Jul 2009 21:41:08 +0000 (21:41 +0000)]
refactor symbol printing so the whole "mem" thing is handled in fewer places.

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

15 years agoReapply 75252, with a fix to avoid the infinite recursion case. The
Dan Gohman [Mon, 13 Jul 2009 21:35:55 +0000 (21:35 +0000)]
Reapply 75252, with a fix to avoid the infinite recursion case. The
check for avoiding re-analyzing a widening cast needed to happen
earlier, as getSCEV itself may result in a isLoopGuardedByCond query.

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

15 years agoCMake: tablegen: Add .td files under the inlude/llvm directory
Oscar Fuentes [Mon, 13 Jul 2009 21:35:00 +0000 (21:35 +0000)]
CMake: tablegen: Add .td files under the inlude/llvm directory
hierarchy to the list of dependencies.

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

15 years agoAs Chris pointed out, this doesn't actually need an LLVMContext to operate.
Owen Anderson [Mon, 13 Jul 2009 21:27:19 +0000 (21:27 +0000)]
As Chris pointed out, this doesn't actually need an LLVMContext to operate.

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

15 years agorevert rev. 75503 for now.
Devang Patel [Mon, 13 Jul 2009 21:26:33 +0000 (21:26 +0000)]
revert rev. 75503 for now.

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

15 years agoUse Mangler to remove leading '1' from linkage names.
Devang Patel [Mon, 13 Jul 2009 21:19:56 +0000 (21:19 +0000)]
Use Mangler to remove leading '1' from linkage names.

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

15 years agoadd llvm-mc support for parsing the .subsections_via_symbols directive.
Kevin Enderby [Mon, 13 Jul 2009 21:03:15 +0000 (21:03 +0000)]
add llvm-mc support for parsing the .subsections_via_symbols directive.

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

15 years agoFix comment.
Eli Friedman [Mon, 13 Jul 2009 20:58:59 +0000 (20:58 +0000)]
Fix comment.

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

15 years agoMove more functionality over to LLVMContext.
Owen Anderson [Mon, 13 Jul 2009 20:58:05 +0000 (20:58 +0000)]
Move more functionality over to LLVMContext.

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

15 years agoMove the memoization check for SCEVSignExtendExpr and
Dan Gohman [Mon, 13 Jul 2009 20:55:53 +0000 (20:55 +0000)]
Move the memoization check for SCEVSignExtendExpr and
SCEVZeroExtendExpr ahead of the most expensive analysis. This
speeds up analysis and helps avoid pathologically bad behavior
on the testcase in PR4534.

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

15 years agoDon't bother to call commonIntCastTransforms for bitcasts; int->int
Eli Friedman [Mon, 13 Jul 2009 20:53:00 +0000 (20:53 +0000)]
Don't bother to call commonIntCastTransforms for bitcasts; int->int
bitcasts will always be eliminated anyway.

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

15 years agoConvert SCEV from FoldingSetNode to FastFoldingSetNode. This eliminates
Dan Gohman [Mon, 13 Jul 2009 20:50:19 +0000 (20:50 +0000)]
Convert SCEV from FoldingSetNode to FastFoldingSetNode. This eliminates
a bunch of redundent code in Profile methods, and prepares for upcoming
changes to do improved memoization.

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

15 years agoDelete a spurious const.
Dan Gohman [Mon, 13 Jul 2009 20:46:11 +0000 (20:46 +0000)]
Delete a spurious const.

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

15 years agoReverted r75484. It was causing a failure with Apple-style builds.
Bill Wendling [Mon, 13 Jul 2009 20:27:41 +0000 (20:27 +0000)]
Reverted r75484. It was causing a failure with Apple-style builds.

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

15 years agoAdd infrastructure to allow post instruction printing action triggers.
David Greene [Mon, 13 Jul 2009 20:25:48 +0000 (20:25 +0000)]
Add infrastructure to allow post instruction printing action triggers.
We'll eventually use this to print comments in asm files and do other
fun things.

This adds interfaces to the AsmPrinter and changes TableGen to invoke
the postInstructionAction when appropriate.  It also add parameters to
TargetAsmInfo to control comment layout.

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

15 years agoAdd NetBSD to the Triple class, patch by Krister Walfridsson!
Chris Lattner [Mon, 13 Jul 2009 20:22:23 +0000 (20:22 +0000)]
Add NetBSD to the Triple class, patch by Krister Walfridsson!

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