Commit Graph

50268 Commits

Author SHA1 Message Date
Evan Cheng f16a1d5b79 Duh. Most 16-bit Thumb rr instructions are two-address. Fix table.
llvm-svn: 78560
2009-08-10 07:20:37 +00:00
Evan Cheng 1f5bee14a1 CPSR can be livein; transfer predicate operands correctly; tMUL is two-address.
llvm-svn: 78559
2009-08-10 06:57:42 +00:00
Evan Cheng 092b701a2c Add support for folding loads / stores into 16-bit moves used by Thumb2.
llvm-svn: 78558
2009-08-10 06:32:05 +00:00
Evan Cheng 55c014a9f3 80 col violation.
llvm-svn: 78557
2009-08-10 05:51:48 +00:00
Evan Cheng f5b73869f2 Use tMOVgpr2gpr instead of t2MOVr.
llvm-svn: 78556
2009-08-10 05:49:43 +00:00
Daniel Dunbar 1bf60c257c Add support for a user supplied pointer argument to llvm_install_error_handler.
llvm-svn: 78553
2009-08-10 03:36:26 +00:00
Bruno Cardoso Lopes 9b3484dd14 Move ConstantExpr handling to ResolveConstantExpr method and also
add support for PtrToInt, Add, Mul.

llvm-svn: 78552
2009-08-10 03:32:40 +00:00
Evan Cheng 51cbd2d6c4 Add support to reduce most of 32-bit Thumb2 arithmetic instructions.
llvm-svn: 78550
2009-08-10 02:37:24 +00:00
Evan Cheng 5b4c308f0c Always use the 16-bit tMOVgpr2gpr instead of the 32-bit t2MOVr.
llvm-svn: 78549
2009-08-10 02:06:53 +00:00
Chris Lattner cb307a27bf Make the big switch: Change MCSectionMachO to represent a section *semantically*
instead of syntactically as a string.  This means that it keeps track of the 
segment, section, flags, etc directly and asmprints them in the right format.
This also includes parsing and validation support for llvm-mc and 
"attribute(section)", so we should now start getting errors about invalid 
section attributes from the compiler instead of the assembler on darwin.

Still todo: 
1) Uniquing of darwin mcsections
2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h]
3) there are a few FIXMEs, for example what is the syntax to get the
   S_GB_ZEROFILL segment type?

llvm-svn: 78547
2009-08-10 01:39:42 +00:00
Chris Lattner aea9dfc167 add a simple back() method to StringRef.
llvm-svn: 78544
2009-08-10 00:44:02 +00:00
Benjamin Kramer 6e046f4291 Use abs64 instead abs; some platforms don't have a 64-bit abs overload. Noticed by Yonggang Luo!
llvm-svn: 78543
2009-08-09 22:37:07 +00:00
Evan Cheng d461c1c559 Add support to convert 32-bit instructions to 16-bit non-two-address ones.
llvm-svn: 78540
2009-08-09 19:17:19 +00:00
Chris Lattner f4c2eee251 always end a section with \n on elf.
llvm-svn: 78534
2009-08-09 15:31:10 +00:00
Daniel Dunbar d9631912cf llvm-mc/AsmParser: Fix thinko in ClassInfo::operator<.
llvm-svn: 78533
2009-08-09 08:23:23 +00:00
Daniel Dunbar e0891c2109 llvm-mc/AsmParser: Add hack to ignore Int_* and *_Int instructions for now, to
make it easier to see interesting ambiguities.
 - Also, check that user doesn't try to redefine the super class. This is a wart
   in the current design, in that assembler match classes aren't explicitly
   declared somewhere (so there isn't a unique place to declare the super
   class). This should probably be fixed.

llvm-svn: 78532
2009-08-09 08:19:00 +00:00
Daniel Dunbar 5877782962 Disable this test for now, we don't check for super classes when matching yet.
llvm-svn: 78531
2009-08-09 07:35:56 +00:00
Daniel Dunbar 8e33cb2de1 llvm-mc/AsmParser: Implement user defined super classes.
- We can now discriminate SUB32ri8 from SUB32ri, for example.

llvm-svn: 78530
2009-08-09 07:20:21 +00:00
Bob Wilson 7fc63417d7 Add tests for Neon VZIP and VUZP instructions.
llvm-svn: 78529
2009-08-09 06:48:29 +00:00
Bob Wilson f60c8807e8 Add a test for Neon VTRN instructions.
llvm-svn: 78528
2009-08-09 06:30:46 +00:00
Daniel Dunbar f573b563e1 llvm-mc/AsmParser: Separate instruction ordering for ambiguity detection.
- We want the ordering operation to be simple, since we run it on every
   match. The old ordering is also not a strict weak ordering when there are
   ambiguities, which makes MSVC unhappy.

 - While we are at it, detect all ambiguities instead of just the adjacent
   ones. There are actually 655, for X86.

llvm-svn: 78526
2009-08-09 06:05:33 +00:00
Bob Wilson 45fa71a392 Change Neon table lookup (VTBL) and table extension (VTBX) intrinsics to
take the table vectors as separate arguments, instead of the previous
approach where they were combined into one big vector.

llvm-svn: 78525
2009-08-09 06:03:09 +00:00
Daniel Dunbar 447c4ab91d Extend comment on ParserMatchClass .td field, and add some missing
classes for X86.

llvm-svn: 78524
2009-08-09 06:00:04 +00:00
Daniel Dunbar c32aa060bd llvm-mc/AsmParser: Define match classes in the .td file.
-2 FIXMEs.

llvm-svn: 78523
2009-08-09 05:18:30 +00:00
Daniel Dunbar 3239f020eb llvm-mc/AsmParser: Sketch infrastructure for ordering instructions & detecting
ambiguities.
 - Currently there are 483 ambiguities to resolve. :)

llvm-svn: 78522
2009-08-09 04:00:06 +00:00
Daniel Dunbar 22dd774d8f STLExtras: Add less_ptr.
llvm-svn: 78521
2009-08-09 03:36:59 +00:00
Chris Lattner b7ff9e84be fix edito
llvm-svn: 78520
2009-08-08 23:43:55 +00:00
Daniel Dunbar d8c822f180 llvm-mc/AsmMatcher: Tweak string matcher (missed a newline).
llvm-svn: 78518
2009-08-08 23:43:16 +00:00
Chris Lattner 591105c540 sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-)

llvm-svn: 78517
2009-08-08 23:39:42 +00:00
Anton Korobeynikov cfed3005e5 Use subclassing to print lane-like immediates (w/o hash) eliminating
'no_hash' modifier. Hopefully this will make Daniel happy :)

llvm-svn: 78514
2009-08-08 23:10:41 +00:00
Daniel Dunbar 5478125143 llvm-mc/AsmMatcher: Tweak string matcher.
- Track whether we need to insert an explicit 'break'.

 - Invert conditional when matching a single prefix to reduce
   nesting/bracing/breaking.

 - wc -l of X86GenAsmMatcher.inc decreased by 10%. :)

llvm-svn: 78513
2009-08-08 22:57:25 +00:00
Chris Lattner c51023b0bc remove nondeterminstic test.
llvm-svn: 78512
2009-08-08 22:56:37 +00:00
Chris Lattner 3219d85f16 add a note about dead zero extends.
llvm-svn: 78511
2009-08-08 22:46:59 +00:00
Chris Lattner 1cb9396f4f 1. Make MCSection an abstract class.
2. Move section switch printing to MCSection virtual method which takes a
   TAI.  This eliminates textual formatting stuff from TLOF.
3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and 
   TLOFELF::AtIsCommentChar.

llvm-svn: 78510
2009-08-08 22:41:53 +00:00
Chris Lattner 089b7de20d switch this to create coff sections for now, it doesn't really matter for
llvm-mc's purpose yet and we'll want to switch to creating semantic sections
at some point.

llvm-svn: 78509
2009-08-08 22:38:48 +00:00
Eric Christopher 7dfa9f2e56 Add crc32 instruction and intrinsics. Add a new class of prefix
bytes for F2 0F 38 and propagate. Add a FIXME for a set
of possibilities which correspond to intrinsics already used.

New test.

llvm-svn: 78508
2009-08-08 21:55:08 +00:00
Jakob Stoklund Olesen e2dc8a46e9 Add support for READCYCLECOUNTER in Blackfin back-end.
llvm-svn: 78506
2009-08-08 21:42:22 +00:00
Chris Lattner 26cc5b78d0 add new PIC16Section class, this time hopefully not breaking the build :)
llvm-svn: 78505
2009-08-08 21:37:01 +00:00
Daniel Dunbar 66f4f54e8a llvm-mc/AsmMatcher: Switch token matching to use the new string matcher.
Also, redefined MatchRegisterName to just return the register value or a
sentinel, to simplify the generated code.

llvm-svn: 78504
2009-08-08 21:22:41 +00:00
Daniel Dunbar 59410aaea6 Revert r78501, it doesn't build.
--- Reverse-merging r78501 into '.':
U    lib/Target/PIC16/PIC16TargetObjectFile.cpp
D    lib/Target/PIC16/PIC16Section.h

llvm-svn: 78503
2009-08-08 21:12:40 +00:00
Chris Lattner 4a4e4487fc make PIC16 create its own custom MCSection.
llvm-svn: 78501
2009-08-08 20:55:25 +00:00
Chris Lattner 245fdfb9c3 make target-specific TLOF impls (except PIC16) create target-specific
MCSection instances.

llvm-svn: 78500
2009-08-08 20:52:13 +00:00
Chris Lattner 5a9bc50fa8 stub out PECOFF/MachO/ELF MCSection classes
llvm-svn: 78499
2009-08-08 20:50:49 +00:00
Chris Lattner c9ea8fddb2 eliminate TargetLoweringObjectFileSparc in favor of a TAI hook.
A TAI hook is appropriate in this case because this is just an
asm syntax issue, not a semantic difference. TLOF should model
the semantics of the section.

llvm-svn: 78498
2009-08-08 20:43:12 +00:00
Jakob Stoklund Olesen dc6bccbaa6 Don't build illegal ops in DAGCombiner::SimplifyBinOpWithSameOpcodeHands().
Blackfin supports and/or/xor on i32 but not on i16. Teach
DAGCombiner::SimplifyBinOpWithSameOpcodeHands to not produce illegal nodes
after legalize ops.

llvm-svn: 78497
2009-08-08 20:42:17 +00:00
Chris Lattner 36d04ec972 give pic16 a target-specific section creation name too
llvm-svn: 78496
2009-08-08 20:23:47 +00:00
Chris Lattner ce7d14032b now that getOrCreateSection is all object-file specific,
give the impls an object-file-specific name.  In the future
they can take different arguments etc.

llvm-svn: 78495
2009-08-08 20:22:20 +00:00
Chris Lattner 302041d5c9 sink getOrCreateSection down into all the object file implementations,
now that they create *all* the sections.

llvm-svn: 78494
2009-08-08 20:14:13 +00:00
Eric Christopher e7064fdc9d Fix some cut and paste-os.
llvm-svn: 78493
2009-08-08 20:09:33 +00:00
Chris Lattner 00e2e74fb2 add a little function to do arbitrary string pattern matching in a
much more efficient way than a sequence of if's.  Switch MatchRegisterName
to use it.  It would be nice if someone could factor this out to a shared
place in tblgen :)

llvm-svn: 78492
2009-08-08 20:02:57 +00:00
Chris Lattner 16cf1967f5 add another const
llvm-svn: 78487
2009-08-08 19:16:05 +00:00
Chris Lattner 099003bc19 remove a useless anon-ns, make table const.
llvm-svn: 78486
2009-08-08 19:15:25 +00:00
Daniel Dunbar 2f140834cf Some ProfileInfo cleanups.
- Part of optimal static profiling patch sequence by Andreas Neustifter.

llvm-svn: 78485
2009-08-08 18:59:03 +00:00
Daniel Dunbar 003a1b1c1d Add a basic static ProfileInfo provider (ProfileEstimatorPass).
- Part of optimal static profiling patch sequence by Andreas Neustifter.

llvm-svn: 78484
2009-08-08 18:44:18 +00:00
Eric Christopher 31cceaeb68 Define intrinsics for crc instruction.
llvm-svn: 78482
2009-08-08 18:07:59 +00:00
Bruno Cardoso Lopes f6448f57e6 Use reloc_absolute_word_sext relocation for X86::MOV64(ri/mi)32 instructions,
since they are in 64 bit mode with i64immSExt32 imms. JIT is not affected since 
it handles both word absolute relocations in the same way

llvm-svn: 78479
2009-08-08 17:47:41 +00:00
Daniel Dunbar 3b5008e23a More ProfileInfo improvements.
- Part of optimal static profiling patch sequence by Andreas Neustifter.

 - Store edge, block, and function information separately for each functions
   (instead of in one giant map).

 - Return frequencies as double instead of int, and use a sentinel value for
   missing information.

llvm-svn: 78477
2009-08-08 17:43:09 +00:00
Bruno Cardoso Lopes 72dd2eef36 ELF improvements:
Handle large integers, x86_fp80, ConstantAggregateZero, and two more ConstantExpr:
GetElementPtr and IntToPtr
Set SHF_MERGE bit for mergeable strings
Avoid zero initialized strings to be classified as a bss symbol
Don't allow common symbols to be classified as STB_WEAK
Add a constant to be used as a global value offset in data relocations 

llvm-svn: 78476
2009-08-08 17:29:04 +00:00
Daniel Dunbar 028f6dc4c2 Update CMake
llvm-svn: 78475
2009-08-08 17:03:13 +00:00
Jakob Stoklund Olesen dcf009ca20 Clean out per-function data after the machine code verifier is done with it.
Also don't dereference old pointers after they have been deleted causing
random crashes when enabling the machine code verifier.

Ahem...

I have not included a test case for the crash. It hapened when enabling the
verifier on CodeGen/X86/2009-08-06-branchfolder-crash.ll.

The crash depends on an MBB being allocated at the same address as a
previously deleted MBB. I don't think that can be reproduced reliably.

llvm-svn: 78472
2009-08-08 15:34:50 +00:00
Anton Korobeynikov 7167f33872 Add insert_elt / extract_elt patterns for v4f32 stuff.
Did anyone tests v4f32 ever?

llvm-svn: 78470
2009-08-08 14:06:07 +00:00
Anton Korobeynikov 4218516f5d Lane number should be printed w/o hash
llvm-svn: 78469
2009-08-08 14:05:53 +00:00
Anton Korobeynikov 887d05ce9b Use VLDM / VSTM to spill/reload 128-bit Neon registers
llvm-svn: 78468
2009-08-08 13:35:48 +00:00
Jakob Stoklund Olesen 2d59cfff24 Update the machine code verifier to keep up with the scavenger.
* Cleaner handling of <undef>.
* <def> takes precedence over <def,dead>.
* Implement the OK-to-redefine-a-register-that-was-
  live-in-but-has-not-been-used-before rule.

llvm-svn: 78467
2009-08-08 13:19:25 +00:00
Jakob Stoklund Olesen 8e96c6abf7 Remove RegisterScavenger::isSuperRegUsed(). This completely reverses the mistaken commit r77904.
Now there is no special treatment of instructions that redefine part of a
super-register. Instead, the super-register is marked with <imp-use,kill> and
<imp-def>. For instance, from LowerSubregs on ARM:

subreg: CONVERTING: %Q1<def> = INSERT_SUBREG %Q1<undef>, %D1<kill>, 5
subreg: %D2<def> = FCPYD %D1<kill>, 14, %reg0, %Q1<imp-def>

subreg: CONVERTING: %Q1<def> = INSERT_SUBREG %Q1, %D0<kill>, 6
subreg: %D3<def> = FCPYD %D0<kill>, 14, %reg0, %Q1<imp-use,kill>, %Q1<imp-def>
llvm-svn: 78466
2009-08-08 13:19:10 +00:00
Jakob Stoklund Olesen ac51533b8a Simplify RegScavenger::forward a bit more.
Verify that early clobber registers and their aliases are not used.

All changes to RegsAvailable are now done as a transaction so the order of
operands makes no difference.

The included test case is from PR4686. It has behaviour that was dependent on the order of operands.

llvm-svn: 78465
2009-08-08 13:18:47 +00:00
Andrew Lenharth e372826523 move this fp select into a pattern
llvm-svn: 78464
2009-08-08 12:49:07 +00:00
Benjamin Kramer 7641cf8e4d Always initialize AsmConds.
llvm-svn: 78463
2009-08-08 11:26:50 +00:00
Benjamin Kramer 611307108c MSVC doesn't like member variables with the same name as the class.
llvm-svn: 78462
2009-08-08 10:06:30 +00:00
Daniel Dunbar 541efcc5c4 llvm-mc/AsmMatcher: Improve match code.
- This doesn't actually improve the algorithm (its still linear), but the
   generated (match) code is now fairly compact and table driven. Still need a
   generic string matcher.

 - The table still needs to be compressed, this is quite simple to do and should
   shrink it to under 16k.

 - This also simplifies and restructures the code to make the match classes more
   explicit, in anticipation of resolving ambiguities.

llvm-svn: 78461
2009-08-08 07:50:56 +00:00
Bob Wilson e2231070ff Implement Neon VZIP and VUZP instructions. These are very similar to VTRN,
so I generalized the class for VTRN in the .td file to handle all 3 of them.

llvm-svn: 78460
2009-08-08 06:13:25 +00:00
Bob Wilson db46af0461 Implement Neon VTRN instructions. For now, anyway, these are selected
directly from the intrinsics produced by the frontend.  If it is more
convenient to have a custom DAG node for using these to implement shuffles,
we can add that later.

llvm-svn: 78459
2009-08-08 05:53:00 +00:00
Daniel Dunbar 713302883e llvm-mc/AsmMatcher: Switch to a unified function to convert operands to MCInst,
so that terminal states are as simple as possible.
 - If we were willing to assume that the order that operands get inserted in the
   MCInst is fixed we could actually dispose with this altogether, although it
   might be nice to have the flexibility to change it later.

llvm-svn: 78458
2009-08-08 05:24:34 +00:00
Evan Cheng 1be453b462 Add a skeleton Thumb2 instruction size reduction pass.
llvm-svn: 78456
2009-08-08 03:21:23 +00:00
Evan Cheng 2aa91cc2be Code refactoring. No functionality change.
llvm-svn: 78455
2009-08-08 03:20:32 +00:00
Evan Cheng 274fcbe43e tADDhirr should target GPR, not tGPR.
llvm-svn: 78454
2009-08-08 03:19:44 +00:00
Evan Cheng 4dc201eb64 I can type.
llvm-svn: 78453
2009-08-08 02:54:37 +00:00
Chris Lattner b94284b5e2 make printInstruction return void since its result is omitted. Make the
error condition get trapped with an assert.

llvm-svn: 78449
2009-08-08 01:32:19 +00:00
Daniel Dunbar 4bfb4c80e0 Fix some -Asserts unused variable warnings.
llvm-svn: 78447
2009-08-08 00:40:46 +00:00
Andreas Bolka 3becda83ef Add another Strong-SIV testcase.
llvm-svn: 78446
2009-08-08 00:21:49 +00:00
Chris Lattner b1692dc267 don't check the result of printInstruction anymore.
llvm-svn: 78444
2009-08-08 00:05:42 +00:00
Anton Korobeynikov 674ffc1e59 Do not generate 32-bit call on win64 when imm does not fit
llvm-svn: 78443
2009-08-07 23:59:21 +00:00
Chris Lattner 6eceb7c85d rename test
llvm-svn: 78441
2009-08-07 23:57:30 +00:00
Chris Lattner ff8d04e815 merge a bunch of tests together into one, convert to filecheck which
is more tolerant of whitespace differences.

llvm-svn: 78439
2009-08-07 23:56:42 +00:00
Bob Wilson 40ff4a190f Add new intrinsics for Neon VTRN, VZIP and VUZP operations. Modeling these
as vector shuffles did not work out well.  Shuffles that produce double-wide
vectors accurately represent the operation but make it hard to do anything
with the results.  I considered splitting them up into 2 shuffles, one to
write each register separately, but there doesn't seem to be a good way to
reunite them for codegen.

llvm-svn: 78437
2009-08-07 23:53:05 +00:00
Daniel Dunbar 11595b20fc Add DEBUG_WITH_TYPE as a clean alternative to tweaking DEBUG_TYPE.
This:
--
#undef DEBUG_TYPE
#define DEBUG_TYPE "foo"
DEBUG(...)
#undef DEBUG_TYPE
#define DEBUG_TYPE ""
--
becomes this:
--
DEBUG_WITH_TYPE("foo", ...)
--

llvm-svn: 78435
2009-08-07 23:48:59 +00:00
Bob Wilson 97262e01d5 Convert more Neon tests to use FileCheck.
llvm-svn: 78433
2009-08-07 23:45:02 +00:00
Chris Lattner 84b9db2926 code cleanup
llvm-svn: 78432
2009-08-07 23:42:01 +00:00
Benjamin Kramer dd71ebbab0 Unbreak build.
llvm-svn: 78431
2009-08-07 23:37:47 +00:00
David Goodwin 742db6a6d4 Make NEON single-precision FP support the default for cortex-a8 (again).
llvm-svn: 78430
2009-08-07 23:32:33 +00:00
Chris Lattner e35472e3a9 remove a bunch of now-dead crud from the asmprinter and TAI interfaces.
llvm-svn: 78428
2009-08-07 23:16:27 +00:00
Chris Lattner 2d423d5a95 fix the column output stuff in the asmwriter from being dynamic and
driven by TAI to being static, driven by tblgen.  This means that a
target doesn't get impacted by this stuff at all if it doesn't opt
into it.

llvm-svn: 78427
2009-08-07 23:13:38 +00:00
Andreas Bolka 7a5c8db6b5 Fix copy-pasto.
llvm-svn: 78426
2009-08-07 22:55:26 +00:00
Anton Korobeynikov d28a26dfab Unbreak the stuff
llvm-svn: 78425
2009-08-07 22:51:13 +00:00
Argyrios Kyrtzidis 885e6382eb Modifications to dyn_cast/cast to make them work for objects too, instead of only pointers.
The use case is if you have a wrapper class:

class Base {
  void *Ptr;
public:
  Base() : Ptr(0) { }
  operator bool() const { return Ptr; }
.....
}

and sub-wrappers that have exactly the same size:

class Sub : public Base {
public:
....
static bool classof(const Base*);
}

and in the code you would do:

void f(Base b) {
  Sub sub = dyn_cast<Sub>(b);
  if (sub) {
    ....
  }
}

llvm-svn: 78424
2009-08-07 22:49:24 +00:00
Kevin Enderby d9f952948e Added Mac OS X assembler style conditional assembly. I may come back and see if
I can clean this up a bit more and do way with the TheCondState and just use
the top element on the TheCondStack if not empty.  Also may tweak the code
around ParseConditionalAssemblyDirectives() to simplify the AsmParser code.

llvm-svn: 78423
2009-08-07 22:46:00 +00:00
Chris Lattner 02bec55199 fix comment pastos
llvm-svn: 78422
2009-08-07 22:44:56 +00:00
Evan Cheng 8611e90668 Back out some of recent register scavenger change by John Mosby. It broke a number of ARM tests.
llvm-svn: 78421
2009-08-07 22:39:43 +00:00
Andrew Lenharth a190c169bf avoid this libcall with long inline expansion
llvm-svn: 78420
2009-08-07 22:37:20 +00:00
Anton Korobeynikov 23b28cb824 2 more vdup.32 cases
llvm-svn: 78419
2009-08-07 22:36:50 +00:00
Evan Cheng fb93be2b6f A big oops. Thumb1 default CC is a def of CPSR, not a use of CPSR.
llvm-svn: 78418
2009-08-07 22:36:37 +00:00
Chris Lattner 83eb9b0b01 strength reduce anonymous namespace to static.
llvm-svn: 78417
2009-08-07 22:27:19 +00:00
Chris Lattner 5333a7b8c5 tidy up
llvm-svn: 78416
2009-08-07 22:26:50 +00:00
Bill Wendling fe3bdb4b6f Reformatting of lines. Put multiple DEBUG statements under one DEBUG statement.
llvm-svn: 78411
2009-08-07 21:33:25 +00:00
Evan Cheng 6e130db3b7 Thumb2 32-bit ldm / stm needs .w suffix if submode is ia.
llvm-svn: 78410
2009-08-07 21:19:10 +00:00
Daniel Dunbar d0470d74df llvm-mc/AsmMatcher: Move emit for register -> enum matcher into a separate routine.
llvm-svn: 78408
2009-08-07 21:01:44 +00:00
Daniel Dunbar bfdd58e103 XFAIL 2006-11-06-StackTrace.cpp on powerpc-apple-darwin9 until someone feels
motivated to fix it.

llvm-svn: 78406
2009-08-07 20:50:58 +00:00
Daniel Dunbar 86ec7bae4f MSVC warning fixes; patch by Stein Roger!
llvm-svn: 78405
2009-08-07 20:50:09 +00:00
Daniel Dunbar 15b8037034 llvm-mc/AsmMatcher: Tweaks in response to feedback.
llvm-svn: 78404
2009-08-07 20:33:39 +00:00
Jeffrey Yasskin 6bf87df579 To catch bugs like the one fixed in
http://llvm.org/viewvc/llvm-project?view=rev&revision=78127, I'm changing the
ExecutionEngine's global mappings to hold AssertingVH<const GlobalValue>. That
way, if unregistering a mapping fails to actually unregister it, we'll get an
assert. Running the jit nightly tests didn't uncover any actual instances of
the problem.

This also uncovered the fact that AssertingVH<const X> didn't work, so I fixed
that too.

llvm-svn: 78400
2009-08-07 19:54:29 +00:00
Evan Cheng b64ec07ea6 This is done.
llvm-svn: 78399
2009-08-07 19:34:52 +00:00
Evan Cheng f0237b1aa6 Use 16-bit tMOVgpr2gpr instead of tMOVr to copy GPR registers in Thumb2 mode.
llvm-svn: 78398
2009-08-07 19:34:35 +00:00
Evan Cheng 4c3b1ca5a0 Fix support to use NEON for single precision fp math.
llvm-svn: 78397
2009-08-07 19:30:41 +00:00
Andreas Bolka 2f7562c83e SIV/MIV classification for LDA.
LoopDependenceAnalysis::getLoops is currently O(N*M) for a loop-nest of
depth N and a compound SCEV of M atomic SCEVs. As both N and M will
typically be very small, this should not be a problem. If it turns out
to be one, rewriting getLoops as SCEVVisitor will reduce complexity to
O(M).

llvm-svn: 78394
2009-08-07 18:23:41 +00:00
Dale Johannesen fe95ac0d35 Rewrite previous patch to follow Chris' stylistic
preference; no functional change.

llvm-svn: 78391
2009-08-07 17:41:29 +00:00
Devang Patel b1106fbdbc Fix dom frontier update. This fixes PR4667.
Patch by Jakub Staszak.

llvm-svn: 78388
2009-08-07 17:16:44 +00:00
Andreas Bolka 787591a594 Fix Strong-SIV testcase.
llvm-svn: 78384
2009-08-07 15:42:32 +00:00
Sanjiv Gupta 54c847cd6c Minor fixes to avoid using invalid debugloc.
llvm-svn: 78383
2009-08-07 11:00:02 +00:00
Benjamin Kramer 24ee4d0aa4 Simplify code and avoid allocations.
llvm-svn: 78382
2009-08-07 10:42:28 +00:00
Daniel Dunbar cf18d6befb Improve disabling of X86 AsmMatcher.
llvm-svn: 78381
2009-08-07 09:06:38 +00:00
Daniel Dunbar 32d0bb4c4e Disable X86 AsmMatcher for now, it is causing gcc-4.0 to run out of memory on
i386-apple-darwin9. This presumably will get fixed once the generated code
improves.

llvm-svn: 78379
2009-08-07 08:45:03 +00:00
Daniel Dunbar e10787e710 llvm-mc/AsmMatcher: Move to a slightly more sane matching design.
- Still not very sane, but a least its not 60k lines on X86. :)

 - In terms of correctness, currently some things are hard wired for X86, and we
   still don't properly resolve ambiguities (this is ignoring the instructions
   we don't even match due to funny .td stuff or other corner cases).

The high level changes:
 1. Represent tokens which are significant for matching explicitly as separate
    operands. This uniformly handles not only the instruction mnemonic, but
    also 'signficiant' syntax like the '*' in "call * ...".

 2. Separate the matching of operands to an instruction from the construction of
    the MCInst. In theory this can be done during matching, but since the number
    of variations is small I think it makes sense to decompose the problems.

 3. Improved a few of the mechanisms to at least successfully flatten / tokenize
    the assembly strings for PowerPC and ARM.

 4. The comment at the top of AsmMatcherEmitter.cpp explains the approach I'm
    moving towards for handling ambiguous instructions. The high-bit is to infer
    a partial ordering of the operand classes (and force the user to specify one
    if we can't) and use that to resolve ambiguities.

llvm-svn: 78378
2009-08-07 08:26:05 +00:00
Evan Cheng 82ff022ed2 Error out, rather than infinite looping, if constant island pass can't converge.
llvm-svn: 78377
2009-08-07 07:35:21 +00:00
Evan Cheng b1aeeed03e Another coalescer bug. When a dead copy is eliminated, transfer the kill to a def of the exact register rather than a super-register.
llvm-svn: 78376
2009-08-07 07:14:14 +00:00
Evan Cheng 317bd7aab2 tBfar is bl, which clobbers LR.
llvm-svn: 78370
2009-08-07 05:45:07 +00:00
Sanjiv Gupta 003dc1fa5b Run memsel inserter just before emit assembly to avoid tinkering by other passes.
llvm-svn: 78369
2009-08-07 05:44:27 +00:00
Daniel Dunbar 9a4ae0e9e6 Update CMake.
llvm-svn: 78367
2009-08-07 03:59:06 +00:00
Daniel Dunbar 6310426a55 Remove unused function.
llvm-svn: 78366
2009-08-07 03:52:07 +00:00
Andrew Lenharth a3a3453acf These should be expanded
llvm-svn: 78365
2009-08-07 02:17:44 +00:00
Dan Gohman 864ed09b0e Use std::string() instead of std::string("").
llvm-svn: 78364
2009-08-07 01:43:45 +00:00
Dan Gohman a6d0afcb74 Fix a bunch of namespace pollution.
llvm-svn: 78363
2009-08-07 01:32:21 +00:00
Dan Gohman 6c0c21954c Fix a typo in a comment.
llvm-svn: 78362
2009-08-07 01:26:06 +00:00
Evan Cheng b972e5633f It turns out most of the thumb2 instructions are not allowed to touch SP. The semantics of such instructions are unpredictable. We have just been lucky that tests have been passing.
This patch takes pain to ensure all the PEI lowering code does the right thing when lowering frame indices, insert code to manipulate stack pointers, etc. It's also custom lowering dynamic stack alloc into pseudo instructions so we can insert the right instructions at scheduling time.

This fixes PR4659 and PR4682.

llvm-svn: 78361
2009-08-07 00:34:42 +00:00
Evan Cheng 10af5d621c Code clean up.
llvm-svn: 78360
2009-08-07 00:28:58 +00:00
Lang Hames 8f0d67536e Added legal stuff, fixed some formatting issues. Removed the graph generator stuff as it was only meant for debugging the solver.
llvm-svn: 78359
2009-08-07 00:25:12 +00:00
Dale Johannesen 3a127ce1d8 Add the testcase from PR 4668. This works at the
moment, but it's a fragile area.

llvm-svn: 78358
2009-08-07 00:04:42 +00:00
Lang Hames 88fae6f9c9 New C++ PBQP solver. Currently about as fast (read _slow_) as the old C based solver, but I'll be working to improve that. The PBQP allocator has been updated to use the new solver.
llvm-svn: 78354
2009-08-06 23:32:48 +00:00
Dale Johannesen 15a5fad94b Fix PR 4626, a crash in branch folding after OptimizeBlock
produced a CFG it wasn't prepared for.

llvm-svn: 78351
2009-08-06 22:56:40 +00:00
Dale Johannesen 352fa92995 Use stripPointerCasts instead of partially rewriting it.
llvm-svn: 78350
2009-08-06 22:45:51 +00:00
Jakob Stoklund Olesen 8166ca3bdc Vanity.
llvm-svn: 78345
2009-08-06 21:54:23 +00:00
Nicolas Geoffray edfdd07a79 Output the new StructType constructor, which takes the context of the
module as first argument.

llvm-svn: 78340
2009-08-06 21:31:35 +00:00
Jakob Stoklund Olesen 1e455c0f3b Get rid of RegScavenger::backwards() before the bitrot spreads.
If we need it one day, there is nothing wrong with putting it back in.

llvm-svn: 78337
2009-08-06 21:19:03 +00:00
Devang Patel c0422b7b5a Remove dead code.
llvm-svn: 78335
2009-08-06 20:57:44 +00:00
Devang Patel cd4688905f Use DebugInfoFinder
llvm-svn: 78334
2009-08-06 20:53:24 +00:00
Devang Patel ae5ead6df4 Use DebugInfoFinder.
llvm-svn: 78333
2009-08-06 20:53:06 +00:00
Bob Wilson 0127031c20 Implement Neon VST[234] operations.
llvm-svn: 78330
2009-08-06 18:47:44 +00:00
Bob Wilson e3ec5b6d76 Fix incorrect intrinsic declarations.
llvm-svn: 78329
2009-08-06 18:46:26 +00:00
Dale Johannesen 8d7f6f83fd Testcase for llvm-gcc 78324 (although in normal
testing mode it won't test much).

llvm-svn: 78325
2009-08-06 17:28:23 +00:00
Dan Gohman b4764e5b7f Tidy up this testcase.
llvm-svn: 78322
2009-08-06 17:11:55 +00:00
David Goodwin b062c236c5 Add parameter to pattern classes to enable an itinerary to be specified for instructions. For now just use the existing itineraries or NoItinerary.
llvm-svn: 78321
2009-08-06 16:52:47 +00:00
Chris Lattner 1ff90134a4 Fix several fixmes and clean up code by sinking *all* section
creation activity into the target-specific subclasses of TLOF.
Before this, globals with explicit sections could be created by
the base class.

1. make getOrCreateSection protected, add a new getExplicitSectionGlobal
   pure virtual method to assign sections to globals with a specified
   section.
2. eliminate getSpecialCasedSectionGlobals, which is now PIC specific.
3. eliminate the getKindForNamedSection virtual method, which is
   now just a static method for ELF.
4. Add implementions of getExplicitSectionGlobal for ELF/PECOFF/Darwin/PIC16.
   They are now all detangled and understandable, woo! :)

llvm-svn: 78319
2009-08-06 16:39:58 +00:00
John Mosby beb7ea2931 Reg Scavenging generalization (Thumb support):
- start support for new PEI w/reg alloc, allow running RS from emit{Pro,Epi}logue() target hooks.
- fix minor issue with recursion detection.

llvm-svn: 78318
2009-08-06 16:32:47 +00:00
Chris Lattner b29996eb23 go through PIC16TargetObjectFile to make sections instead of
creating them directly in the pic16 asmprinter.

llvm-svn: 78317
2009-08-06 16:27:28 +00:00
Chris Lattner a7e2662770 reduce testcase.
llvm-svn: 78315
2009-08-06 16:14:33 +00:00
Devang Patel 9ef866f95f Fix comment.
llvm-svn: 78313
2009-08-06 15:39:34 +00:00
Dan Gohman 695d811ad5 Add assertion checks after the calls to LowerFormalArguments, LowerCall,
and LowerReturn, to verify that the targets' hooks have respected some
of their postconditions.

llvm-svn: 78312
2009-08-06 15:37:27 +00:00
Dan Gohman ee902509a8 Remove an over-aggressive assert. Functions with empty struct return
types don't have any return values, from CodeGen's perspective.
This fixes PR4688.

llvm-svn: 78311
2009-08-06 15:07:58 +00:00
Anton Korobeynikov d4f00616cf Add note about msys perl needed for windows/mingw32 builds.
Patch by John Thompson!

llvm-svn: 78304
2009-08-06 12:54:58 +00:00
Anton Korobeynikov 644caa0cdb Add tests for X86-64 code model handling. Small and kernel for now.
llvm-svn: 78300
2009-08-06 12:25:20 +00:00
Anton Korobeynikov d0439d0638 We need to sext global addresses in kernel code model, not zext
llvm-svn: 78299
2009-08-06 11:23:24 +00:00
Dan Gohman 130e2c7aed Fix a bug in x86's PreprocessForRMW logic that was exposed
by aggressive chain operand optimization. UpdateNodeOperands
does not modify the node in place if it would result in
a node identical to an existing node.

llvm-svn: 78297
2009-08-06 09:22:57 +00:00
Dan Gohman 5758e1e92a Fix a few places in DAGCombiner that were creating all-ones-bits
and high-bits values in ways that weren't correct for integer
types wider than 64 bits. This fixes a miscompile in
PPMacroExpansion.cpp in clang on x86-64.

llvm-svn: 78295
2009-08-06 09:18:59 +00:00
Anton Korobeynikov 82db9891fa Missed part of recent kernel codemodel tweaks
llvm-svn: 78293
2009-08-06 09:11:19 +00:00
Chris Lattner 5ccb3af0aa add a testcase for my llvm-gcc hack.
llvm-svn: 78289
2009-08-06 06:18:52 +00:00
Daniel Dunbar 84f399103b Don't search the entire type table just to delete a type by name.
- This also fixes the ENABLE_EXPENSIVE_CHECKS failure on vmcore.ml.

llvm-svn: 78287
2009-08-06 06:04:35 +00:00
Sanjiv Gupta bdaaacad9a llvm-ld has a new option called -b to specify the name of bitcode output file, use that.
llvm-svn: 78282
2009-08-06 04:09:26 +00:00
Chris Lattner 87754848ab this passes.
llvm-svn: 78281
2009-08-06 03:55:49 +00:00
Andreas Bolka 3c7b95d9aa Simplify the ZIV tester to the max.
As suggested by Nick Lewycky.

llvm-svn: 78277
2009-08-06 03:10:33 +00:00
Sanjiv Gupta aee88e46c1 XFAIL it while it is being worked on.
llvm-svn: 78275
2009-08-06 02:19:20 +00:00
Bob Wilson 3389c2f7d0 Add tests for new NEON vld instructions.
llvm-svn: 78264
2009-08-06 00:38:31 +00:00
Bob Wilson 488db94e7b Neon does not actually have VLD{234}.64 instructions.
These operations will have to be synthesized from other instructions.

llvm-svn: 78263
2009-08-06 00:24:27 +00:00
Bob Wilson dd611f44cb Convert more Neon tests to FileCheck.
llvm-svn: 78261
2009-08-05 23:51:20 +00:00
Owen Anderson ad3f916596 Update unit test.
llvm-svn: 78260
2009-08-05 23:28:57 +00:00
Owen Anderson 03cb69fbd1 Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
llvm-svn: 78258
2009-08-05 23:16:16 +00:00
Bob Wilson e148ceaf65 Add a new pre-allocation pass to assign adjacent registers for Neon instructions
that have that constraint.  This is currently just assigning a fixed set of
registers, and it only handles VLDn for n=2,3,4 with DPR registers.
I'm going to expand it to handle more operations next; we can make it smarter
once everything is working correctly.

llvm-svn: 78256
2009-08-05 23:12:45 +00:00
Anton Korobeynikov 741ea0d7fd Better handle kernel code model. Also, generalize the things and fix one
subtle bug with small code model.

llvm-svn: 78255
2009-08-05 23:01:26 +00:00
Dale Johannesen dc3416b7b3 Adjust test for llvm-gcc checkin 78249.
llvm-svn: 78251
2009-08-05 22:18:47 +00:00
Dan Gohman 77f33b71c7 Use GR32 for copies between GR32_NOSP and GR32_NOREX, as neither
is a subset of the other, but both are subsets of GR32.

llvm-svn: 78250
2009-08-05 22:18:26 +00:00
Daniel Dunbar 4f6f6d080f Make block and function count available via ProfileInfo.
- Part of optimal static profiling patch sequence by Andreas Neustifter.

llvm-svn: 78247
2009-08-05 21:51:16 +00:00
Daniel Dunbar 1efb6b0391 Suppress compiler warning.
llvm-svn: 78246
2009-08-05 21:42:40 +00:00
Dan Gohman 198f5e84c6 Use (void *)(intptr_t) to cast function addresses to void*
for use with sys::Path::GetMainExecutable, to avoid warnings
with -pedantic.

llvm-svn: 78245
2009-08-05 21:03:39 +00:00
David Goodwin e5b5d8fbb3 When using NEON for single-precision FP, the NEON result must be placed in D0-D15 as these are the only D registers with S subregs. Introduce a new regclass to represent D0-D15 and use it in the NEON single-precision FP patterns.
llvm-svn: 78244
2009-08-05 21:02:22 +00:00
David Greene fdd2519eb5 Fix some column padding bugs, reorganize things as suggested by Chris
and eliminate complexity.  Yay!

llvm-svn: 78243
2009-08-05 21:00:52 +00:00
Chris Lattner 39fb546b9e remove the 'DataSectionStartSuffix' and 'TextSectionStartSuffix' knobs.
llvm-svn: 78242
2009-08-05 20:49:52 +00:00
Dan Gohman 46ffffa750 Fix FindExecutable to use sys::Path::GetMainExecutable instead of
just argv[0]. And remove the code for searching the current
working directory and for searching PATH; the point of FindExecutable
is not to find whatever version of the executable can be found by
searching around, but to find an executable that accompanies the
current executable.

Update the tools to use sys::Program::FindProgramByName when they
want PATH searching.

llvm-svn: 78240
2009-08-05 20:21:17 +00:00
Dan Gohman 798ae47b59 Minor code simplification.
llvm-svn: 78239
2009-08-05 20:16:55 +00:00
Anton Korobeynikov ef98dbe3de Remove redundand checks: the only way to have, e.g. f32 RegVT is exactly
hardfloat case.

llvm-svn: 78237
2009-08-05 20:15:19 +00:00
Dan Gohman 87cc2c2dce hasSuperClass tests for a strict superset relation, rather than
a superset relation. This code wants to test the regular superset
relation.

llvm-svn: 78236
2009-08-05 20:13:45 +00:00
Anton Korobeynikov ef42862ef5 Unbreak the stuff, this is ugly, but we cannot do better for now with 'plain' C calling conv.
llvm-svn: 78232
2009-08-05 19:40:16 +00:00
Dale Johannesen 1de1897bf0 Test for llvm-gcc checkin 78223.
llvm-svn: 78229
2009-08-05 19:10:41 +00:00
Anton Korobeynikov 22ef75155e Missed pieces for ARM HardFP ABI.
Patch by Sandeep Patel!

llvm-svn: 78225
2009-08-05 19:04:42 +00:00
Owen Anderson 4b5c761af2 Privatize the FunctionType table.
llvm-svn: 78221
2009-08-05 18:13:27 +00:00
Andrew Lenharth 13937d8236 Use elf Object File directly
llvm-svn: 78220
2009-08-05 18:13:04 +00:00
Daniel Dunbar 4cc1feff4f Remove some dead code.
llvm-svn: 78219
2009-08-05 18:12:37 +00:00
Dan Gohman df7ea32af7 Enable the new no-SP register classes by default. This is to address
PR4572. A few tests have some minor code regressions due to different
coalescing.

llvm-svn: 78217
2009-08-05 17:40:24 +00:00
Bob Wilson 9ede773c4e Remove a redundant declaration.
llvm-svn: 78216
2009-08-05 17:39:44 +00:00
Dan Gohman 4cf97dddea Update a comment to reflect the current code.
llvm-svn: 78215
2009-08-05 17:32:39 +00:00
Anton Korobeynikov f6e25b3039 Add testcases for reg-mem arithemtics added recently
llvm-svn: 78214
2009-08-05 17:04:32 +00:00
Anton Korobeynikov be47ccffef Convert bswap test to filecheck, add more test entries & convert stuff to filecheck
llvm-svn: 78212
2009-08-05 16:50:53 +00:00
Dan Gohman 477fd55c9a Fix a bug in the PIC16 backend.
llvm-svn: 78211
2009-08-05 16:46:43 +00:00
David Goodwin 21788bef7c Disable NEON single-precision FP support for Cortex-A8, for now...
llvm-svn: 78209
2009-08-05 16:40:57 +00:00
Dan Gohman 12b7b1cd83 Add an explicit keyword.
llvm-svn: 78208
2009-08-05 16:40:32 +00:00
Devang Patel 44c4417812 Remove dead code. MDNode and MDString are not Constant anymore.
llvm-svn: 78207
2009-08-05 16:40:02 +00:00
Dan Gohman cd8287549d Delete an obsolete sentance from a comment.
llvm-svn: 78206
2009-08-05 16:39:42 +00:00
Dan Gohman a97540f396 Add new function attribute keywords to the vim syntax.
llvm-svn: 78205
2009-08-05 16:38:48 +00:00
Dan Gohman 2bebfc38af Change these tests to use function attributes rather than special llc
command-line options.

llvm-svn: 78204
2009-08-05 16:37:27 +00:00
Anton Korobeynikov 2e627cb37f Add memory versions of some instructions.
Patch by Neale Ferguson!

llvm-svn: 78203
2009-08-05 16:16:11 +00:00
Benjamin Kramer d06eaca66f Rename a variable to make MSVC happy.
llvm-svn: 78202
2009-08-05 16:08:58 +00:00
Chris Lattner abde7f9d27 checking in broken testcases is not such a good idea.
llvm-svn: 78201
2009-08-05 16:04:18 +00:00
David Goodwin a307edbdd5 By default, for cortex-a8 use NEON for single-precision FP.
llvm-svn: 78200
2009-08-05 16:01:19 +00:00
Daniel Dunbar b6fec38426 Remove unnecessary ProfileInfoLoader methods.
- Part of optimal static profiling patch sequence by Andreas Neustifter.

llvm-svn: 78199
2009-08-05 15:55:56 +00:00
Sanjiv Gupta 63c5ede173 Quite a few tests crashed in llc after 78142. This is just one of them. I hope to add a few more.
llvm-svn: 78198
2009-08-05 15:52:14 +00:00
Daniel Dunbar 6e1fb1e06a Add StringRef::endswith
llvm-svn: 78197
2009-08-05 15:48:26 +00:00
Benjamin Kramer eaccdd34a3 Documentation: fix HTML validation errors.
llvm-svn: 78196
2009-08-05 15:42:44 +00:00
Andrew Lenharth 7d6a183eb8 only point to dest labels if the graph has them
llvm-svn: 78192
2009-08-05 15:04:22 +00:00
Anton Korobeynikov cb781cfe81 Special constants as destinations does not work as expected - drop the patterns.
llvm-svn: 78191
2009-08-05 14:42:00 +00:00
Andrew Lenharth ba3a342c89 Alpha: Get section directives right
llvm-svn: 78189
2009-08-05 13:59:57 +00:00
Benjamin Kramer 9b8364da0e Remove unused forward decls.
llvm-svn: 78187
2009-08-05 11:33:27 +00:00
Anton Korobeynikov 1bb812e86b Add executable suffix for the tool. This is needed e.g. for 'make install' on mingw32.
llvm-svn: 78185
2009-08-05 09:37:43 +00:00
Anton Korobeynikov 0c3f8d5f53 Pass user only if it's non-empty. Patch by Sandeep.
llvm-svn: 78184
2009-08-05 09:32:53 +00:00
Anton Korobeynikov 7cbff91e62 Add save-temps option to bugpoint to keep temporary stuff.
Patch by Sandeep Patel

llvm-svn: 78183
2009-08-05 09:32:10 +00:00
Anton Korobeynikov de8b1b2e7d Cleanup in dbg_stoppoint handling in CBE. Patch by Sandeep Patel.
llvm-svn: 78182
2009-08-05 09:31:40 +00:00
Anton Korobeynikov 68d8634871 Minor arm CBE fixes. Patch by Sandeep.
llvm-svn: 78181
2009-08-05 09:31:07 +00:00
Anton Korobeynikov fe4ce2ae7a Emit module-level inline asm for CBE.
Patch by Sandeep Patel

llvm-svn: 78180
2009-08-05 09:29:56 +00:00
Evan Cheng ea2b82b8fc Disable stack coloring with register for now. It's not able to set kill markers.
llvm-svn: 78179
2009-08-05 07:26:17 +00:00
Evan Cheng a2ce665f60 Another nasty coalescer bug (is there another kind):
After coalescing reg1027's def and kill are both at the same point:
 %reg1027,0.000000e+00 = [56,814:0)  0@70-(814)

bb5:
60   %reg1027<def> = t2MOVr %reg1027, 14, %reg0, %reg0
68   %reg1027<def> = t2LDRi12 %reg1027<kill>, 8, 14, %reg0
76   t2CMPzri %reg1038<kill,undef>, 0, 14, %reg0, %CPSR<imp-def>
84   %reg1027<def> = t2MOVr %reg1027, 14, %reg0, %reg0
96   t2Bcc mbb<bb5,0x2030910>, 1, %CPSR<kill>

Do not remove the kill marker on t2LDRi12.

llvm-svn: 78178
2009-08-05 07:05:41 +00:00
Bruno Cardoso Lopes 98fcfdbf9d Remove accidental commited comment
llvm-svn: 78177
2009-08-05 07:00:43 +00:00
Bruno Cardoso Lopes 2b1dc9a783 - Remove custom handling of jumptables by the elf writter (this was
a dirty hack and isn't need anymore since the last x86 code emitter patch)
- Add a target-dependent modifier to addend calculation
- Use R_X86_64_32S relocation for X86::reloc_absolute_word_sext
- Use getELFSectionFlags whenever possible
- fix getTextSection to use TLOF and emit the right text section 
- Handle global emission for static ctors, dtors and Type::PointerTyID
- Some minor fixes

llvm-svn: 78176
2009-08-05 06:57:03 +00:00
Evan Cheng e219be7346 80 col violations.
llvm-svn: 78175
2009-08-05 06:41:25 +00:00
Chris Lattner 0aff0b2b58 common globals may also not be marked constant.
llvm-svn: 78169
2009-08-05 05:41:44 +00:00
Dan Gohman e32c0fe584 Revert changes accidentally committed along with r78163.
llvm-svn: 78165
2009-08-05 05:38:13 +00:00
Dan Gohman 8c79569853 Teach X86FastISel how to handle CCValAssign::BCvt, which is used for
MMX arguments. This fixes PR4684.

llvm-svn: 78163
2009-08-05 05:33:42 +00:00
Chris Lattner d055488c72 Clarify common linkage and the requirements on it. Enforce
them in the verifier.

llvm-svn: 78160
2009-08-05 05:21:07 +00:00
Andreas Bolka 13b860992a ZIV tester for LDA.
llvm-svn: 78157
2009-08-05 04:26:05 +00:00
Chris Lattner cbc7b26542 expose SectionKindForGlobal to curious clients, named as
getKindForGlobal.

llvm-svn: 78156
2009-08-05 04:25:40 +00:00
Andreas Bolka d3a44b52c6 Restrict LDA to GEPs with the same pointer offset.
We can not simply apply ZIV testing to the pointer offsets, as this
would incorrectly return independence for e.g. (GEP x,0,i; GEP x,1,-i).

llvm-svn: 78155
2009-08-05 04:13:41 +00:00
Chris Lattner 3e5b272361 add a temporary hook to allow reuse of the asmprinter from the disassembler.
llvm-svn: 78154
2009-08-05 04:09:18 +00:00
Andreas Bolka 2979eb8f35 Fix LDA testcases.
llvm-svn: 78153
2009-08-05 04:03:29 +00:00
Evan Cheng 379429200e Turn some insert_subreg, extract_subreg, subreg_to_reg into implicit_defs.
llvm-svn: 78151
2009-08-05 03:53:14 +00:00
Bob Wilson 85f60cc5a8 Oops. I didn't mean to commit this piece yet.
llvm-svn: 78146
2009-08-05 02:47:13 +00:00
Evan Cheng 1f7b549c79 One more. Transfer kill of the larger register when lowering an EXTRACT_SUBREG.
llvm-svn: 78145
2009-08-05 02:25:11 +00:00
Evan Cheng 6376367356 One more place where subreg lowering forgot to transfer undefness.
llvm-svn: 78144
2009-08-05 01:57:22 +00:00
Dan Gohman f9bbcd1afd Major calling convention code refactoring.
Instead of awkwardly encoding calling-convention information with ISD::CALL,
ISD::FORMAL_ARGUMENTS, ISD::RET, and ISD::ARG_FLAGS nodes, TargetLowering
provides three virtual functions for targets to override:
LowerFormalArguments, LowerCall, and LowerRet, which replace the custom
lowering done on the special nodes. They provide the same information, but
in a more immediately usable format.

This also reworks much of the target-independent tail call logic. The
decision of whether or not to perform a tail call is now cleanly split
between target-independent portions, and the target dependent portion
in IsEligibleForTailCallOptimization.

This also synchronizes all in-tree targets, to help enable future
refactoring and feature work.

llvm-svn: 78142
2009-08-05 01:29:28 +00:00
Evan Cheng cdb125ce66 If the insert_subreg source is <undef>, insert an implicit_def instead of a copy.
llvm-svn: 78141
2009-08-05 01:29:24 +00:00
Dan Gohman 5d79a2c62c Various comment fixes.
llvm-svn: 78139
2009-08-05 01:19:01 +00:00
Dan Gohman cbf1e16ad9 Remove an unnecessary flush in the CppBackend's output.
llvm-svn: 78138
2009-08-05 01:06:38 +00:00
Dan Gohman c6b5e8a5c5 Don't flush the raw_ostream between each MachineFunction. These flush
calls were originally put in place because errs() at one time was
not unbuffered, and these print routines are commonly used with errs()
for debugging. However, errs() is now properly unbuffered, so the
flush calls are no longer needed. This significantly reduces the
number of write(2) calls for regular asm printing when there are many
small functions.

llvm-svn: 78137
2009-08-05 00:49:25 +00:00
Bob Wilson 20f79e321e Change DAG nodes for Neon VLD2/3/4 operations to return multiple results.
Get rid of yesterday's code to fix the register usage during isel.
Select the new DAG nodes to machine instructions.  The new pre-alloc pass
to choose adjacent registers for these results is not done, so the
results of this will generally not assemble yet.

llvm-svn: 78136
2009-08-05 00:49:09 +00:00
Dan Gohman 400cd1a87a cerr isn't buffered so it doesn't need to be flushed.
llvm-svn: 78135
2009-08-05 00:44:01 +00:00
Dan Gohman b880939834 lli doesn't need <iostream> anymore.
llvm-svn: 78133
2009-08-05 00:28:59 +00:00