1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

8012 Commits

Author SHA1 Message Date
Duncan Sands
9c1869fdaf These bitfields were being miscompiled on some
64 bit platforms when building with optimization.
So replace them by a hand-coded implementation.
This fixes PR3822.

llvm-svn: 69597
2009-04-20 16:03:21 +00:00
Douglas Gregor
bdeba00c46 Make all raw_ostreams support the tell() function.
llvm-svn: 69583
2009-04-20 07:34:17 +00:00
Nick Lewycky
3e04213f1f Fix missing text in doxygen documentation.
llvm-svn: 69529
2009-04-19 18:20:21 +00:00
Duncan Sands
2a830a7382 Remove the SimpleTy enumerated type field from the MVT
value type union: this field was causing problems for
some compilers on 64 bit systems, presumably because
SimpleTy is 32 bits wide while the other fields are
64 bits wide.

llvm-svn: 69515
2009-04-19 06:23:05 +00:00
Duncan Sands
d2ba02aa87 Don't try to make BUILD_VECTOR operands have the same
type as the vector element type: allow them to be of
a wider integer type than the element type all the way
through the system, and not just as far as LegalizeDAG.
This should be safe because it used to be this way
(the old type legalizer would produce such nodes), so
backends should be able to handle it.  In fact only
targets which have legal vector types with an illegal
promoted element type will ever see this (eg: <4 x i16>
on ppc).  This fixes a regression with the new type
legalizer (vec_splat.ll).  Also, treat SCALAR_TO_VECTOR
the same as BUILD_VECTOR.  After all, it is just a
special case of BUILD_VECTOR.

llvm-svn: 69467
2009-04-18 20:16:54 +00:00
Dan Gohman
f691991a39 Add a ScalarEvolution::getCouldNotCompute() function, and use it
instead of allocating and leaking new SCEVCouldNotCompute objects.

llvm-svn: 69452
2009-04-18 17:58:19 +00:00
Dan Gohman
e2e949ee98 Use more const qualifiers with SCEV interfaces.
llvm-svn: 69450
2009-04-18 17:56:28 +00:00
Evan Cheng
1b6d7dc766 Add a new LiveInterval::overlaps(). It checks if the live interval overlaps a range specified by [Start, End).
llvm-svn: 69434
2009-04-18 08:52:15 +00:00
Bob Wilson
911e92c7a3 Clean up formatting, remove trailing whitespace, fix comment typos and
punctuation.  No functional changes.

llvm-svn: 69378
2009-04-17 20:35:10 +00:00
Dan Gohman
238dffed25 Delete an unused field.
llvm-svn: 69375
2009-04-17 20:03:31 +00:00
Bob Wilson
b8756b00cd Use CallConvLower.h and TableGen descriptions of the calling conventions
for ARM.  Patch by Sandeep Patel.

llvm-svn: 69371
2009-04-17 19:07:39 +00:00
Bob Wilson
76f07543d9 Add a comment to describe LLVMMatchType.
llvm-svn: 69313
2009-04-16 21:46:42 +00:00
Dan Gohman
1482541677 Teach SCEVExpander::InsertCastOfTo to avoid creating inttoptr-of-ptrtoint
and ptrtoint-of-inttoptr expressions. This fixes a regression in 300.twolf.

llvm-svn: 69293
2009-04-16 15:52:57 +00:00
Dan Gohman
98aa1d9693 Expand GEPs in ScalarEvolution expressions. SCEV expressions can now
have pointer types, though in contrast to C pointer types, SCEV
addition is never implicitly scaled. This not only eliminates the
need for special code like IndVars' EliminatePointerRecurrence
and LSR's own GEP expansion code, it also does a better job because
it lets the normal optimizations handle pointer expressions just
like integer expressions.

Also, since LLVM IR GEPs can't directly index into multi-dimensional
VLAs, moving the GEP analysis out of client code and into the SCEV
framework makes it easier for clients to handle multi-dimensional
VLAs the same way as other arrays.

Some existing regression tests show improved optimization.
test/CodeGen/ARM/2007-03-13-InstrSched.ll in particular improved to
the point where if-conversion started kicking in; I turned it off
for this test to preserve the intent of the test.

llvm-svn: 69258
2009-04-16 03:18:22 +00:00
Devang Patel
d9a9d5bdbb If FastISel is run and it has known DebugLoc then use it.
llvm-svn: 69253
2009-04-16 01:33:10 +00:00
Dan Gohman
5555c4538b Generalize one of the SelectionDAG::ReplaceAllUsesWith overloads
to support replacing a node with another that has a superset of
the result types. Use this instead of calling
ReplaceAllUsesOfValueWith for each value.

llvm-svn: 69209
2009-04-15 20:06:30 +00:00
Douglas Gregor
8965c485d7 Allow jumping to the end of a bitstream while reading
llvm-svn: 69145
2009-04-15 04:53:47 +00:00
Dan Gohman
a1eee28415 Don't use "protected:" in classes that aren't intended to be
subclassed.

llvm-svn: 69129
2009-04-15 01:47:03 +00:00
Dan Gohman
f023ab3fae Fix doxygen comment syntax.
llvm-svn: 69128
2009-04-15 01:44:07 +00:00
Dan Gohman
e1e53b379b Move MachineRegisterInfo::setRegClass out of line.
llvm-svn: 69126
2009-04-15 01:19:35 +00:00
Dan Gohman
a885b48029 Move MachineJumpTableInfo::ReplaceMBBInJumpTables out of line.
llvm-svn: 69125
2009-04-15 01:18:49 +00:00
Dan Gohman
c9b68844d6 Give RemoveRegOperandFromRegInfo a comment and move the
code out of line.

llvm-svn: 69124
2009-04-15 01:17:37 +00:00
Devang Patel
f2b9c22687 Construct and emit DW_TAG_inlined_subroutine DIEs for inlined subroutine scopes (only in FastISel mode).
llvm-svn: 69116
2009-04-15 00:10:26 +00:00
Devang Patel
ec716faf9e Add a method to check that the subprogram holds debug info for the given Function or not.
llvm-svn: 69113
2009-04-15 00:06:07 +00:00
Bob Wilson
355508e70f Change SelectionDAG type legalization to allow BUILD_VECTOR operands to be
promoted to legal types without changing the type of the vector.  This is
following a suggestion from Duncan
(http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-February/019923.html).
The transformation that used to be done during type legalization is now
postponed to DAG legalization.  This allows the BUILD_VECTORs to be optimized
and potentially handled specially by target-specific code.

It turns out that this is also consistent with an optimization done by the
DAG combiner: a BUILD_VECTOR and INSERT_VECTOR_ELT may be combined by
replacing one of the BUILD_VECTOR operands with the newly inserted element;
but INSERT_VECTOR_ELT allows its scalar operand to be larger than the
element type, with any extra high bits being implicitly truncated.  The
result is a BUILD_VECTOR where one of the operands has a type larger the
the vector element type.

Any code that operates on BUILD_VECTORs may now need to be aware of the
potential type discrepancy between the vector element type and the
BUILD_VECTOR operands.  This patch updates all of the places that I could
find to handle that case.

llvm-svn: 68996
2009-04-13 22:05:19 +00:00
Dan Gohman
8393d29bc8 Rename COPY_TO_SUBCLASS to COPY_TO_REGCLASS, and generalize
it accordingly. Thanks to Jakob Stoklund Olesen for pointing
out how this might be useful.

llvm-svn: 68986
2009-04-13 21:06:25 +00:00
Douglas Gregor
d2b9d57e20 Add a static APInt::getNumWords
llvm-svn: 68977
2009-04-13 19:43:10 +00:00
Devang Patel
92d79ef835 Right now, Debugging information to encode scopes (DW_TAG_lexical_block) relies on DBG_LABEL. Unfortunately this intefers with the quality of optimized code.
This patch updates dwarf writer to encode scoping information in DWARF only in FastISel mode.

llvm-svn: 68973
2009-04-13 18:13:16 +00:00
Devang Patel
ad7f61c279 Reapply 68847.
Now debug_inlined section is covered by TAI->doesDwarfUsesInlineInfoSection(), which is false by default.

llvm-svn: 68964
2009-04-13 17:02:03 +00:00
Dan Gohman
3873cb7a36 Add a new TargetInstrInfo MachineInstr opcode, COPY_TO_SUBCLASS.
This will be used to replace things like X86's MOV32to32_.

Enhance ScheduleDAGSDNodesEmit to be more flexible and robust
in the presense of subregister superclasses and subclasses. It
can now cope with the definition of a virtual register being in
a subclass of a use.

Re-introduce the code for recording register superreg classes and
subreg classes. This is needed because when subreg extracts and
inserts get coalesced away, the virtual registers are left in
the correct subclass.

llvm-svn: 68961
2009-04-13 15:38:05 +00:00
Dan Gohman
b09c13463a Add comments to INSERT_SUBREG, EXTRACT_SURBEG, SUBREG_TO_REG,
and IMPLICIT_DEF.

llvm-svn: 68949
2009-04-13 15:12:29 +00:00
Chris Lattner
c1bfdc9bb2 Add a new "available_externally" linkage type. This is intended
to support C99 inline, GNU extern inline, etc.  Related bugzilla's
include PR3517, PR3100, & PR2933.  Nothing uses this yet, but it
appears to work.

llvm-svn: 68940
2009-04-13 05:44:34 +00:00
Nick Lewycky
2a36860ad9 Regenerate.
llvm-svn: 68938
2009-04-13 04:26:27 +00:00
Owen Anderson
33c00940cb Use a hashtable for TargetRegisterClass::contains.
llvm-svn: 68922
2009-04-12 22:31:17 +00:00
Chris Lattner
ed355b8551 optimize FastISel::UpdateValueMap to avoid duplicate map lookups,
and make it return the assigned register.

llvm-svn: 68888
2009-04-12 07:45:01 +00:00
Chris Lattner
da05d37aa1 Add new TargetInstrDesc::hasImplicitUseOfPhysReg and
hasImplicitDefOfPhysReg methods.  Use them to remove a 
look in X86 fast isel.

llvm-svn: 68886
2009-04-12 07:26:51 +00:00
Dan Gohman
ac11c8d30f Revert r68847. It breaks the build on non-Darwin targets, with this message
from the assembler:

Error: unknown pseudo-op: `.debug_inlined'
llvm-svn: 68863
2009-04-11 15:57:04 +00:00
Devang Patel
6f907173e0 Keep track of inlined functions and their locations. This information is collected when nested llvm.dbg.func.start intrinsics are seen. (Right now, inliner removes nested llvm.dbg.func.start intrinisics during inlining.)
Create debug_inlined dwarf section using these information. This info is used by gdb, at least on Darwin, to enable better experience debugging inlined functions. See DwarfWriter.cpp for more information on structure of debug_inlined section.

llvm-svn: 68847
2009-04-11 00:16:47 +00:00
Devang Patel
92ff43635b DebugLabelFolder ruthlessly deletes redundant labels. However, sometimes the redundant labels is referenced by debug info somewhere else. This patch provies a way so that dwarf writer can mark labels as used.
llvm-svn: 68813
2009-04-10 18:58:59 +00:00
Chris Lattner
8d5d3eaf95 fix a broken assertion in ilist_iterator, which caused it to crash in the
bad case instead of actually assert.  Bug pointed out by Jakob Stoklund 
Olesen!

llvm-svn: 68785
2009-04-10 15:47:17 +00:00
Nick Lewycky
e5b361c13a Cleanup. Remove redundant llvm:: , we don't need them since we're inside
namespace llvm already.

llvm-svn: 68774
2009-04-10 06:54:06 +00:00
Chris Lattner
af0fd068e1 Add a new Type::getPointerTo method, which is shorthand for
llvm::PointerType::get().  Patch by Anders Johnsen!

llvm-svn: 68772
2009-04-10 06:42:02 +00:00
Nick Lewycky
0f4dbe06e7 Add utility function to IRBuilder that takes the difference between two
pointers, taking into account the size of the pointed-to object.
Patch by Jeffrey Yasskin!

llvm-svn: 68768
2009-04-10 05:30:48 +00:00
Bill Wendling
5d9538852f Pass in the std::string parameter instead of returning it by value.
llvm-svn: 68747
2009-04-10 00:12:49 +00:00
Bill Wendling
ab0a8487ca Constify getter methods.
llvm-svn: 68745
2009-04-10 00:00:25 +00:00
Dan Gohman
8121b3f88d Remove the obsolete SelectionDAG::getNodeValueTypes and simplify
code that uses it by using SelectionDAG::getVTList instead.

llvm-svn: 68744
2009-04-09 23:54:40 +00:00
Dan Gohman
f0aeaae63c Change the NumVTs field from short to int, since there's no
real need for it to be short.

llvm-svn: 68742
2009-04-09 23:53:31 +00:00
Bill Wendling
62c4c8bc44 StringMap<DIE*>::iterator::first() returns a pointer to the first character of
the key. This will cause it to create a new std::string, which isn't
wanted. Instead, pass back the "const char*". Modify the EmitString() method to
take a "const char*".

llvm-svn: 68741
2009-04-09 23:51:31 +00:00
Owen Anderson
bd340ca405 Give register alias checking the hash table treatment too.
llvm-svn: 68730
2009-04-09 22:19:30 +00:00
Bob Wilson
c53238dff1 Fix pr3954. The register scavenger asserts for inline assembly with
register destinations that are tied to source operands.  The
TargetInstrDescr::findTiedToSrcOperand method silently fails for inline
assembly.  The existing MachineInstr::isRegReDefinedByTwoAddr was very
close to doing what is needed, so this revision makes a few changes to
that method and also renames it to isRegTiedToUseOperand (for consistency
with the very similar isRegTiedToDefOperand and because it handles both
two-address instructions and inline assembly with tied registers).

llvm-svn: 68714
2009-04-09 17:16:43 +00:00