Commit Graph

65314 Commits

Author SHA1 Message Date
Anders Carlsson b8be93fc92 Add support for global initializers.
llvm-svn: 78515
2009-08-08 23:24:23 +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
Anders Carlsson f40886acca Refactor some code and implement support for global destructors for static variables.
llvm-svn: 78507
2009-08-08 21:45:14 +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
Anders Carlsson 2c101b3cd1 Use CastExpr::CK_ArrayToPointerDecay and fix an assert.
llvm-svn: 78502
2009-08-08 21:04:35 +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
Anders Carlsson e139f868b7 Add tests.
llvm-svn: 78491
2009-08-08 19:43:14 +00:00
Anders Carlsson 28a5fa29f3 Take #pragma pack into account when laying out structs. Fixes rdar://problem/7095436.
llvm-svn: 78490
2009-08-08 19:38:24 +00:00
Fariborz Jahanian f6bda5d61e Refactoring of copy ctor ir-gen. No change in functionality.
llvm-svn: 78489
2009-08-08 19:31:03 +00:00
Ryan Flynn 2f08571e4d PR4700 - remove shift by 0 warning
llvm-svn: 78488
2009-08-08 19:18:23 +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
Anders Carlsson 68e0b68289 Introduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr now only represents __attribute__((packed)).
This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug.

llvm-svn: 78483
2009-08-08 18:23:56 +00:00
Eric Christopher 31cceaeb68 Define intrinsics for crc instruction.
llvm-svn: 78482
2009-08-08 18:07:59 +00:00
Anders Carlsson 453878bed4 Assert that the LLVM type has the same size as the RecordDecl size.
llvm-svn: 78481
2009-08-08 18:01:57 +00:00
Anders Carlsson 5fd7dad784 getFunctionLevelDeclContext needs to get the previous DeclContext if EnterDeclaratorContext has been called. Fixes PR4694. (Doug, please review)
llvm-svn: 78480
2009-08-08 17:48:49 +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
Anders Carlsson b26ab816a2 Factor some code to get the "function level" DeclContext out into a separate function.
llvm-svn: 78478
2009-08-08 17:45:02 +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
Anders Carlsson 21776b75ce Make sure to diagnose use of declarations in the case where we create an implicit CXXThisExpr.
llvm-svn: 78474
2009-08-08 16:55:18 +00:00
Daniel Dunbar d3a114fe2d Update test case; I don't really understand why packed enums changed this, but
the new havior is better so...

llvm-svn: 78473
2009-08-08 15:47:00 +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
Edward O'Callaghan c69169d175 Patch should implement packed enums - PR4098. Credit to Anders Johnsen.
llvm-svn: 78471
2009-08-08 14:36:57 +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