Commit Graph

49415 Commits

Author SHA1 Message Date
Evan Cheng 18688f431d Get rid of more dead code.
llvm-svn: 77227
2009-07-27 18:38:54 +00:00
Sean Callanan 5908cfedbb Many of Daniel's fixes.
I'm returning the number of bytes actually copied so that the client has some
warning when it reads past the end of the buffer.

I'm keeping the distinction between getByte() and getBytes() for now for
subclasses that use functions like ptrace() on Linux and only have a restricted
interface.  This makes their implementation easier, and subclasses can always
write a one-line implementation of readByte() that uses their custom 
readBytes().

llvm-svn: 77225
2009-07-27 18:33:24 +00:00
Evan Cheng 239ed4b343 Cosmetic change.
llvm-svn: 77222
2009-07-27 18:31:40 +00:00
Evan Cheng 8f2ed1bc5a Clean up.
llvm-svn: 77221
2009-07-27 18:25:24 +00:00
Douglas Gregor 24be97df67 CMake configuration: find mkdtemp, mkstemp, mktemp.
llvm-svn: 77219
2009-07-27 18:23:41 +00:00
Evan Cheng 056c669e93 Get rid of some more getOpcode calls.
This also fixes potential problems in ARMBaseInstrInfo routines not recognizing thumb1 instructions when 32-bit and 16-bit instructions mix.

llvm-svn: 77218
2009-07-27 18:20:05 +00:00
Mike Stump 447a8f29ef Fix build.
llvm-svn: 77217
2009-07-27 18:18:30 +00:00
Dan Gohman 6154a01cee Following discussion on llvm-dev ("proposed new rule for getelementptr"),
add a new "Pointer Aliasing Rules" section.

llvm-svn: 77216
2009-07-27 18:07:55 +00:00
Sanjiv Gupta 96b3d4a2f9 Remove duplicate entries while printing decls for external symbols.
Some libcall names are same, so they were getting printed twice.

llvm-svn: 77215
2009-07-27 18:04:34 +00:00
Douglas Gregor c0137150ee CMake: make sure that the *.inc files for libSystem show up in the resulting
project.

llvm-svn: 77213
2009-07-27 17:55:55 +00:00
Chris Lattner e48c85fa8b add an explanatory comment about why we drop these in readonly and
not in mergable

llvm-svn: 77210
2009-07-27 17:39:40 +00:00
Devang Patel de6f46c32e Do not seed mstadata into the value map.
llvm-svn: 77208
2009-07-27 17:17:04 +00:00
Chris Lattner 1814e81e17 make COFF work like ELF and macho, by splitting out into its own
header even though there is only one COFF target.

llvm-svn: 77204
2009-07-27 16:45:59 +00:00
Chris Lattner ff1f401f9b don't create default text/data sections for all targets.
llvm-svn: 77203
2009-07-27 16:44:04 +00:00
Chris Lattner e25817a138 Apparently alpha doesn't use ElfTargetAsmInfo (?)
llvm-svn: 77202
2009-07-27 16:42:14 +00:00
David Goodwin 007031d1b4 Thumb-2 does not have RSC.
llvm-svn: 77201
2009-07-27 16:39:05 +00:00
David Goodwin 782f242fd7 Add ".w" suffix for wide thumb-2 instructions.
llvm-svn: 77199
2009-07-27 16:31:55 +00:00
Chris Lattner 543c83e8f2 inline a method.
llvm-svn: 77198
2009-07-27 16:27:32 +00:00
Chris Lattner 3679ad5a77 apparently we have "windows" and "coff", which are different(?)
llvm-svn: 77197
2009-07-27 16:22:39 +00:00
Chris Lattner c51f3394f3 sink text/data section creation down into the target-specific places that
should know about them.  PECoff doesn't share these, and I want all sections
to be created by object-file-specific code.

llvm-svn: 77196
2009-07-27 16:20:58 +00:00
Sanjiv Gupta a77a182b04 Test case to check that separate section is created for a global variable specified with section attribute.
llvm-svn: 77195
2009-07-27 16:20:41 +00:00
Dan Gohman 9c7f808201 Change the assembly syntax for nsw, nuw, and exact, putting them
after their associated opcodes rather than before. This makes them
a little easier to read.

llvm-svn: 77194
2009-07-27 16:11:46 +00:00
Dan Gohman 169ef138e8 Fix wording in comments.
llvm-svn: 77193
2009-07-27 16:09:48 +00:00
Chris Lattner 57af4ece60 update testcase.
llvm-svn: 77192
2009-07-27 15:52:58 +00:00
Chris Lattner 469ae8ac54 32-bit darwin targets support .literal16 too.
llvm-svn: 77191
2009-07-27 15:44:04 +00:00
Benjamin Kramer 729749d34d Remove trailing slashes from include paths. Some versions of mingw don't like them.
llvm-svn: 77188
2009-07-27 09:39:18 +00:00
Benjamin Kramer 0f44237aef Test commit: fix typo
llvm-svn: 77187
2009-07-27 09:06:52 +00:00
Chris Lattner 86b7255776 Eliminate getNamed/getUnnamedSection, adding a new and unified getOrCreateSection
instead.

llvm-svn: 77186
2009-07-27 06:17:14 +00:00
Chris Lattner 149465ea06 Eliminate SectionFlags, just embed a SectionKind into Section
instead and drive things based off of that.

llvm-svn: 77184
2009-07-27 05:32:16 +00:00
Evan Cheng 371ec9e810 If CPSR is modified but the def is dead, then it's ok to fold the load / store.
llvm-svn: 77182
2009-07-27 04:18:04 +00:00
Evan Cheng c47e109335 Use t2LDRi12 and t2STRi12 to load / store to / from stack frames. Eliminate more getOpcode calls.
llvm-svn: 77181
2009-07-27 03:14:20 +00:00
Sanjiv Gupta c8885129d8 Generate a libcall for i8 multiply.
llvm-svn: 77179
2009-07-27 02:44:46 +00:00
Sanjiv Gupta e334b34bfd 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. 

llvm-svn: 77178
2009-07-27 02:26:06 +00:00
Evan Cheng 186332f898 Use the right instructions to copy between GPR and the more strictive tGPR classes. t2MOV does not match the RC requirements.
llvm-svn: 77175
2009-07-27 00:33:08 +00:00
Evan Cheng 0e5b149930 Merge isLoadFromStackSlot into one since it behaves the same regardless of sub-target.
llvm-svn: 77174
2009-07-27 00:24:36 +00:00
Evan Cheng 26b51b15ed Just use a single isMoveInstr to catch all the cases.
llvm-svn: 77173
2009-07-27 00:05:15 +00:00
Evan Cheng faede73a32 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.
llvm-svn: 77172
2009-07-26 23:59:01 +00:00
Eli Friedman 65919b5058 Reorganize code a bit to reduce indentation. No visible functionality
change.

llvm-svn: 77171
2009-07-26 23:47:17 +00:00
Nick Lewycky fd6a2498ab 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.

llvm-svn: 77170
2009-07-26 22:16:39 +00:00
Daniel Dunbar bcd92f1bc4 Don't use llvm_report_error in libSystem, this is a layering violation.
llvm-svn: 77169
2009-07-26 21:16:42 +00:00
Chris Lattner 602d44fa70 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.

llvm-svn: 77165
2009-07-26 19:23:28 +00:00
Evan Cheng 8953720f23 Refactor. Get rid of a few more getOpcode() calls.
llvm-svn: 77164
2009-07-26 18:55:14 +00:00
Chris Lattner 06ad4948f5 reduce indentation
llvm-svn: 77161
2009-07-26 18:08:15 +00:00
Chris Lattner e3c374ac33 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.

llvm-svn: 77160
2009-07-26 17:46:03 +00:00
Sanjiv Gupta fc4d4994ee Fix the breakage caused by 76950.
PIC16 has special naming conventions for variables having section names specified via section attribute.

llvm-svn: 77153
2009-07-26 10:25:01 +00:00
Daniel Dunbar 6115b39ffd Remove Value::getName{Start,End}, the last of the old Name APIs.
llvm-svn: 77152
2009-07-26 09:48:23 +00:00
Daniel Dunbar 7cc8f7e86d Make sure getName().data() is always null terminated.
llvm-svn: 77149
2009-07-26 09:22:02 +00:00
Daniel Dunbar ca414c7cae Remove Value::getNameLen
llvm-svn: 77148
2009-07-26 08:34:35 +00:00
Nick Lewycky ec7ec7c1ac 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.

llvm-svn: 77146
2009-07-26 08:16:51 +00:00
Daniel Dunbar 9813b0b025 Eliminate some uses of DOUT, cerr, and getNameStart().
llvm-svn: 77145
2009-07-26 07:49:05 +00:00
Chris Lattner 1db210322a remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,
just use a smallstring instead.

llvm-svn: 77144
2009-07-26 07:33:58 +00:00
Chris Lattner d2e0220cb4 simplify SectionFlagsForGlobal, even though I want to kill it.
llvm-svn: 77143
2009-07-26 07:17:39 +00:00
Chris Lattner 9db3a9286d make SectionKind keep track of whether a global had an explicit
section specified for it or not.

llvm-svn: 77142
2009-07-26 07:14:28 +00:00
Chris Lattner d9951203f0 simplify this code now that SectionKind knows if a global is weak or not.
llvm-svn: 77141
2009-07-26 07:07:01 +00:00
Chris Lattner e45ff5cc2b make SectionKind know whether a symbol is weak or not in addition
to its classification.

llvm-svn: 77140
2009-07-26 07:00:12 +00:00
Chris Lattner b1575e2aec Make the kind actually be private.
llvm-svn: 77139
2009-07-26 06:51:27 +00:00
Chris Lattner 29151b0218 rename Mergable -> Mergeable and Writable -> Writeable
llvm-svn: 77138
2009-07-26 06:48:26 +00:00
Chris Lattner abd47512f7 two files I missed in the last commit.
llvm-svn: 77137
2009-07-26 06:36:20 +00:00
Chris Lattner 2d7270d577 remove a bunch of helper functions, just use SectionKind::get instead.
llvm-svn: 77135
2009-07-26 06:34:33 +00:00
Chris Lattner fb6867c7db simplify getSectionForMergableConstant to take a SectionKind.
llvm-svn: 77134
2009-07-26 06:26:55 +00:00
Chris Lattner aae21f4915 precreate 4/8/16 byte mergable sections to simplify code.
llvm-svn: 77133
2009-07-26 06:16:11 +00:00
Chris Lattner 911e2b8649 introduce specialized mergable const sectionkinds for elements of size 4/8/16 to
simplify targets.

llvm-svn: 77132
2009-07-26 06:11:33 +00:00
Chris Lattner 6194637d66 improve the default impl of getSectionForMergableConstant by
putting readonly constants in the readonly section if we have one.

llvm-svn: 77131
2009-07-26 05:57:07 +00:00
Chris Lattner 1e76db06b9 make elf targets correctly handle constant pool entries that require relocations.
llvm-svn: 77130
2009-07-26 05:55:20 +00:00
Chris Lattner 1d68bd7f97 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.

llvm-svn: 77129
2009-07-26 05:44:20 +00:00
Daniel Dunbar 9d81cc668a Update target registration description in Writing An LLVM Backend, and add
a mention in release notes.

llvm-svn: 77128
2009-07-26 05:41:39 +00:00
Daniel Dunbar a0ad190a35 Sort list of targets in --version.
llvm-svn: 77127
2009-07-26 05:09:50 +00:00
Daniel Dunbar ee01b242e8 Factor commonality in triple match routines into helper template for registering
classes, and migrate existing targets over.

llvm-svn: 77126
2009-07-26 05:03:33 +00:00
Daniel Dunbar bd481a119c Oops, forgot XCore. Sorry XCore!
llvm-svn: 77125
2009-07-26 04:52:45 +00:00
Daniel Dunbar 172649be2c Update for API change.
llvm-svn: 77124
2009-07-26 04:23:03 +00:00
Chris Lattner e24002f37f fix isReadOnly predicate to not include data that has to be
writable because of teh dynamic linker.

llvm-svn: 77122
2009-07-26 04:18:10 +00:00
Chris Lattner d71c1009c2 remove a dead enum case.
llvm-svn: 77121
2009-07-26 04:09:02 +00:00
Daniel Dunbar 19e7076ddd Update Triple to use StringRef/Twine based APIs.
- This is now shorter, simpler, safer, and more efficient, what a deal.

llvm-svn: 77119
2009-07-26 03:31:47 +00:00
Daniel Dunbar 56563f33f7 Add StringRef::{slice, split}, two convenient string operations which are simple
and efficient on a StringRef.

llvm-svn: 77117
2009-07-26 03:18:15 +00:00
Chris Lattner 8e58bc9ed4 put normal data into .data instead of .data.rel on elf systems.
llvm-svn: 77116
2009-07-26 03:06:11 +00:00
Daniel Dunbar 4aea2d97c8 Remove unused header
llvm-svn: 77115
2009-07-26 02:23:52 +00:00
Daniel Dunbar bc981d8efa Kill Target specific ModuleMatchQuality stuff.
- This was overkill and inconsistently implemented.

llvm-svn: 77114
2009-07-26 02:22:58 +00:00
Daniel Dunbar 47d679151b 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.

llvm-svn: 77111
2009-07-26 02:12:58 +00:00
Chris Lattner 3092b82255 eliminate a pointless switch stmt.
llvm-svn: 77110
2009-07-26 01:44:55 +00:00
Chris Lattner 397792d981 finish simplifying DarwinTargetAsmInfo::SelectSectionForGlobal
for now.  Make the section switching directives more consistent
by not including \n and including \t for them all.

llvm-svn: 77107
2009-07-26 01:24:18 +00:00
Daniel Dunbar 3c27648eda 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...

llvm-svn: 77106
2009-07-26 01:04:10 +00:00
Daniel Dunbar 32285942a1 Rewrite getName{Start,End,Len} in terms of getName(), instead of vice-versa.
llvm-svn: 77105
2009-07-26 00:51:56 +00:00
Chris Lattner 5b42b45fb9 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.

llvm-svn: 77104
2009-07-26 00:51:36 +00:00
Chris Lattner 26ce308bbf simplify some predicates, add isMergableString()
llvm-svn: 77103
2009-07-26 00:50:43 +00:00
Daniel Dunbar a32c999ca2 Simplify.
llvm-svn: 77102
2009-07-26 00:42:33 +00:00
Bob Wilson 8a37bbebfd Add support for ARM Neon VREV instructions.
Patch by Anton Korzh, with some modifications from me.

llvm-svn: 77101
2009-07-26 00:39:34 +00:00
Daniel Dunbar d786b51ea4 Remove Value::setName(const char*, unsigned).
llvm-svn: 77100
2009-07-26 00:34:27 +00:00
Daniel Dunbar 987ec564e7 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...

llvm-svn: 77099
2009-07-26 00:17:14 +00:00
Daniel Dunbar e03eecb75f Remove Value::{isName, getNameRef}.
Also, change MDString to use a StringRef.

llvm-svn: 77098
2009-07-25 23:55:21 +00:00
Chris Lattner 0af00396a7 make SectionKind be a first-class pod struct instead of just
an enum.

llvm-svn: 77096
2009-07-25 23:21:55 +00:00
Reid Kleckner 4b1f2f4779 Added a test and fixed a bug in BumpPtrAllocator relating to large alignment
values.  Hopefully this fixes PR4622.

llvm-svn: 77088
2009-07-25 21:26:02 +00:00
Chris Lattner 60f3b73e11 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.

llvm-svn: 77085
2009-07-25 18:57:34 +00:00
Chris Lattner 7b5e51091e document some invariants.
llvm-svn: 77084
2009-07-25 18:11:58 +00:00
Chris Lattner 2de9510572 add the most expedient hack to fix PR4619, along with a testcase.
Thanks to Rafael for the great example.

llvm-svn: 77083
2009-07-25 17:57:37 +00:00
Dan Gohman 3d0b52caf1 Fix a few comments to say "backedge-taken count" instead of
"trip count".

llvm-svn: 77081
2009-07-25 16:18:38 +00:00
Dan Gohman ef2ae2c8ee SCEV objects are no longer reference-counted.
llvm-svn: 77080
2009-07-25 16:18:07 +00:00
Dan Gohman 83b3b3d144 Update comments to new-style syntax.
llvm-svn: 77079
2009-07-25 16:03:55 +00:00
Dan Gohman 534d66a426 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.

llvm-svn: 77078
2009-07-25 16:03:30 +00:00
Dan Gohman b7e6a3f527 Remove spurious semicolons.
llvm-svn: 77077
2009-07-25 16:00:54 +00:00
Andreas Bolka 8377af0296 Convert DOUT to DEBUG.
llvm-svn: 77065
2009-07-25 12:19:58 +00:00
Daniel Dunbar 691a4784db 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.

llvm-svn: 77060
2009-07-25 10:09:50 +00:00
Sanjiv Gupta b6ee0b1d9b Mark attributes of return insn correctly. It was being assumed safe to delete in isSafeToDelete (a thing checked-in 76281).
llvm-svn: 77056
2009-07-25 07:48:53 +00:00
Chris Lattner fcfbc7bb2c 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.

llvm-svn: 77055
2009-07-25 07:31:51 +00:00
Chris Lattner 47bb37c9d2 eventually we should describe string options in the data structures section
llvm-svn: 77054
2009-07-25 07:22:20 +00:00
Chris Lattner 375a3f40af minor tweaks.
llvm-svn: 77053
2009-07-25 07:16:59 +00:00
Daniel Dunbar 5680b4f285 Add new helpers for registering targets.
- Less boilerplate == good.

llvm-svn: 77052
2009-07-25 06:49:55 +00:00
Daniel Dunbar d43b86d4a4 Finish migrating VMCore to StringRef/Twine based APIs.
llvm-svn: 77051
2009-07-25 06:02:13 +00:00
Daniel Dunbar fbea11ae66 Ok, "most clients should be unaffected" was a lie. Add notes on upgrading.
llvm-svn: 77050
2009-07-25 05:26:53 +00:00
Daniel Dunbar 4975db6276 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 &'.

llvm-svn: 77048
2009-07-25 04:41:11 +00:00
Eric Christopher 53e1cd7254 Fix 80-col violations.
llvm-svn: 77045
2009-07-25 02:45:27 +00:00
Eric Christopher c974225976 Move ExtractElementInst to ::Create instead of new. Update all uses.
llvm-svn: 77044
2009-07-25 02:28:41 +00:00
Dan Gohman 6b8677015d Update to new syntax.
llvm-svn: 77043
2009-07-25 02:23:48 +00:00
Daniel Dunbar 04bbd9cd34 Rewrite examples to use DEBUG instead of DOUT.
llvm-svn: 77042
2009-07-25 01:55:32 +00:00
Evan Cheng ea23c3ba46 80 col violation.
llvm-svn: 77041
2009-07-25 01:55:25 +00:00
Dan Gohman 1ddf98ad8e Convert a few more things to use raw_ostream.
llvm-svn: 77039
2009-07-25 01:43:01 +00:00
Evan Cheng c1a5cfa9a0 Get rid of a couple of unnecessary getOpcode calls.
llvm-svn: 77035
2009-07-25 01:25:08 +00:00
Dan Gohman 62ef6a7f1c Teach ScalarEvolution to make use of no-overflow flags when
analyzing add recurrences.

llvm-svn: 77034
2009-07-25 01:22:26 +00:00
Dan Gohman 29f2baf3b3 Convert a few more uses of llvm/Support/Streams.h to raw_ostream.
llvm-svn: 77033
2009-07-25 01:13:51 +00:00
Dan Gohman 0b89dff37d 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.

llvm-svn: 77032
2009-07-25 01:13:03 +00:00
Evan Cheng 3b5791f982 I've lost my mind. PR4572 has not been fixed.
llvm-svn: 77031
2009-07-25 01:11:46 +00:00
Dan Gohman 43d19d61d4 Make AliasAnalysis and related classes use
getAnalysisIfAvailable<TargetData>().

llvm-svn: 77028
2009-07-25 00:48:42 +00:00
Daniel Dunbar 67395e7c2c One more getName -> getNameStr
llvm-svn: 77027
2009-07-25 00:43:31 +00:00
Evan Cheng b2c22f00de Another TODO.
llvm-svn: 77026
2009-07-25 00:39:37 +00:00
Jeffrey Yasskin f4e1db1722 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.

llvm-svn: 77025
2009-07-25 00:33:57 +00:00
Evan Cheng f3a1fce8ae 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.

llvm-svn: 77024
2009-07-25 00:33:29 +00:00
Sean Callanan bcf2ae6aa5 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.

llvm-svn: 77023
2009-07-25 00:30:51 +00:00
Evan Cheng 8c8e88bd39 Remove a duplicated test.
llvm-svn: 77020
2009-07-25 00:24:40 +00:00
Daniel Dunbar 0dd5e1ed39 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.

llvm-svn: 77019
2009-07-25 00:23:56 +00:00
Evan Cheng f297256136 ARM code emitter can't handle Thumb2 instructions yet. So don't even try.
llvm-svn: 77018
2009-07-25 00:13:11 +00:00
Daniel Dunbar 4bd53c6479 Tweak, raw_ostream is a ostream, not iostream replacement
llvm-svn: 77017
2009-07-24 23:54:34 +00:00
Daniel Dunbar 15d3967f92 Fix build for GCC 4.0?
llvm-svn: 77016
2009-07-24 23:42:33 +00:00
Daniel Dunbar b2dc296910 Fix compile with 4.4 (I hope?); PR4617.
llvm-svn: 77015
2009-07-24 23:23:46 +00:00
Andreas Bolka c76c723e25 Forward-declare raw_ostream.
llvm-svn: 77014
2009-07-24 23:19:28 +00:00
Owen Anderson edb4a70325 Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
llvm-svn: 77011
2009-07-24 23:12:02 +00:00
Daniel Dunbar fcd54f73bf CodingStandards: Emphasize use of raw_ostream more.
- Chris, please approve.

llvm-svn: 77010
2009-07-24 23:04:51 +00:00
Dan Gohman 85a791ef7a AliasAnalysis wants sizes in address-units, not bits.
llvm-svn: 77009
2009-07-24 23:01:30 +00:00
Evan Cheng 01740ab57b Forgot this test earlier.
llvm-svn: 77007
2009-07-24 22:42:45 +00:00
Evan Cheng aee0e1f48c Fix these tests.
llvm-svn: 77006
2009-07-24 22:42:22 +00:00
Eli Friedman 5c9cdb3e3a Fix assert assembling zero-argument constant GEP.
There's still a strict-aliasing violation here, but I don't feel like 
dealing with that right now...

llvm-svn: 77005
2009-07-24 21:56:17 +00:00
Evan Cheng c64ce30c67 Uh. It would be useful to actually print the operand.
llvm-svn: 77004
2009-07-24 20:47:38 +00:00
Chris Lattner 70fa4661eb fix some predicates
llvm-svn: 76999
2009-07-24 20:27:11 +00:00
Chris Lattner a39aaa5fd5 change SectionKindForGlobal from being a public (and
previously virtual) function to being a static function
in the .cpp file.

llvm-svn: 76997
2009-07-24 20:14:10 +00:00
Evan Cheng c26c76ec1d Disable my constant island pass optimization (to make use soimm more effectively). It caused infinite looping on lencod.
llvm-svn: 76995
2009-07-24 19:31:03 +00:00
Eric Christopher fae639c9ad Move insertps tests to sse41 combo test file, convert to filecheck
format and add an extract/insert test.

llvm-svn: 76994
2009-07-24 19:24:26 +00:00
Chris Lattner 708e559247 make SectionKindForGlobal target independent, and therefore non-virtual.
It's classifications now include elf-specific discriminators.  Targets
that don't have these features (like darwin and pecoff) simply treat
data.rel like data, etc.

llvm-svn: 76993
2009-07-24 19:15:47 +00:00
Evan Cheng 5a49c54061 Add a workaround for Darwin assembler bug where it's not setting the thumb bit in Thumb2 jumptable entries. We now pass Olden.
llvm-svn: 76991
2009-07-24 18:54:23 +00:00
Chris Lattner 73f6651439 we already know the sectionkind when invoking SelectSectionForGlobal,
pass it in instead of recomputing it.

llvm-svn: 76990
2009-07-24 18:42:53 +00:00
Chris Lattner bf9ac228f7 make SectionForGlobal non-virtual, add a hook for pic16 to do its "address=" hack.
llvm-svn: 76989
2009-07-24 18:34:27 +00:00
Dan Gohman 0b5be94c79 Fix this condition I accidentally inverted.
llvm-svn: 76988
2009-07-24 18:31:07 +00:00
Jakob Stoklund Olesen 1ae0736830 Add support for promoting SETCC operations.
llvm-svn: 76987
2009-07-24 18:22:59 +00:00