Commit Graph

12859 Commits

Author SHA1 Message Date
Owen Anderson
e2a268fd03 Another step towards getting rid of static ctors for pass registration: have INITIALIZE_PASS AND INITIALIZE_AG_PASS
expand to an initializeMyPass() function (in additional to the extant static ctors).  Eventually, these will be called
from a big InitializeAllPasses() function, and the PassInfo's they create (which would be leaked if this code were used
at the moment) will be handed off to a PassRegistry for ownership.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 22:58:16 +00:00
Rafael Espindola
8f413fa9c0 On ELF we need to know which symbols are used in relocations to decide if
they should be in the symbol table or not. Instead of "guessing", just compute
the symbol table after the relocations are known.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115619 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 15:11:03 +00:00
Michael J. Spencer
a0b991be3f Support: Add __forceinline to Compiler.h on MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 06:00:52 +00:00
Bill Wendling
6cf6c79e82 The pshufw instruction came about in MMX2 when SSE was introduced. Don't place
it in with the SSSE3 instructions.

Steward! Could you place this chair by the aft sun deck? I'm trying to get away
from the Astors. They are such boors!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 20:24:01 +00:00
Kevin Enderby
3f55c24df9 Incorporate suggestions by Daniel Dunbar after his review. Thanks Daniel!
1) Changed ValidateDwarfFileNumber() to isValidDwarfFileNumber() to be better
   named.  Since it is just a predicate and isn't actually changing any state.

2) Added a missing return in the comments for setCurrentDwarfLoc() in 
   include/llvm/MC/MCContext.h for fix formatting.

3) Changed clearDwarfLocSeen() to ClearDwarfLocSeen() since it does change
   state.

4) Simplified the last test in isValidDwarfFileNumber() to just a one line
   boolean test of MCDwarfFiles[FileNumber] != 0 for the final return statement.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 20:17:24 +00:00
Jan Wen Voung
083cf1574f Add hook in MCSection to decide when to use "optimized nops", for each
section kind. Previously, optimized nops were only used for MachO.
Also added tests for ELF and COFF.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115523 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 17:32:41 +00:00
Chris Lattner
591d76ea5a the immediate field of pshufw is actually an 8-bit field, not a 8-bit field that is sign extended. This fixes PR8288
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 19:09:13 +00:00
Rafael Espindola
0febc4657b Jim Asked us to move DataLayout on ARM back to the most specialized classes. Do
so and also change X86 for consistency.

Investigating if this can be improved a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 18:59:45 +00:00
Duncan Sands
5dd76fa50a GCC extensions are no longer used here - update the comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 15:31:50 +00:00
Duncan Sands
75e2016f02 Remove two uses of the gcc specific 'aligned' attribute. This
is partly because this attribute caused trouble in the past (the
SmallVector one had to be changed from aligned to aligned(8) due
to causing crashes on i386 for example; in theory the same might
be needed in the Allocator case...).  But it's mostly because
there seems to be no point in special casing gcc here.  Using the
same implementation for all compilers results in better testing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115462 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 15:15:19 +00:00
Jakob Stoklund Olesen
e0a73ec0a9 When RemoveCopyByCommutingDef is creating additional identity copies, just use
LiveInterval::MergeValueNumberInto instead of trying to extend LiveRanges and
getting it wrong.

This fixed PR8249 where a valno with a multi-segment live range was defined by
an identity copy created by RemoveCopyByCommutingDef. Some of the live
segments disappeared.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:52:25 +00:00
Devang Patel
21ea1d5b4c Add support to let FE mark explict methods as explict in debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:31:40 +00:00
Owen Anderson
e3cc84a43d Thread the determination of branch prediction hit rates back through the if-conversion heuristic APIs. For now,
stick with a constant estimate of 90% (branch predictors are good!), but we might find that we want to provide
more nuanced estimates in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 22:45:50 +00:00
Dale Johannesen
0488fb649a Massive rewrite of MMX:
The x86_mmx type is used for MMX intrinsics, parameters and
return values where these use MMX registers, and is also
supported in load, store, and bitcast.

Only the above operations generate MMX instructions, and optimizations
do not operate on or produce MMX intrinsics. 

MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into
smaller pieces.  Optimizations may occur on these forms and the
result casted back to x86_mmx, provided the result feeds into a
previous existing x86_mmx operation.

The point of all this is prevent optimizations from introducing
MMX operations, which is unsafe due to the EMMS problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 23:57:10 +00:00
Evan Cheng
a56927e3ff Comments about operand cycles and pipeline forwarding pathes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115214 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 22:01:50 +00:00
Kevin Enderby
3bb435301a Did my commit for the last patch for the .loc directory from the wrong place and
missed a bunch of files.  Here the rest.  Sorry about that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115173 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:16:09 +00:00
Kevin Enderby
8ebf66236e Adds getPointerSize() to the AsmBackend which will be needed by the final patch
for the dwarf .loc support to emit dwarf line number tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:38:07 +00:00
Jan Wen Voung
186e7a0fb1 Move logic of determining ELF entsize from the .s printer to initialization
time. That way, the EntrySize field is initialized for other code paths, 
namely, the .ll -> .o code path.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 05:59:22 +00:00
Jason W Kim
afd1cc2578 Tiny patch for proof-of-concept cleanup of ARMAsmPrinter::EmitStartOfAsmFile()
Small test for sanity check of resulting ARM .s file.
Tested against -r115129.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:45:56 +00:00
Rafael Espindola
7070387f08 Make it possible for the MCObjectWriter to decide if a given fixup is fully
resolved or not. Different object files have different restrictions and
different native assemblers have different idiosyncrasies we want to emulate
for now.

Move the existing MachO logic to the new place and implement an ELF one that
gets fixups to globals right.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:22:20 +00:00
Jim Grosbach
ca96a86165 Let a target specify whether it wants an assembly printer to be the MC version
or not. TableGen needs to generate the printInstruction() function as taking
an MCInstr* or a MachineInstr*, depending. Default to the old non-MC
version so that everything not yet using MC continues to just work without
fidding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115126 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 01:29:54 +00:00
Owen Anderson
fe45b104b3 Revert r115099 (adding early jump threading). It's not clear if the benefits are worth the compile time cost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 23:31:09 +00:00
Devang Patel
3cf763dc7a Let FE mark a variable as artificial variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 23:07:21 +00:00
Owen Anderson
235859d66c Early CFG simplification can fold conditionals down to selects, which is often a good thing, but it can also
hide jump threading opportunities by turning control flow into data flow.  Run an early JumpThreading pass
(adds approximately an additional 1% to optimization time on SPEC), allowing it to get a shot at these cases
first.  Fixes <rdar://problem/8447345>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:57:02 +00:00
Evan Cheng
3881cb7a5d Model Cortex-a9 load to SUB, RSB, ADD, ADC, SBC, RSC, CMN, MVN, or CMP
pipeline forwarding path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:42:35 +00:00
Devang Patel
1a30123b60 Add support to let FE encode method access specifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 21:44:16 +00:00
Devang Patel
9dd2b47d44 Generalize DISubprogram element to encode various flags instead of just one boolean for isArtificial.
This is a backword compatible change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 21:04:46 +00:00
Chris Lattner
3c99c769eb remove PointerTracking from mainline, Edwin is going to move it out to ClamAV
for LLVM 2.9


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 18:43:27 +00:00
Chris Lattner
7c51a3172c implement rdar://8456378 and PR7557 - support for the fstsw,
an instruction that requires a WHOLE NEW wonderful kind of alias.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115015 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 01:50:45 +00:00
Chris Lattner
7036f8be4d change the protocol TargetAsmPArser::MatchInstruction method to take an
MCStreamer to emit into instead of an MCInst to fill in.  This allows the
matcher extra flexibility and is more convenient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 01:42:58 +00:00
Evan Cheng
63d66eed16 Add support to model pipeline bypass / forwarding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115005 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 23:50:49 +00:00
Owen Anderson
b20b85168c Part one of switching to using a more sane heuristic for determining if-conversion profitability.
Rather than having arbitrary cutoffs, actually try to cost model the conversion.

For now, the constants are tuned to more or less match our existing behavior, but these will be
changed to reflect realistic values as this work proceeds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 18:32:13 +00:00
Devang Patel
1a7ca0354a Provide an interface to let FEs anchor debug info for types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 18:08:20 +00:00
Bill Wendling
7afea0cfc4 Add a new scope type "LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN" for the
"linker_private_weak_auto_def" linkage type for LTO.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 20:17:45 +00:00
Daniel Dunbar
4f2afe3d39 MC/AsmParser: Handle exponents in floating point literals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 20:12:52 +00:00
Rafael Espindola
b814110612 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 18:13:03 +00:00
Benjamin Kramer
d1e1703c39 Push twines deeper into SourceMgr's error handling methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 17:42:11 +00:00
Dan Gohman
cce563cf1c writeGraph doesn't need its ShortNames argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 16:59:51 +00:00
Dan Gohman
d73b908f26 Don't construct a redundant GraphWriter object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 16:54:13 +00:00
Dan Gohman
f7e2ca9e16 Factor out code from the standalone WriteGraph function into a helper
function on GraphWriter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 16:44:11 +00:00
Dan Gohman
e6098b6205 Constify properlyDominates in the same manner as dominates.
Add constified overloads for findNearestCommonDominator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114834 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 16:33:31 +00:00
Dan Gohman
48fd5a79e0 Add support for viewing graphviz graphs with xdot.py.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 16:28:34 +00:00
Dan Gohman
fab4c9e9df Add an all() method to BitVector, for testing whether all bits are set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 15:48:37 +00:00
Dan Gohman
4c6809d8e3 Remove WriteGraph's Name argument, which it didn't use, and
rename writeHeader's Name argument to Title, to be consistent
with WriteGraph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 15:34:19 +00:00
Dan Gohman
640e74207e Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114827 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 14:44:14 +00:00
Chris Lattner
8048ebe91d the latest assembler that runs on powerpc 10.4 machines doesn't
support aligned comm.  Detect when compiling for 10.4 and don't
emit an alignment for comm.  THis will hopefully fix PR8198.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 06:44:54 +00:00
Oscar Fuentes
429c75b865 Avoid warnings about implicit conversions to `bool' in MSVC. This time
for real.

Patch by Nathan Jeffords!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 20:27:36 +00:00
Jakob Stoklund Olesen
207f8f688b Avoid using VNInfo::getCopy as much as possible. I want to get rid of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 18:10:38 +00:00
Lang Hames
6e2968c85c Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing whether LiveIntervals::getInstructionFromIndex(def) returns NULL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 12:04:16 +00:00
Che-Liang Chiou
f9930da2ef Add ret instruction to PTX backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 07:46:17 +00:00