Commit Graph

30960 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
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 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
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
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
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
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
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
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
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