oota-llvm.git
15 years agoMove MachineJumpTableInfo::ReplaceMBBInJumpTables out of line.
Dan Gohman [Wed, 15 Apr 2009 01:18:49 +0000 (01:18 +0000)]
Move MachineJumpTableInfo::ReplaceMBBInJumpTables out of line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69125 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGive RemoveRegOperandFromRegInfo a comment and move the
Dan Gohman [Wed, 15 Apr 2009 01:17:37 +0000 (01:17 +0000)]
Give RemoveRegOperandFromRegInfo a comment and move the
code out of line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69124 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnhance induction variable code to remove the
Dale Johannesen [Wed, 15 Apr 2009 01:10:12 +0000 (01:10 +0000)]
Enhance induction variable code to remove the
sext around sext(shorter IV + constant), using a
longer IV instead, when it can figure out the
add can't overflow.  This comes up a lot in
subscripting; mainly affects 64 bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69123 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAvoid making the transformation enabled by my last patch if the new destinations...
Evan Cheng [Wed, 15 Apr 2009 00:43:54 +0000 (00:43 +0000)]
Avoid making the transformation enabled by my last patch if the new destinations have phi nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69121 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhile inlining, clone llvm.dbg.func.start intrinsic and adjust
Devang Patel [Wed, 15 Apr 2009 00:17:06 +0000 (00:17 +0000)]
While inlining, clone llvm.dbg.func.start intrinsic and adjust
llvm.dbg.region.end instrinsic. This nested llvm.dbg.func.start/llvm.dbg.region.end pair now enables DW_TAG_inlined_subroutine support in code generator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69118 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosilence a warning.
Chris Lattner [Wed, 15 Apr 2009 00:16:05 +0000 (00:16 +0000)]
silence a warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69117 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoConstruct and emit DW_TAG_inlined_subroutine DIEs for inlined subroutine scopes ...
Devang Patel [Wed, 15 Apr 2009 00:10:26 +0000 (00:10 +0000)]
Construct and emit DW_TAG_inlined_subroutine DIEs for inlined subroutine scopes (only in FastISel mode).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69116 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDo for GR16_NOREX what r69049 did for GR8_NOREX, to avoid trouble with
Dan Gohman [Wed, 15 Apr 2009 00:10:16 +0000 (00:10 +0000)]
Do for GR16_NOREX what r69049 did for GR8_NOREX, to avoid trouble with
the local register allocator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69115 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a method to check that the subprogram holds debug info for the given Function...
Devang Patel [Wed, 15 Apr 2009 00:06:07 +0000 (00:06 +0000)]
Add a method to check that the subprogram holds debug info for the given Function or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69113 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a new MOV8rr_NOREX, and make X86's copyRegToReg use it when
Dan Gohman [Wed, 15 Apr 2009 00:04:23 +0000 (00:04 +0000)]
Add a new MOV8rr_NOREX, and make X86's copyRegToReg use it when
either the source or destination is a physical h register.

This fixes sqlite3 with the post-RA scheduler enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69111 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTestcase for r69104.
Bill Wendling [Wed, 15 Apr 2009 00:04:11 +0000 (00:04 +0000)]
Testcase for r69104.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69110 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGR8_NOREX can contain the H registers, since they don't require
Dan Gohman [Wed, 15 Apr 2009 00:00:48 +0000 (00:00 +0000)]
GR8_NOREX can contain the H registers, since they don't require
REX prefixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69108 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOptimize conditional branch on i1 phis with non-constant inputs.
Evan Cheng [Tue, 14 Apr 2009 23:40:03 +0000 (23:40 +0000)]
Optimize conditional branch on i1 phis with non-constant inputs.

This turns:

eq:
        %3 = icmp eq i32 %1, %2
        br label %join

ne:
        %4 = icmp ne i32 %1, %2
        br label %join

join:
        %5 = phi i1 [%3, %eq], [%4, %ne]
        br i1 %5, label %yes, label %no

=>

eq:
        %3 = icmp eq i32 %1, %2
        br i1 %3, label %yes, label %no

ne:
        %4 = icmp ne i32 %1, %2
        br i1 %4, label %yes, label %no

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69102 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix the RUN lines so that this test actually tests.
Dan Gohman [Tue, 14 Apr 2009 22:50:17 +0000 (22:50 +0000)]
Fix the RUN lines so that this test actually tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69096 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFor the h-register addressing-mode trick, use the correct value for
Dan Gohman [Tue, 14 Apr 2009 22:45:05 +0000 (22:45 +0000)]
For the h-register addressing-mode trick, use the correct value for
any non-address uses of the address value. This fixes 186.crafty.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69094 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMac OS X 10.6 and above do not use key manager to register EH frames.
Evan Cheng [Tue, 14 Apr 2009 22:31:59 +0000 (22:31 +0000)]
Mac OS X 10.6 and above do not use key manager to register EH frames.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69090 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen the result of an EXTRACT_SUBREG, INSERT_SUBREG, or SUBREG_TO_REG
Dan Gohman [Tue, 14 Apr 2009 22:17:14 +0000 (22:17 +0000)]
When the result of an EXTRACT_SUBREG, INSERT_SUBREG, or SUBREG_TO_REG
operator is used by a CopyToReg to export the value to a different
block, don't reuse the CopyToReg's register for the subreg operation
result if the register isn't precisely the right class for the
subreg operation.

Also, rename the h-registers.ll test, now that there are more
than one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69087 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCall CreateProcess with bInheritHandles = TRUE.
Mikhail Glushenkov [Tue, 14 Apr 2009 21:31:36 +0000 (21:31 +0000)]
Call CreateProcess with bInheritHandles = TRUE.

Makes llvmc show error messages printed by child processes when run from the
Cygwin/MSYS shell. Since ExecuteAndWait does not return until the child program
has finished execution, this change should be harmless.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69082 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDelete trailing whitespace.
Mikhail Glushenkov [Tue, 14 Apr 2009 21:31:14 +0000 (21:31 +0000)]
Delete trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69081 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSome of GR8_NOREX registers are only available in 64-bit mode.
Evan Cheng [Tue, 14 Apr 2009 16:57:43 +0000 (16:57 +0000)]
Some of GR8_NOREX registers are only available in 64-bit mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69049 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle aggregate type arguments to direct and indirect calls.
Sanjiv Gupta [Tue, 14 Apr 2009 02:49:52 +0000 (02:49 +0000)]
Handle aggregate type arguments to direct and indirect calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69022 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse the output of the asm so the optimizer won't
Dale Johannesen [Tue, 14 Apr 2009 01:51:40 +0000 (01:51 +0000)]
Use the output of the asm so the optimizer won't
delete it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69018 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLoopIndexSplit needs to inform the loop pass manager of the instructions it is
Owen Anderson [Tue, 14 Apr 2009 01:04:19 +0000 (01:04 +0000)]
LoopIndexSplit needs to inform the loop pass manager of the instructions it is
deleting, not just the basic block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69011 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDo not force asm's to be chained if they don't touch
Dale Johannesen [Tue, 14 Apr 2009 00:56:56 +0000 (00:56 +0000)]
Do not force asm's to be chained if they don't touch
memory and aren't volatile.  This was interfering with
good scheduling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69008 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR3934 part 2. findOnlyInterestingUse() was not setting IsCopy and IsDstPhys...
Evan Cheng [Tue, 14 Apr 2009 00:32:25 +0000 (00:32 +0000)]
Fix PR3934 part 2. findOnlyInterestingUse() was not setting IsCopy and IsDstPhys which are returned by value and used by callee. This happened to work on the earlier test cases because of a logic error in the caller side.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69006 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake these errors more noticable in build logs.
Daniel Dunbar [Mon, 13 Apr 2009 22:26:09 +0000 (22:26 +0000)]
Make these errors more noticable in build logs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68998 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange SelectionDAG type legalization to allow BUILD_VECTOR operands to be
Bob Wilson [Mon, 13 Apr 2009 22:05:19 +0000 (22:05 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68996 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename COPY_TO_SUBCLASS to COPY_TO_REGCLASS, and generalize
Dan Gohman [Mon, 13 Apr 2009 21:06:25 +0000 (21:06 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68986 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRefactor some code in SelectionDAGLegalize::ExpandBUILD_VECTOR.
Bob Wilson [Mon, 13 Apr 2009 20:20:30 +0000 (20:20 +0000)]
Refactor some code in SelectionDAGLegalize::ExpandBUILD_VECTOR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68981 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPR3934: Fix a bogus two-address pass assertion.
Evan Cheng [Mon, 13 Apr 2009 20:04:24 +0000 (20:04 +0000)]
PR3934: Fix a bogus two-address pass assertion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68979 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGet rid of some compile warnings.
Bill Wendling [Mon, 13 Apr 2009 19:45:05 +0000 (19:45 +0000)]
Get rid of some compile warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68978 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a static APInt::getNumWords
Douglas Gregor [Mon, 13 Apr 2009 19:43:10 +0000 (19:43 +0000)]
Add a static APInt::getNumWords

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68977 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRight now, Debugging information to encode scopes (DW_TAG_lexical_block) relies on...
Devang Patel [Mon, 13 Apr 2009 18:13:16 +0000 (18:13 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68973 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReapply 68847.
Devang Patel [Mon, 13 Apr 2009 17:02:03 +0000 (17:02 +0000)]
Reapply 68847.
Now debug_inlined section is covered by TAI->doesDwarfUsesInlineInfoSection(), which is false by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68964 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement x86 h-register extract support.
Dan Gohman [Mon, 13 Apr 2009 16:09:41 +0000 (16:09 +0000)]
Implement x86 h-register extract support.
 - Add patterns for h-register extract, which avoids a shift and mask,
   and in some cases a temporary register.
 - Add address-mode matching for turning (X>>(8-n))&(255<<n), where
   n is a valid address-mode scale value, into an h-register extract
   and a scaled-offset address.
 - Replace X86's MOV32to32_ and related instructions with the new
   target-independent COPY_TO_SUBREG instruction.

On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.

These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68962 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a new TargetInstrInfo MachineInstr opcode, COPY_TO_SUBCLASS.
Dan Gohman [Mon, 13 Apr 2009 15:38:05 +0000 (15:38 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68961 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove x86's special-case handling for ISD::TRUNCATE and
Dan Gohman [Mon, 13 Apr 2009 15:29:31 +0000 (15:29 +0000)]
Remove x86's special-case handling for ISD::TRUNCATE and
ISD::SIGN_EXTEND_INREG. Tablegen-generated code can handle
these cases, and the scheduling issues observed earlier
appear to be resolved now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68959 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix copy+pastos in comments.
Dan Gohman [Mon, 13 Apr 2009 15:28:29 +0000 (15:28 +0000)]
Fix copy+pastos in comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68958 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGeneralize getRegisterClassForRegister to handle registers
Dan Gohman [Mon, 13 Apr 2009 15:24:11 +0000 (15:24 +0000)]
Generalize getRegisterClassForRegister to handle registers
in multiple classes in the case that the classes are all
in subset/superset relations. This function is used by the
fast-isel emitter, which always wants the super-most set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68957 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't abort on an aliasing physical register that does not have
Dan Gohman [Mon, 13 Apr 2009 15:22:29 +0000 (15:22 +0000)]
Don't abort on an aliasing physical register that does not have
a live interval. This is needed for some upcoming subreg changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68956 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen assigning a physical register to a MachineOperand, set
Dan Gohman [Mon, 13 Apr 2009 15:21:32 +0000 (15:21 +0000)]
When assigning a physical register to a MachineOperand, set
the subreg field to 0, since the subreg field is only used
for virtual register subregs. This doesn't change
current functionality; it just eliminates bogus noise from
debug output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68955 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoList the l registers before h registers, for consistency.
Dan Gohman [Mon, 13 Apr 2009 15:18:42 +0000 (15:18 +0000)]
List the l registers before h registers, for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68954 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd an assertion to verify that a copy was actually emitted.
Dan Gohman [Mon, 13 Apr 2009 15:16:56 +0000 (15:16 +0000)]
Add an assertion to verify that a copy was actually emitted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68953 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse X86::SUBREG_8BIT instead of hard-coding the equivalent constant.
Dan Gohman [Mon, 13 Apr 2009 15:14:03 +0000 (15:14 +0000)]
Use X86::SUBREG_8BIT instead of hard-coding the equivalent constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68951 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a comment about MOVSX64rr8.
Dan Gohman [Mon, 13 Apr 2009 15:13:28 +0000 (15:13 +0000)]
Add a comment about MOVSX64rr8.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68950 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd comments to INSERT_SUBREG, EXTRACT_SURBEG, SUBREG_TO_REG,
Dan Gohman [Mon, 13 Apr 2009 15:12:29 +0000 (15:12 +0000)]
Add comments to INSERT_SUBREG, EXTRACT_SURBEG, SUBREG_TO_REG,
and IMPLICIT_DEF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68949 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix another hard-coded constant to use X86AddrNumOperands.
Dan Gohman [Mon, 13 Apr 2009 15:04:25 +0000 (15:04 +0000)]
Fix another hard-coded constant to use X86AddrNumOperands.
This unbreaks the JIT on x86-64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68948 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoX86-64 TLS support for local exec and initial exec.
Rafael Espindola [Mon, 13 Apr 2009 13:02:49 +0000 (13:02 +0000)]
X86-64 TLS support for local exec and initial exec.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68947 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhile passing arg of types larger than char only one byte at lower end was getting...
Sanjiv Gupta [Mon, 13 Apr 2009 09:38:38 +0000 (09:38 +0000)]
While passing arg of types larger than char only one byte at lower end was getting passed. We couldn't catch this as we did not have tests that were passing an int value larger than 256.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68946 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix ocaml bindings; add "available_externally" linkage type.
Nick Lewycky [Mon, 13 Apr 2009 07:02:32 +0000 (07:02 +0000)]
Fix ocaml bindings; add "available_externally" linkage type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68945 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix warning in .ll parser, detect and reject available_externally on function
Nick Lewycky [Mon, 13 Apr 2009 07:02:02 +0000 (07:02 +0000)]
Fix warning in .ll parser, detect and reject available_externally on function
declarations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68944 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd AvailableExternally linkage to C bindings.
Chris Lattner [Mon, 13 Apr 2009 06:25:37 +0000 (06:25 +0000)]
add AvailableExternally linkage to C bindings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68942 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a new "available_externally" linkage type. This is intended
Chris Lattner [Mon, 13 Apr 2009 05:44:34 +0000 (05:44 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68940 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoeliminate unneeded parens.
Chris Lattner [Mon, 13 Apr 2009 05:38:23 +0000 (05:38 +0000)]
eliminate unneeded parens.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68939 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRegenerate.
Nick Lewycky [Mon, 13 Apr 2009 04:26:27 +0000 (04:26 +0000)]
Regenerate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68938 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLink against libffi if available, fall back to "no external calls from
Nick Lewycky [Mon, 13 Apr 2009 04:26:06 +0000 (04:26 +0000)]
Link against libffi if available, fall back to "no external calls from
interpreter mode" when it's not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68937 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd paragraph tags.
Nick Lewycky [Mon, 13 Apr 2009 02:03:40 +0000 (02:03 +0000)]
Add paragraph tags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68934 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix PR3965:SIGINT handler not restored after calling ParseAST(),
Chris Lattner [Sun, 12 Apr 2009 23:33:13 +0000 (23:33 +0000)]
fix PR3965:SIGINT handler not restored after calling ParseAST(),
patch by Alexei Svitkine!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68929 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIn X86DAGToDAGISel::MatchWrapper, if base or index are set, avoid matching
Rafael Espindola [Sun, 12 Apr 2009 23:00:38 +0000 (23:00 +0000)]
In X86DAGToDAGISel::MatchWrapper, if base or index are set, avoid matching
only if symbolic addresses are RIP relatives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68924 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse a hashtable for TargetRegisterClass::contains.
Owen Anderson [Sun, 12 Apr 2009 22:31:17 +0000 (22:31 +0000)]
Use a hashtable for TargetRegisterClass::contains.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68922 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorefactor some code into X86DAGToDAGISel::MatchWrapper
Rafael Espindola [Sun, 12 Apr 2009 21:55:03 +0000 (21:55 +0000)]
refactor some code into X86DAGToDAGISel::MatchWrapper

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68915 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd Kaleidoscope to examples/ so that it gets built regularly and we'll notice
Nick Lewycky [Sun, 12 Apr 2009 20:47:23 +0000 (20:47 +0000)]
Add Kaleidoscope to examples/ so that it gets built regularly and we'll notice
if an API change causes it to be out of date. The code is copied out of
LangImpl7.html.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68912 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix compile error. Pointed out by mait on #llvm IRC!
Nick Lewycky [Sun, 12 Apr 2009 20:15:44 +0000 (20:15 +0000)]
Fix compile error. Pointed out by mait on #llvm IRC!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68910 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago"There was a typo in my previous patch which leads to miscompilation of
Chris Lattner [Sun, 12 Apr 2009 18:22:33 +0000 (18:22 +0000)]
"There was a typo in my previous patch which leads to miscompilation of
strncat :(

strncat(foo, "bar", 99)
would be optimized to
memcpy(foo+strlen(foo), "bar", 100, 1)
instead of
memcpy(foo+strlen(foo), "bar", 4, 1)"

Patch by Benjamin Kramer!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68905 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd tests for the parts of X86-64 TLS that are already implemented.
Rafael Espindola [Sun, 12 Apr 2009 10:43:41 +0000 (10:43 +0000)]
Add tests for the parts of X86-64 TLS that are already implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68901 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix a cross-block fastisel crash handling overflow intrinsics.
Chris Lattner [Sun, 12 Apr 2009 07:51:14 +0000 (07:51 +0000)]
fix a cross-block fastisel crash handling overflow intrinsics.
See comment for details.  This fixes rdar://6772169

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68890 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake UpdateValueMap handle the possiblity that we could be
Chris Lattner [Sun, 12 Apr 2009 07:46:30 +0000 (07:46 +0000)]
make UpdateValueMap handle the possiblity that we could be
copying into the right register, avoiding a copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68889 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agooptimize FastISel::UpdateValueMap to avoid duplicate map lookups,
Chris Lattner [Sun, 12 Apr 2009 07:45:01 +0000 (07:45 +0000)]
optimize FastISel::UpdateValueMap to avoid duplicate map lookups,
and make it return the assigned register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68888 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosimplify code by using IntrinsicInst.
Chris Lattner [Sun, 12 Apr 2009 07:36:01 +0000 (07:36 +0000)]
simplify code by using IntrinsicInst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68887 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd new TargetInstrDesc::hasImplicitUseOfPhysReg and
Chris Lattner [Sun, 12 Apr 2009 07:26:51 +0000 (07:26 +0000)]
Add new TargetInstrDesc::hasImplicitUseOfPhysReg and
hasImplicitDefOfPhysReg methods.  Use them to remove a
look in X86 fast isel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68886 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd some optimizations for strncpy/strncat and factor some
Chris Lattner [Sun, 12 Apr 2009 05:06:39 +0000 (05:06 +0000)]
add some optimizations for strncpy/strncat and factor some
code.  Patch by Benjamin Kramer!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68885 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert r68847. It breaks the build on non-Darwin targets, with this message
Dan Gohman [Sat, 11 Apr 2009 15:57:04 +0000 (15:57 +0000)]
Revert r68847. It breaks the build on non-Darwin targets, with this message
from the assembler:

Error: unknown pseudo-op: `.debug_inlined'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68863 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoKeep track of inlined functions and their locations. This information is collected...
Devang Patel [Sat, 11 Apr 2009 00:16:47 +0000 (00:16 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68847 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomove a target-specific test into its directory so it isn't run if you
Chris Lattner [Fri, 10 Apr 2009 23:58:38 +0000 (23:58 +0000)]
move a target-specific test into its directory so it isn't run if you
don't configure the ARM target in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68843 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed spelling.
Misha Brukman [Fri, 10 Apr 2009 20:48:27 +0000 (20:48 +0000)]
Fixed spelling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68821 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDebugLabelFolder ruthlessly deletes redundant labels. However, sometimes the redundan...
Devang Patel [Fri, 10 Apr 2009 18:58:59 +0000 (18:58 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68813 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoClean up a bunch of whitespace issues and fix a comment typo.
Bob Wilson [Fri, 10 Apr 2009 18:48:47 +0000 (18:48 +0000)]
Clean up a bunch of whitespace issues and fix a comment typo.
No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68808 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't install the libLLVMHello.dylib example.
Bill Wendling [Fri, 10 Apr 2009 18:48:38 +0000 (18:48 +0000)]
Don't install the libLLVMHello.dylib example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68807 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd compatibility_version and current_version flags when creating dylibs.
Bill Wendling [Fri, 10 Apr 2009 18:20:41 +0000 (18:20 +0000)]
Add compatibility_version and current_version flags when creating dylibs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68801 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't run "dsymutils" on .a files.
Bill Wendling [Fri, 10 Apr 2009 17:45:16 +0000 (17:45 +0000)]
Don't run "dsymutils" on .a files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68795 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix two problems with machine sinking:
Chris Lattner [Fri, 10 Apr 2009 16:38:36 +0000 (16:38 +0000)]
fix two problems with machine sinking:
1. Sinking would crash when the first instruction of a block was
   sunk due to iterator problems.
2. Instructions could be sunk to their current block, causing an
   infinite loop.

This fixes PR3968

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68787 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoNow that register classes have names, include the name in debug output.
Dan Gohman [Fri, 10 Apr 2009 15:59:38 +0000 (15:59 +0000)]
Now that register classes have names, include the name in debug output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68786 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix a broken assertion in ilist_iterator, which caused it to crash in the
Chris Lattner [Fri, 10 Apr 2009 15:47:17 +0000 (15:47 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68785 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix typo, patch by Shlomi Fish!
Chris Lattner [Fri, 10 Apr 2009 15:38:51 +0000 (15:38 +0000)]
fix typo, patch by Shlomi Fish!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68784 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded code to handle spilling and reloading of FSRs.
Sanjiv Gupta [Fri, 10 Apr 2009 15:10:14 +0000 (15:10 +0000)]
Added code to handle spilling and reloading of FSRs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68783 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't fold a load if the other operand is a TLS address.
Rafael Espindola [Fri, 10 Apr 2009 10:09:34 +0000 (10:09 +0000)]
Don't fold a load if the other operand is a TLS address.

With this we generate

movl    %gs:0, %eax
leal    i@NTPOFF(%eax), %eax

instead of

movl    $i@NTPOFF, %eax
addl    %gs:0, %eax

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68778 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCleanup. Remove redundant llvm:: , we don't need them since we're inside
Nick Lewycky [Fri, 10 Apr 2009 06:54:06 +0000 (06:54 +0000)]
Cleanup. Remove redundant llvm:: , we don't need them since we're inside
namespace llvm already.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68774 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a new Type::getPointerTo method, which is shorthand for
Chris Lattner [Fri, 10 Apr 2009 06:42:02 +0000 (06:42 +0000)]
Add a new Type::getPointerTo method, which is shorthand for
llvm::PointerType::get().  Patch by Anders Johnsen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68772 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd utility function to IRBuilder that takes the difference between two
Nick Lewycky [Fri, 10 Apr 2009 05:30:48 +0000 (05:30 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68768 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRegenerate.
Nick Lewycky [Fri, 10 Apr 2009 05:18:27 +0000 (05:18 +0000)]
Regenerate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68767 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoa few fixes to "addrspace(256) is reference offset of GS segment register".
Chris Lattner [Fri, 10 Apr 2009 00:16:23 +0000 (00:16 +0000)]
a few fixes to "addrspace(256) is reference offset of GS segment register".

It turns out that there are still several problems with this, will file a bugzilla.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68749 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPass in the std::string parameter instead of returning it by value.
Bill Wendling [Fri, 10 Apr 2009 00:12:49 +0000 (00:12 +0000)]
Pass in the std::string parameter instead of returning it by value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68747 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoConstify getter methods.
Bill Wendling [Fri, 10 Apr 2009 00:00:25 +0000 (00:00 +0000)]
Constify getter methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68745 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove the obsolete SelectionDAG::getNodeValueTypes and simplify
Dan Gohman [Thu, 9 Apr 2009 23:54:40 +0000 (23:54 +0000)]
Remove the obsolete SelectionDAG::getNodeValueTypes and simplify
code that uses it by using SelectionDAG::getVTList instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68744 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange the NumVTs field from short to int, since there's no
Dan Gohman [Thu, 9 Apr 2009 23:53:31 +0000 (23:53 +0000)]
Change the NumVTs field from short to int, since there's no
real need for it to be short.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68742 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStringMap<DIE*>::iterator::first() returns a pointer to the first character of
Bill Wendling [Thu, 9 Apr 2009 23:51:31 +0000 (23:51 +0000)]
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*".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68741 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSilence unused variable warning.
Devang Patel [Thu, 9 Apr 2009 23:45:17 +0000 (23:45 +0000)]
Silence unused variable warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68735 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoignore register zero in isRegTiedToUseOperand, following the example of
Chris Lattner [Thu, 9 Apr 2009 23:33:34 +0000 (23:33 +0000)]
ignore register zero in isRegTiedToUseOperand, following the example of
isRegTiedToDefOperand.  Thanks to Bob for pointing this out!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68734 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGive register alias checking the hash table treatment too.
Owen Anderson [Thu, 9 Apr 2009 22:19:30 +0000 (22:19 +0000)]
Give register alias checking the hash table treatment too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68730 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse a StringMap instead of std::map for storing std::string->DIE* maps. This
Bill Wendling [Thu, 9 Apr 2009 21:49:15 +0000 (21:49 +0000)]
Use a StringMap instead of std::map for storing std::string->DIE* maps. This
gives a micro speedup in the Dwarf writer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68728 91177308-0d34-0410-b5e6-96231b3b80d8