Commit Graph

7517 Commits

Author SHA1 Message Date
Dan Gohman 9d26c85bdc Fix a bug in the DAGCombiner's handling of multiple linked
MERGE_VALUES nodes. Replacing the result values with the
operands in one MERGE_VALUES node may cause another
MERGE_VALUES node be CSE'd with the first one, and bring
its uses along, so that the first one isn't dead, as this
code expects. Fix this by iterating until the node is
really dead. This fixes PR4699.

llvm-svn: 78619
2009-08-10 23:43:19 +00:00
Dan Gohman 733a64db57 Fix a bug where DAGCombine was producing an illegal ConstantFP
node after legalize, and remove the workaround code from the
ARM backend.

llvm-svn: 78615
2009-08-10 23:15:10 +00:00
Owen Anderson 53aa7a960c Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
llvm-svn: 78610
2009-08-10 22:56:29 +00:00
Owen Anderson eddff647ac Remove a bunch of debugging code that was slowing PBQP down by 25% or so.
llvm-svn: 78601
2009-08-10 21:49:45 +00:00
Owen Anderson c30530d105 Start moving TargetLowering away from using full MVTs and towards SimpleValueType, which will simplify the privatization of IntegerType in the future.
llvm-svn: 78584
2009-08-10 18:56:59 +00:00
Dan Gohman b717091e69 Make this comment more closely reflect the code.
llvm-svn: 78569
2009-08-10 16:50:32 +00:00
David Greene f354b6ef90 Add support for printing loop structure information in asm comments.
This definitely slows down asm output so put it under an -asm-exuberant
flag.

This information is useful when doing static analysis of performance
issues.

llvm-svn: 78567
2009-08-10 16:38:07 +00:00
David Goodwin 6021b4dccc Post RA scheduler changes. Introduce a hazard recognizer that uses the target schedule information to accurately model the pipeline. Update the scheduler to correctly handle multi-issue targets.
llvm-svn: 78563
2009-08-10 15:55:25 +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
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
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 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
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
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
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
Daniel Dunbar 4bfb4c80e0 Fix some -Asserts unused variable warnings.
llvm-svn: 78447
2009-08-08 00:40:46 +00:00
Chris Lattner 84b9db2926 code cleanup
llvm-svn: 78432
2009-08-07 23:42:01 +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
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
Chris Lattner 5333a7b8c5 tidy up
llvm-svn: 78416
2009-08-07 22:26:50 +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
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
Daniel Dunbar 9a4ae0e9e6 Update CMake.
llvm-svn: 78367
2009-08-07 03:59:06 +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 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
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 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
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
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
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
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
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
Benjamin Kramer d06eaca66f Rename a variable to make MSVC happy.
llvm-svn: 78202
2009-08-05 16:08:58 +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
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
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
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