oota-llvm.git
15 years agoUse t2LDRi12 and t2STRi12 to load / store to / from stack frames. Eliminate more...
Evan Cheng [Mon, 27 Jul 2009 03:14:20 +0000 (03:14 +0000)]
Use t2LDRi12 and t2STRi12 to load / store to / from stack frames. Eliminate more getOpcode calls.

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

15 years agoGenerate a libcall for i8 multiply.
Sanjiv Gupta [Mon, 27 Jul 2009 02:44:46 +0000 (02:44 +0000)]
Generate a libcall for i8 multiply.

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

15 years agofixed incorrect lowering of ISD::SUB node. SUB has only one result value.
Sanjiv Gupta [Mon, 27 Jul 2009 02:26:06 +0000 (02:26 +0000)]
fixed incorrect lowering of ISD::SUB node. SUB has only one result value.
It wasn't caught during tests because we never got a sub generated, (i8 was always getting promoted to int, which in turn was broken into subc/sube). Though the optimizer leaves an i8 sub now.

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

15 years agoUse the right instructions to copy between GPR and the more strictive tGPR classes...
Evan Cheng [Mon, 27 Jul 2009 00:33:08 +0000 (00:33 +0000)]
Use the right instructions to copy between GPR and the more strictive tGPR classes. t2MOV does not match the RC requirements.

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

15 years agoMerge isLoadFromStackSlot into one since it behaves the same regardless of sub-target.
Evan Cheng [Mon, 27 Jul 2009 00:24:36 +0000 (00:24 +0000)]
Merge isLoadFromStackSlot into one since it behaves the same regardless of sub-target.

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

15 years agoJust use a single isMoveInstr to catch all the cases.
Evan Cheng [Mon, 27 Jul 2009 00:05:15 +0000 (00:05 +0000)]
Just use a single isMoveInstr to catch all the cases.

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

15 years agoRename tMOVhi2lor to tMOVgpr2tgpr. It's not moving from a high register to a low...
Evan Cheng [Sun, 26 Jul 2009 23:59:01 +0000 (23:59 +0000)]
Rename tMOVhi2lor to tMOVgpr2tgpr. It's not moving from a high register to a low register. It's moving from a GPR register class to a more restrictive tGPR class. Also change tMOVlor2hir, and tMOVhir2hir.

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

15 years agoReorganize code a bit to reduce indentation. No visible functionality
Eli Friedman [Sun, 26 Jul 2009 23:47:17 +0000 (23:47 +0000)]
Reorganize code a bit to reduce indentation.  No visible functionality
change.

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

15 years agoFix libLTO:
Nick Lewycky [Sun, 26 Jul 2009 22:16:39 +0000 (22:16 +0000)]
Fix libLTO:
 * Call InitializeAllTargets on every path where we might query the
   TargetRegistry. This fixes PR4604.
 * flush the formatted_raw_ostream& or else not all of the assembly will make
   it to the .s file. (It doesn't do this in its destructor?!)
 * Due to a reversed conditional, libLTO was reporting many symbols as both
   defined and undefined, including two definitions of the same symbol name
   in its symbol list.

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

15 years agoDon't use llvm_report_error in libSystem, this is a layering violation.
Daniel Dunbar [Sun, 26 Jul 2009 21:16:42 +0000 (21:16 +0000)]
Don't use llvm_report_error in libSystem, this is a layering violation.

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

15 years agountangle a TargetAsmInfo hack where ELFTargetAsmInfo would create a
Chris Lattner [Sun, 26 Jul 2009 19:23:28 +0000 (19:23 +0000)]
untangle a TargetAsmInfo hack where ELFTargetAsmInfo would create a
'unnamed' bss section, but some impls would want a named one.  Since
they don't have consistent behavior, just make each target do their
own thing, instead of doing something "sortof common" then having
targets change immutable objects later.

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

15 years agoRefactor. Get rid of a few more getOpcode() calls.
Evan Cheng [Sun, 26 Jul 2009 18:55:14 +0000 (18:55 +0000)]
Refactor. Get rid of a few more getOpcode() calls.

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

15 years agoreduce indentation
Chris Lattner [Sun, 26 Jul 2009 18:08:15 +0000 (18:08 +0000)]
reduce indentation

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

15 years agoUse the RHS length instead of the LHS length. They are both the same,
Chris Lattner [Sun, 26 Jul 2009 17:46:03 +0000 (17:46 +0000)]
Use the RHS length instead of the LHS length.  They are both the same,
but this ends up compiling code like this:

int foo(const StringRef &R) {
  return R == "food";
}

to use a constant sized memcmp instead of a variable memcmp.

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

15 years agoFix the breakage caused by 76950.
Sanjiv Gupta [Sun, 26 Jul 2009 10:25:01 +0000 (10:25 +0000)]
Fix the breakage caused by 76950.
PIC16 has special naming conventions for variables having section names specified via section attribute.

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

15 years agoRemove Value::getName{Start,End}, the last of the old Name APIs.
Daniel Dunbar [Sun, 26 Jul 2009 09:48:23 +0000 (09:48 +0000)]
Remove Value::getName{Start,End}, the last of the old Name APIs.

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

15 years agoMake sure getName().data() is always null terminated.
Daniel Dunbar [Sun, 26 Jul 2009 09:22:02 +0000 (09:22 +0000)]
Make sure getName().data() is always null terminated.

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

15 years agoRemove Value::getNameLen
Daniel Dunbar [Sun, 26 Jul 2009 08:34:35 +0000 (08:34 +0000)]
Remove Value::getNameLen

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

15 years agoMove MSILModule and MSILWriter into the 'llvm' namespace, instead of the 'MSIL'
Nick Lewycky [Sun, 26 Jul 2009 08:16:51 +0000 (08:16 +0000)]
Move MSILModule and MSILWriter into the 'llvm' namespace, instead of the 'MSIL'
namespace which could very well conflict with non-LLVM code.

Also clean up some spacing, remove an extra header.

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

15 years agoEliminate some uses of DOUT, cerr, and getNameStart().
Daniel Dunbar [Sun, 26 Jul 2009 07:49:05 +0000 (07:49 +0000)]
Eliminate some uses of DOUT, cerr, and getNameStart().

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

15 years agoremove a densemap from TargetAsmInfo that was uniquing the targetflags strings,
Chris Lattner [Sun, 26 Jul 2009 07:33:58 +0000 (07:33 +0000)]
remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,
just use a smallstring instead.

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

15 years agosimplify SectionFlagsForGlobal, even though I want to kill it.
Chris Lattner [Sun, 26 Jul 2009 07:17:39 +0000 (07:17 +0000)]
simplify SectionFlagsForGlobal, even though I want to kill it.

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

15 years agomake SectionKind keep track of whether a global had an explicit
Chris Lattner [Sun, 26 Jul 2009 07:14:28 +0000 (07:14 +0000)]
make SectionKind keep track of whether a global had an explicit
section specified for it or not.

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

15 years agosimplify this code now that SectionKind knows if a global is weak or not.
Chris Lattner [Sun, 26 Jul 2009 07:07:01 +0000 (07:07 +0000)]
simplify this code now that SectionKind knows if a global is weak or not.

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

15 years agomake SectionKind know whether a symbol is weak or not in addition
Chris Lattner [Sun, 26 Jul 2009 07:00:12 +0000 (07:00 +0000)]
make SectionKind know whether a symbol is weak or not in addition
to its classification.

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

15 years agoMake the kind actually be private.
Chris Lattner [Sun, 26 Jul 2009 06:51:27 +0000 (06:51 +0000)]
Make the kind actually be private.

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

15 years agorename Mergable -> Mergeable and Writable -> Writeable
Chris Lattner [Sun, 26 Jul 2009 06:48:26 +0000 (06:48 +0000)]
rename Mergable -> Mergeable and Writable -> Writeable

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

15 years agotwo files I missed in the last commit.
Chris Lattner [Sun, 26 Jul 2009 06:36:20 +0000 (06:36 +0000)]
two files I missed in the last commit.

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

15 years agoremove a bunch of helper functions, just use SectionKind::get instead.
Chris Lattner [Sun, 26 Jul 2009 06:34:33 +0000 (06:34 +0000)]
remove a bunch of helper functions, just use SectionKind::get instead.

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

15 years agosimplify getSectionForMergableConstant to take a SectionKind.
Chris Lattner [Sun, 26 Jul 2009 06:26:55 +0000 (06:26 +0000)]
simplify getSectionForMergableConstant to take a SectionKind.

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

15 years agoprecreate 4/8/16 byte mergable sections to simplify code.
Chris Lattner [Sun, 26 Jul 2009 06:16:11 +0000 (06:16 +0000)]
precreate 4/8/16 byte mergable sections to simplify code.

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

15 years agointroduce specialized mergable const sectionkinds for elements of size 4/8/16 to
Chris Lattner [Sun, 26 Jul 2009 06:11:33 +0000 (06:11 +0000)]
introduce specialized mergable const sectionkinds for elements of size 4/8/16 to
simplify targets.

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

15 years agoimprove the default impl of getSectionForMergableConstant by
Chris Lattner [Sun, 26 Jul 2009 05:57:07 +0000 (05:57 +0000)]
improve the default impl of getSectionForMergableConstant by
putting readonly constants in the readonly section if we have one.

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

15 years agomake elf targets correctly handle constant pool entries that require relocations.
Chris Lattner [Sun, 26 Jul 2009 05:55:20 +0000 (05:55 +0000)]
make elf targets correctly handle constant pool entries that require relocations.

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

15 years agoRearrange all the SectionKinds and structure them into a hierarchical
Chris Lattner [Sun, 26 Jul 2009 05:44:20 +0000 (05:44 +0000)]
Rearrange all the SectionKinds and structure them into a hierarchical
group instead of a bunch of random unrelated ideas.  Provide predicates
to categorize a SectionKind into a group, and use them instead of
getKind() throughout the code.

This also renames a ton of SectionKinds to be more consistent and
evocative, and adds a huge number of comments on the enums so that
I will hopefully be able to remember how this stuff works long from
now.

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

15 years agoUpdate target registration description in Writing An LLVM Backend, and add
Daniel Dunbar [Sun, 26 Jul 2009 05:41:39 +0000 (05:41 +0000)]
Update target registration description in Writing An LLVM Backend, and add
a mention in release notes.

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

15 years agoSort list of targets in --version.
Daniel Dunbar [Sun, 26 Jul 2009 05:09:50 +0000 (05:09 +0000)]
Sort list of targets in --version.

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

15 years agoFactor commonality in triple match routines into helper template for registering
Daniel Dunbar [Sun, 26 Jul 2009 05:03:33 +0000 (05:03 +0000)]
Factor commonality in triple match routines into helper template for registering
classes, and migrate existing targets over.

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

15 years agoOops, forgot XCore. Sorry XCore!
Daniel Dunbar [Sun, 26 Jul 2009 04:52:45 +0000 (04:52 +0000)]
Oops, forgot XCore. Sorry XCore!

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

15 years agoUpdate for API change.
Daniel Dunbar [Sun, 26 Jul 2009 04:23:03 +0000 (04:23 +0000)]
Update for API change.

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

15 years agofix isReadOnly predicate to not include data that has to be
Chris Lattner [Sun, 26 Jul 2009 04:18:10 +0000 (04:18 +0000)]
fix isReadOnly predicate to not include data that has to be
writable because of teh dynamic linker.

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

15 years agoremove a dead enum case.
Chris Lattner [Sun, 26 Jul 2009 04:09:02 +0000 (04:09 +0000)]
remove a dead enum case.

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

15 years agoUpdate Triple to use StringRef/Twine based APIs.
Daniel Dunbar [Sun, 26 Jul 2009 03:31:47 +0000 (03:31 +0000)]
Update Triple to use StringRef/Twine based APIs.
 - This is now shorter, simpler, safer, and more efficient, what a deal.

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

15 years agoAdd StringRef::{slice, split}, two convenient string operations which are simple
Daniel Dunbar [Sun, 26 Jul 2009 03:18:15 +0000 (03:18 +0000)]
Add StringRef::{slice, split}, two convenient string operations which are simple
and efficient on a StringRef.

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

15 years agoput normal data into .data instead of .data.rel on elf systems.
Chris Lattner [Sun, 26 Jul 2009 03:06:11 +0000 (03:06 +0000)]
put normal data into .data instead of .data.rel on elf systems.

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

15 years agoRemove unused header
Daniel Dunbar [Sun, 26 Jul 2009 02:23:52 +0000 (02:23 +0000)]
Remove unused header

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

15 years agoKill Target specific ModuleMatchQuality stuff.
Daniel Dunbar [Sun, 26 Jul 2009 02:22:58 +0000 (02:22 +0000)]
Kill Target specific ModuleMatchQuality stuff.
 - This was overkill and inconsistently implemented.

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

15 years agoAdd TargetRegistry::lookupTarget.
Daniel Dunbar [Sun, 26 Jul 2009 02:12:58 +0000 (02:12 +0000)]
Add TargetRegistry::lookupTarget.
 - This is a simplified mechanism which just looks up a target based on the
   target triple, with a few additional flags.

 - Remove getClosestStaticTargetForModule, the moral equivalent is now:
     lookupTarget(Mod->getTargetTriple, true, false, ...);

 - This no longer does the fuzzy matching with target data (based on endianness
   and pointer width) that getClosestStaticTargetForModule was doing, but this
   was deemed unnecessary.

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

15 years agoeliminate a pointless switch stmt.
Chris Lattner [Sun, 26 Jul 2009 01:44:55 +0000 (01:44 +0000)]
eliminate a pointless switch stmt.

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

15 years agofinish simplifying DarwinTargetAsmInfo::SelectSectionForGlobal
Chris Lattner [Sun, 26 Jul 2009 01:24:18 +0000 (01:24 +0000)]
finish simplifying DarwinTargetAsmInfo::SelectSectionForGlobal
for now.  Make the section switching directives more consistent
by not including \n and including \t for them all.

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

15 years agoSome clients rely on getName{Start,End} not returning 0, even if the length is
Daniel Dunbar [Sun, 26 Jul 2009 01:04:10 +0000 (01:04 +0000)]
Some clients rely on getName{Start,End} not returning 0, even if the length is
0.
 - I could have swore the prev change went through a make check cycle...

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

15 years agoRewrite getName{Start,End,Len} in terms of getName(), instead of vice-versa.
Daniel Dunbar [Sun, 26 Jul 2009 00:51:56 +0000 (00:51 +0000)]
Rewrite getName{Start,End,Len} in terms of getName(), instead of vice-versa.

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

15 years agosimplify DarwinTargetAsmInfo::SelectSectionForGlobal a bit
Chris Lattner [Sun, 26 Jul 2009 00:51:36 +0000 (00:51 +0000)]
simplify DarwinTargetAsmInfo::SelectSectionForGlobal a bit
and make it more aggressive, we now put:

const int G2 __attribute__((weak)) = 42;

into the text (readonly) segment like gcc, previously we put
it into the data (readwrite) segment.

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

15 years agosimplify some predicates, add isMergableString()
Chris Lattner [Sun, 26 Jul 2009 00:50:43 +0000 (00:50 +0000)]
simplify some predicates, add isMergableString()

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

15 years agoSimplify.
Daniel Dunbar [Sun, 26 Jul 2009 00:42:33 +0000 (00:42 +0000)]
Simplify.

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

15 years agoAdd support for ARM Neon VREV instructions.
Bob Wilson [Sun, 26 Jul 2009 00:39:34 +0000 (00:39 +0000)]
Add support for ARM Neon VREV instructions.
Patch by Anton Korzh, with some modifications from me.

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

15 years agoRemove Value::setName(const char*, unsigned).
Daniel Dunbar [Sun, 26 Jul 2009 00:34:27 +0000 (00:34 +0000)]
Remove Value::setName(const char*, unsigned).

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

15 years agoRemove Value::setName(const char*).
Daniel Dunbar [Sun, 26 Jul 2009 00:17:14 +0000 (00:17 +0000)]
Remove Value::setName(const char*).
 - Split into a separate patch because there is a slight functionality change,
   it is no longer valid to call setName(0), which was equivalent to
   setName(""). I'm hoping no one depends on this...

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

15 years agoRemove Value::{isName, getNameRef}.
Daniel Dunbar [Sat, 25 Jul 2009 23:55:21 +0000 (23:55 +0000)]
Remove Value::{isName, getNameRef}.

Also, change MDString to use a StringRef.

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

15 years agomake SectionKind be a first-class pod struct instead of just
Chris Lattner [Sat, 25 Jul 2009 23:21:55 +0000 (23:21 +0000)]
make SectionKind be a first-class pod struct instead of just
an enum.

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

15 years agoAdded a test and fixed a bug in BumpPtrAllocator relating to large alignment
Reid Kleckner [Sat, 25 Jul 2009 21:26:02 +0000 (21:26 +0000)]
Added a test and fixed a bug in BumpPtrAllocator relating to large alignment
values.  Hopefully this fixes PR4622.

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

15 years agothis is (unfortunately) several changes mixed together:
Chris Lattner [Sat, 25 Jul 2009 18:57:34 +0000 (18:57 +0000)]
this is (unfortunately) several changes mixed together:

1. Spell SectionFlags::Writeable as "Writable".
2. Add predicates for deriving SectionFlags from SectionKinds.
3. Sink ELF-specific getSectionPrefixForUniqueGlobal impl into
   ELFTargetAsmInfo.
4. Fix SectionFlagsForGlobal to know that BSS/ThreadBSS has the
   BSS bit set (the real fix for PR4619).
5. Fix isSuitableForBSS to not put globals with explicit sections
   set in BSS (which was the reason #4 wasn't fixed earlier).
6. Remove my previous hack for PR4619.

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

15 years agodocument some invariants.
Chris Lattner [Sat, 25 Jul 2009 18:11:58 +0000 (18:11 +0000)]
document some invariants.

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

15 years agoadd the most expedient hack to fix PR4619, along with a testcase.
Chris Lattner [Sat, 25 Jul 2009 17:57:37 +0000 (17:57 +0000)]
add the most expedient hack to fix PR4619, along with a testcase.
Thanks to Rafael for the great example.

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

15 years agoFix a few comments to say "backedge-taken count" instead of
Dan Gohman [Sat, 25 Jul 2009 16:18:38 +0000 (16:18 +0000)]
Fix a few comments to say "backedge-taken count" instead of
"trip count".

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

15 years agoSCEV objects are no longer reference-counted.
Dan Gohman [Sat, 25 Jul 2009 16:18:07 +0000 (16:18 +0000)]
SCEV objects are no longer reference-counted.

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

15 years agoUpdate comments to new-style syntax.
Dan Gohman [Sat, 25 Jul 2009 16:03:55 +0000 (16:03 +0000)]
Update comments to new-style syntax.

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

15 years agoWhen attempting to sign-extend an addrec by interpreting
Dan Gohman [Sat, 25 Jul 2009 16:03:30 +0000 (16:03 +0000)]
When attempting to sign-extend an addrec by interpreting
the step value as unsigned, the start value and the addrec
itself still need to be treated as signed.

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

15 years agoRemove spurious semicolons.
Dan Gohman [Sat, 25 Jul 2009 16:00:54 +0000 (16:00 +0000)]
Remove spurious semicolons.

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

15 years agoConvert DOUT to DEBUG.
Andreas Bolka [Sat, 25 Jul 2009 12:19:58 +0000 (12:19 +0000)]
Convert DOUT to DEBUG.

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

15 years agoSimplify JIT target selection.
Daniel Dunbar [Sat, 25 Jul 2009 10:09:50 +0000 (10:09 +0000)]
Simplify JIT target selection.
 - Instead of requiring targets to define a JIT quality match function, we just
   have them specify if they support a JIT.

 - Target selection for the JIT just gets the host triple and looks for the best
   target which matches the triple and has a JIT.

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

15 years agoMark attributes of return insn correctly. It was being assumed safe to delete in...
Sanjiv Gupta [Sat, 25 Jul 2009 07:48:53 +0000 (07:48 +0000)]
Mark attributes of return insn correctly. It was being assumed safe to delete in isSafeToDelete (a thing checked-in 76281).

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

15 years agoremove this test. It is currently failing because we now emit the string
Chris Lattner [Sat, 25 Jul 2009 07:31:51 +0000 (07:31 +0000)]
remove this test.  It is currently failing because we now emit the string
on darwin with ".cstring" instead of ".section  __TEXT,__cstring".  They
are the same and the former is better.  Remove this because this is no longer
magic pixie dust in the frontend.

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

15 years agoeventually we should describe string options in the data structures section
Chris Lattner [Sat, 25 Jul 2009 07:22:20 +0000 (07:22 +0000)]
eventually we should describe string options in the data structures section

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

15 years agominor tweaks.
Chris Lattner [Sat, 25 Jul 2009 07:16:59 +0000 (07:16 +0000)]
minor tweaks.

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

15 years agoAdd new helpers for registering targets.
Daniel Dunbar [Sat, 25 Jul 2009 06:49:55 +0000 (06:49 +0000)]
Add new helpers for registering targets.
 - Less boilerplate == good.

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

15 years agoFinish migrating VMCore to StringRef/Twine based APIs.
Daniel Dunbar [Sat, 25 Jul 2009 06:02:13 +0000 (06:02 +0000)]
Finish migrating VMCore to StringRef/Twine based APIs.

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

15 years agoOk, "most clients should be unaffected" was a lie. Add notes on upgrading.
Daniel Dunbar [Sat, 25 Jul 2009 05:26:53 +0000 (05:26 +0000)]
Ok, "most clients should be unaffected" was a lie. Add notes on upgrading.

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

15 years agoInitial update to VMCore to use Twines for string arguments.
Daniel Dunbar [Sat, 25 Jul 2009 04:41:11 +0000 (04:41 +0000)]
Initial update to VMCore to use Twines for string arguments.
 - The only meat here is in Value.{h,cpp} the rest is essential 'const
   std::string &' -> 'const Twine &'.

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

15 years agoFix 80-col violations.
Eric Christopher [Sat, 25 Jul 2009 02:45:27 +0000 (02:45 +0000)]
Fix 80-col violations.

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

15 years agoMove ExtractElementInst to ::Create instead of new. Update all uses.
Eric Christopher [Sat, 25 Jul 2009 02:28:41 +0000 (02:28 +0000)]
Move ExtractElementInst to ::Create instead of new. Update all uses.

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

15 years agoUpdate to new syntax.
Dan Gohman [Sat, 25 Jul 2009 02:23:48 +0000 (02:23 +0000)]
Update to new syntax.

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

15 years agoRewrite examples to use DEBUG instead of DOUT.
Daniel Dunbar [Sat, 25 Jul 2009 01:55:32 +0000 (01:55 +0000)]
Rewrite examples to use DEBUG instead of DOUT.

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

15 years ago80 col violation.
Evan Cheng [Sat, 25 Jul 2009 01:55:25 +0000 (01:55 +0000)]
80 col violation.

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

15 years agoConvert a few more things to use raw_ostream.
Dan Gohman [Sat, 25 Jul 2009 01:43:01 +0000 (01:43 +0000)]
Convert a few more things to use raw_ostream.

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

15 years agoGet rid of a couple of unnecessary getOpcode calls.
Evan Cheng [Sat, 25 Jul 2009 01:25:08 +0000 (01:25 +0000)]
Get rid of a couple of unnecessary getOpcode calls.

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

15 years agoTeach ScalarEvolution to make use of no-overflow flags when
Dan Gohman [Sat, 25 Jul 2009 01:22:26 +0000 (01:22 +0000)]
Teach ScalarEvolution to make use of no-overflow flags when
analyzing add recurrences.

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

15 years agoConvert a few more uses of llvm/Support/Streams.h to raw_ostream.
Dan Gohman [Sat, 25 Jul 2009 01:13:51 +0000 (01:13 +0000)]
Convert a few more uses of llvm/Support/Streams.h to raw_ostream.

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

15 years agoInstead of eagerly creating new SCEVs to replace all SCEVs that are
Dan Gohman [Sat, 25 Jul 2009 01:13:03 +0000 (01:13 +0000)]
Instead of eagerly creating new SCEVs to replace all SCEVs that are
affected after a PHI node has been analyzed, just remove affected
SCEVs from the Scalars map, so that they'll be (lazily) recreated as
needed. This avoids creating SCEV objects that aren't actually needed.

Also, rewrite the associated def-use walking code to be non-recursive
and to continue traversing past Instructions that don't have an
entry in the Scalars map.

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

15 years agoI've lost my mind. PR4572 has not been fixed.
Evan Cheng [Sat, 25 Jul 2009 01:11:46 +0000 (01:11 +0000)]
I've lost my mind. PR4572 has not been fixed.

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

15 years agoMake AliasAnalysis and related classes use
Dan Gohman [Sat, 25 Jul 2009 00:48:42 +0000 (00:48 +0000)]
Make AliasAnalysis and related classes use
getAnalysisIfAvailable<TargetData>().

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

15 years agoOne more getName -> getNameStr
Daniel Dunbar [Sat, 25 Jul 2009 00:43:31 +0000 (00:43 +0000)]
One more getName -> getNameStr

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

15 years agoAnother TODO.
Evan Cheng [Sat, 25 Jul 2009 00:39:37 +0000 (00:39 +0000)]
Another TODO.

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

15 years agoAdd a missing ilist_node.h #include to SparseBitVector, and add a very short
Jeffrey Yasskin [Sat, 25 Jul 2009 00:33:57 +0000 (00:33 +0000)]
Add a missing ilist_node.h #include to SparseBitVector, and add a very short
test for it. The test is by no means complete, but it tests the problem I was
fixing.

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

15 years agoChange Thumb2 jumptable codegen to one that uses two level jumps:
Evan Cheng [Sat, 25 Jul 2009 00:33:29 +0000 (00:33 +0000)]
Change Thumb2 jumptable codegen to one that uses two level jumps:

Before:
      adr r12, #LJTI3_0_0
      ldr pc, [r12, +r0, lsl #2]
LJTI3_0_0:
      .long    LBB3_24
      .long    LBB3_30
      .long    LBB3_31
      .long    LBB3_32

After:
      adr r12, #LJTI3_0_0
      add pc, r12, +r0, lsl #2
LJTI3_0_0:
      b.w    LBB3_24
      b.w    LBB3_30
      b.w    LBB3_31
      b.w    LBB3_32

This has several advantages.
1. This will make it easier to optimize this to a TBB / TBH instruction +
   (smaller) table.
2. This eliminate the need for ugly asm printer hack to force the address
   into thumb addresses (bit 0 is one).
3. Same codegen for pic and non-pic.
4. This eliminate the need to align the table so constantpool island pass
   won't have to over-estimate the size.

Based on my calculation, the later is probably slightly faster as well since
ldr pc with shifter address is very slow. That is, it should be a win as long
as the HW implementation can do a reasonable job of branch predict the second
branch.

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

15 years agoMemoryObject - Abstract base class for contiguous addressable memory.
Sean Callanan [Sat, 25 Jul 2009 00:30:51 +0000 (00:30 +0000)]
MemoryObject - Abstract base class for contiguous addressable memory.
  Necessary for cases in which the memory is in another process, in a
  file, or on a remote machine.

The primary use for this is the llvm-mc disassemblers, so that they
can be targeted at arbitrary objects, not just in-process memory.

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

15 years agoRemove a duplicated test.
Evan Cheng [Sat, 25 Jul 2009 00:24:40 +0000 (00:24 +0000)]
Remove a duplicated test.

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

15 years agoMore migration to raw_ostream, the water has dried up around the iostream hole.
Daniel Dunbar [Sat, 25 Jul 2009 00:23:56 +0000 (00:23 +0000)]
More migration to raw_ostream, the water has dried up around the iostream hole.
 - Some clients which used DOUT have moved to DEBUG. We are deprecating the
   "magic" DOUT behavior which avoided calling printing functions when the
   statement was disabled. In addition to being unnecessary magic, it had the
   downside of leaving code in -Asserts builds, and of hiding potentially
   unnecessary computations.

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

15 years agoARM code emitter can't handle Thumb2 instructions yet. So don't even try.
Evan Cheng [Sat, 25 Jul 2009 00:13:11 +0000 (00:13 +0000)]
ARM code emitter can't handle Thumb2 instructions yet. So don't even try.

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

15 years agoTweak, raw_ostream is a ostream, not iostream replacement
Daniel Dunbar [Fri, 24 Jul 2009 23:54:34 +0000 (23:54 +0000)]
Tweak, raw_ostream is a ostream, not iostream replacement

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