Commit Graph

8124 Commits

Author SHA1 Message Date
Chris Lattner 8e1d7222a7 Fix PR5421 by APInt'izing switch lowering.
llvm-svn: 86354
2009-11-07 07:50:34 +00:00
Lang Hames bc247dce4d Update some globals to use ManagedStatic.
llvm-svn: 86342
2009-11-07 05:50:28 +00:00
Mon P Wang fc032ced22 Fix memoizing of CvtRndSatSDNode
llvm-svn: 86340
2009-11-07 04:46:25 +00:00
Evan Cheng 7ff831962a - Add TargetInstrInfo::isIdentical(). It's similar to MachineInstr::isIdentical
except it doesn't care if the definitions' virtual registers differ. This is
  used by machine LICM and other MI passes to perform CSE.
- Teach Thumb2InstrInfo::isIdentical() to check two t2LDRpci_pic are identical.
  Since pc relative constantpool entries are always different, this requires it
  it check if the values can actually the same.

llvm-svn: 86328
2009-11-07 03:52:02 +00:00
Kenneth Uildriks 07119737aa Add code to check at SelectionDAGISel::LowerArguments time to see if return values can be lowered to registers. Coming soon, code to perform sret-demotion if return values cannot be lowered to registers
llvm-svn: 86324
2009-11-07 02:11:54 +00:00
Jakob Stoklund Olesen 4141d8ee92 Fix inverted conflict test in -early-coalesce.
A non-identity copy cannot be coalesced when the phi join destination register
is live at the copy site.

Also verify the condition that the PHI join source register is only used in
the PHI join. Otherwise the coalescing is invalid.

llvm-svn: 86322
2009-11-07 01:58:40 +00:00
Bob Wilson b29e155c53 Fix comment typos.
llvm-svn: 86295
2009-11-06 22:38:38 +00:00
Dan Gohman 0080ee2d91 Use WriteAsOperand to print GlobalAddress MachineOperands. This
prints them with the leading '@'.

llvm-svn: 86261
2009-11-06 18:03:10 +00:00
Devang Patel cc11371b77 Do not bother to emit debug info for nameless global variable.
llvm-svn: 86259
2009-11-06 17:58:12 +00:00
Devang Patel 06ce6506d2 Do not try to emit debug info entry for dead global variable.
llvm-svn: 86212
2009-11-06 01:30:04 +00:00
Dan Gohman ee8afcc59d Factor out the printing of the leading tab into printInlineAsm.
llvm-svn: 86199
2009-11-06 00:04:54 +00:00
Dan Gohman d53b5cfe3f Fix the label name generation for address-taken labels to avoid potential
problems with name collisions.

llvm-svn: 86189
2009-11-05 23:14:35 +00:00
Lang Hames 933c541270 Added support for renumbering existing index list elements. Removed some junk from the initial numbering code in runOnMachineFunction.
llvm-svn: 86184
2009-11-05 22:20:57 +00:00
David Goodwin bed7cb6c1d Fix bug in aggressive antidep breaking; liveness was not updated correctly for regions that do not have antidep candidates.
llvm-svn: 86172
2009-11-05 21:06:09 +00:00
Dan Gohman 43bdc260d6 Avoid printing a redundant space in SDNode->dump().
llvm-svn: 86151
2009-11-05 18:49:11 +00:00
David Goodwin 542649463b Replace std::map.at() with std::map[].
llvm-svn: 86102
2009-11-05 01:45:50 +00:00
David Goodwin 7d8878add2 Break anti-dependencies using free registers in a round-robin manner to avoid introducing new anti-dependencies.
llvm-svn: 86098
2009-11-05 01:19:35 +00:00
Evan Cheng 66549b2818 Now that code placement optimization pass is run for JIT, make sure it's before pre-emit passes.
llvm-svn: 86092
2009-11-05 01:16:59 +00:00
Evan Cheng 921152fe9d Code refactoring.
llvm-svn: 86085
2009-11-05 00:51:13 +00:00
David Goodwin 28ba4f27d1 Correctly add chain dependencies around calls and unknown-side-effect instructions.
llvm-svn: 86080
2009-11-05 00:16:44 +00:00
Devang Patel f05d57283e While calculating original type size for a derived type, handle type variants encoded as DIDerivedType appropriately.
This improves bitfield support.

llvm-svn: 86073
2009-11-04 23:48:00 +00:00
Devang Patel 67f56f08c2 Fix DW_AT_data_member_location for bit-fields. It points to the location of annonymous field that covers respective field.
llvm-svn: 86054
2009-11-04 22:06:12 +00:00
Lang Hames 289b8a2bd9 Handle empty/tombstone keys for LiveIndex more cleanly. Check for index sanity when constructing index list entries.
llvm-svn: 86049
2009-11-04 21:24:15 +00:00
Eric Christopher 9196f0c0e8 Add some options to disable various code gen optimizations.
llvm-svn: 86044
2009-11-04 19:57:50 +00:00
Devang Patel 5d3fe2fc77 Array element size does not match array size but array is not a bitfield.
llvm-svn: 86043
2009-11-04 19:37:40 +00:00
Jakob Stoklund Olesen c7cfc94bcc Print out an informative comment for KILL instructions.
The KILL pseudo-instruction may survive to the asm printer pass, just like the IMPLICIT_DEF. Print the KILL as a comment instead of just leaving a blank line in the output.

With -asm-verbose=0, a blank line is printed, like IMPLICIT?DEF.

llvm-svn: 86041
2009-11-04 19:24:37 +00:00
Evan Cheng 95bdc5d899 RangeIsDefinedByCopyFromReg() should check for subreg_to_reg, insert_subreg,
and extract_subreg as a "copy" that defines a valno.
Also fixes a typo. These two issues prevent a simple subreg coalescing from
happening before.

llvm-svn: 86022
2009-11-04 08:33:14 +00:00
Douglas Gregor 90790c7781 Fix CMake makefiles
llvm-svn: 85994
2009-11-04 01:32:06 +00:00
Lang Hames 05fb9637f6 The Indexes Patch.
This introduces a new pass, SlotIndexes, which is responsible for numbering
instructions for register allocation (and other clients). SlotIndexes numbering
is designed to match the existing scheme, so this patch should not cause any
changes in the generated code.

For consistency, and to avoid naming confusion, LiveIndex has been renamed
SlotIndex.

The processImplicitDefs method of the LiveIntervals analysis has been moved
into its own pass so that it can be run prior to SlotIndexes. This was
necessary to match the existing numbering scheme.

llvm-svn: 85979
2009-11-03 23:52:08 +00:00
Bob Wilson 53a31ad3c1 Fix branch folding bug for indirect branches: for a block containing only
an unconditional branch (possibly from tail merging), this code is
trying to redirect all of its predecessors to go directly to the branch
target, but that isn't feasible for indirect branches.  The other
predecessors (that don't end with indirect branches) could theoretically
still be handled, but that is not easily done right now.

The AnalyzeBranch interface doesn't currently let us distinguish jump table
branches from indirect branches, and this code is currently handling
jump tables.  To avoid punting on address-taken blocks, we would have to give
up handling jump tables.  That seems like a bad tradeoff.

llvm-svn: 85975
2009-11-03 23:44:31 +00:00
Evan Cheng f42b5af549 Re-apply 85799. It turns out my code isn't buggy.
llvm-svn: 85947
2009-11-03 21:40:02 +00:00
David Goodwin 8501dbbe10 Do a scheduling pass ignoring anti-dependencies to identify candidate registers that should be renamed.
llvm-svn: 85939
2009-11-03 20:57:50 +00:00
David Goodwin a86f919763 <rdar://problem/7352605>. When building schedule graph use mayAlias information to avoid chaining loads/stores of spill slots with non-aliased memory ops.
llvm-svn: 85934
2009-11-03 20:15:00 +00:00
Devang Patel ffa7c07352 Ignore unnamed variables.
llvm-svn: 85909
2009-11-03 18:30:27 +00:00
Jeffrey Yasskin 6235b19d7b Fix a funky "declared with greater visibility than the type of its field"
warning from gcc by removing VISIBILITY_HIDDEN attributes.  

llvm-svn: 85873
2009-11-03 06:29:36 +00:00
Evan Cheng a8a58efc03 Revert 85799 for now. It might be breaking llvm-gcc driver.
llvm-svn: 85827
2009-11-02 21:49:14 +00:00
David Goodwin 00822aabf6 Chain dependencies used to enforce memory order should have latency of 0 (except for true dependency of Store followed by aliased Load... we estimate that case with a single cycle of latency assuming the hardware will bypass)
llvm-svn: 85807
2009-11-02 17:06:28 +00:00
Evan Cheng 2729543984 Initilize the machine LICM CSE map upon the first time an instruction is hoisted to
the loop preheader. Add instructions which are already in the preheader block that
may be common expressions of those that are hoisted out. These does get a few more
instructions CSE'ed.

llvm-svn: 85799
2009-11-02 08:09:49 +00:00
Evan Cheng ea68c7c9a8 Add PseudoSourceValue::mayAlias. It returns true if the object can ever alias any LLVM IR value.
llvm-svn: 85762
2009-11-01 23:50:04 +00:00
Dan Gohman ae6bb61594 Fix a missing newline in the dwarf output code.
llvm-svn: 85684
2009-10-31 20:59:09 +00:00
Dan Gohman 34341e69c4 Make -print-machineinstrs more readable.
- Be consistent when referring to MachineBasicBlocks: BB#0.
 - Be consistent when referring to virtual registers: %reg1024.
 - Be consistent when referring to unknown physical registers: %physreg10.
 - Be consistent when referring to known physical registers: %RAX
 - Be consistent when referring to register 0: %reg0
 - Be consistent when printing alignments: align=16
 - Print jump table contents.
 - Don't print host addresses, in general.
 - and various other cleanups.

llvm-svn: 85682
2009-10-31 20:19:03 +00:00
Dan Gohman 18dc1c5c9e Factor out more code into addCommonCodeGenPasses. The JIT wasn't
previously running CodePlacementOpt. Also print headers before
each dump in -print-machineinstrs mode, so that it's clear which
dump is which.

llvm-svn: 85681
2009-10-31 20:17:39 +00:00
Dan Gohman fb7f0e57b6 Remove CodeGenLICM. It's largely obsoleted by MachineLICM's new ability
to unfold loop-invariant loads.

llvm-svn: 85657
2009-10-31 14:35:41 +00:00
Dan Gohman ba8735d25a When discarding SrcValue information, discard all of it so that code
that uses this information knows to behave conservatively.

llvm-svn: 85654
2009-10-31 14:14:04 +00:00
Dan Gohman 97abba5b6f Fix 80-column violation.
llvm-svn: 85653
2009-10-31 14:12:53 +00:00
Eric Christopher a0ca9e944f Fix warning with gcc-4.0 and signed/unsigned.
llvm-svn: 85648
2009-10-31 09:24:35 +00:00
Dan Gohman 060ee82dab Add assertion checks here to turn silent miscompiles into aborts.
llvm-svn: 85639
2009-10-30 23:59:06 +00:00
Dan Gohman d814e32e57 Don't mark registers dead here when processing nodes with MVT::Flag
results. This works around a problem affecting targets which rely on
MVT::Flag to handle physical register defs.

llvm-svn: 85638
2009-10-30 23:57:47 +00:00
Dan Gohman 49fa51d936 Fix MachineLICM to use the correct virtual register class when
unfolding loads for hoisting.  getOpcodeAfterMemoryUnfold returns the
opcode of the original operation without the load, not the load
itself, MachineLICM needs to know the operand index in order to get
the correct register class. Extend getOpcodeAfterMemoryUnfold to
return this information.

llvm-svn: 85622
2009-10-30 22:18:41 +00:00
Lang Hames 94966ca926 Stop the iterator in ValueLiveAt from potentially running off the end of the interval.
llvm-svn: 85599
2009-10-30 18:12:09 +00:00