oota-llvm.git
14 years agoSimplify this code by using use_iterator instead of reg_iterator
Dan Gohman [Fri, 25 Sep 2009 22:24:52 +0000 (22:24 +0000)]
Simplify this code by using use_iterator instead of reg_iterator
and skipping the defs.

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

14 years agoCode clean up and prepare for Thumb2 support. No functionality changes.
Evan Cheng [Fri, 25 Sep 2009 21:44:53 +0000 (21:44 +0000)]
Code clean up and prepare for Thumb2 support. No functionality changes.

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

14 years agoFlip -disable-post-RA-scheduler to -post-RA-scheduler.
Evan Cheng [Fri, 25 Sep 2009 21:38:11 +0000 (21:38 +0000)]
Flip -disable-post-RA-scheduler to -post-RA-scheduler.

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

14 years agoFix a compile failure introduced by r82675 on MinGW which doesn't have
Jeffrey Yasskin [Fri, 25 Sep 2009 21:07:20 +0000 (21:07 +0000)]
Fix a compile failure introduced by r82675 on MinGW which doesn't have
setenv().  This patch just disables the test rather than getting putenv() to
work.  Thanks to Sandeep Patel for reporting the problem.

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

14 years agoHandle sqrt in CannotBeNegativeZero. absf and absl
Dale Johannesen [Fri, 25 Sep 2009 20:54:50 +0000 (20:54 +0000)]
Handle sqrt in CannotBeNegativeZero.  absf and absl
appear to be misspellings, removed in favor of fabs*.

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

14 years agoImprove MachineMemOperand handling.
Dan Gohman [Fri, 25 Sep 2009 20:36:54 +0000 (20:36 +0000)]
Improve MachineMemOperand handling.
 - Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions.
   This eliminates MachineInstr's std::list member and allows the data to be
   created by isel and live for the remainder of codegen, avoiding a lot of
   copying and unnecessary translation. This also shrinks MemSDNode.
 - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated
   fields for MachineMemOperands.
 - Change MemSDNode to have a MachineMemOperand member instead of its own
   fields with the same information. This introduces some redundancy, but
   it's more consistent with what MachineInstr will eventually want.
 - Ignore alignment when searching for redundant loads for CSE, but remember
   the greatest alignment.

Target-specific code which previously used MemOperandSDNodes with generic
SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range
so that the SelectionDAG framework knows that MachineMemOperand information
is available.

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

14 years agoRename getTargetNode to getMachineNode, for consistency with the
Dan Gohman [Fri, 25 Sep 2009 18:54:59 +0000 (18:54 +0000)]
Rename getTargetNode to getMachineNode, for consistency with the
naming scheme used in SelectionDAG, where there are multiple kinds
of "target" nodes, but "machine" nodes are nodes which represent
a MachineInstr.

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

14 years agoFinish scheduling itineraries for NEON.
David Goodwin [Fri, 25 Sep 2009 18:38:29 +0000 (18:38 +0000)]
Finish scheduling itineraries for NEON.

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

14 years agoAdd readonly to some sin and cos calls; transformations
Dale Johannesen [Fri, 25 Sep 2009 18:15:29 +0000 (18:15 +0000)]
Add readonly to some sin and cos calls; transformations
being checked aren't valid without it.

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

14 years agoRevert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes...
Victor Hernandez [Fri, 25 Sep 2009 18:11:52 +0000 (18:11 +0000)]
Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes regressions in the nightly tests.

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

14 years agoMake sure sin, cos, sqrt calls are marked readonly
Dale Johannesen [Fri, 25 Sep 2009 18:00:35 +0000 (18:00 +0000)]
Make sure sin, cos, sqrt calls are marked readonly
before producing FSIN, FCOS, FSQRT.  If they aren't
so marked we have to assume they might set errno.

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

14 years agoreject attempts to use ()'s in patterns, these are reserved for filecheck.
Chris Lattner [Fri, 25 Sep 2009 17:29:36 +0000 (17:29 +0000)]
reject attempts to use ()'s in patterns, these are reserved for filecheck.

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

14 years agoreimplement the regex matching strategy by building a single
Chris Lattner [Fri, 25 Sep 2009 17:23:43 +0000 (17:23 +0000)]
reimplement the regex matching strategy by building a single
regex and matching it instead of trying to match chunks at a time.
Matching chunks at a time broke with check lines like
  CHECK: foo {{.*}}bar
because the .* would eat the entire rest of the line and bar would
never match.

Now we just escape the fixed strings for the user, so that something
like:
  CHECK: a() {{.*}}???
is matched as:
  CHECK: {{a\(\) .*\?\?\?}}
transparently "under the covers".

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

14 years agoGenerate FSQRT from calls to the sqrt function, which
Dale Johannesen [Fri, 25 Sep 2009 17:23:22 +0000 (17:23 +0000)]
Generate FSQRT from calls to the sqrt function, which
allows appropriate backends to generate a sqrt instruction.

On x86, this isn't done at -O0 because we go through
FastISel instead.  This is a behavior change from before
this series of sqrt patches started.  I think this is OK
considering that compile speed is most important at -O0, but
could be convinced otherwise.

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

14 years agospecial case Patterns that are a single fixed string. This is a microscopic
Chris Lattner [Fri, 25 Sep 2009 17:09:12 +0000 (17:09 +0000)]
special case Patterns that are a single fixed string.  This is a microscopic
perf win and is needed for future changes.

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

14 years agoRevise C library functions description to be vaguer, per Chris.
Dale Johannesen [Fri, 25 Sep 2009 17:04:42 +0000 (17:04 +0000)]
Revise C library functions description to be vaguer, per Chris.

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

14 years agoThis patch causes the --enable-debug-runtime configure flag and the
Jeffrey Yasskin [Fri, 25 Sep 2009 16:46:09 +0000 (16:46 +0000)]
This patch causes the --enable-debug-runtime configure flag and the
DEBUG_RUNTIME Makefile variable to pass -g to gcc when building LLVM's objects.
Without this, it's very hard to debug crashes that happen in Release-Asserts
mode but not Debug mode.

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

14 years agoAdd some comments to clarify things that I discovered this week.
Bob Wilson [Fri, 25 Sep 2009 16:34:46 +0000 (16:34 +0000)]
Add some comments to clarify things that I discovered this week.

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

14 years agoMake llvm-bcanalyzer percentages more readable.
Daniel Dunbar [Fri, 25 Sep 2009 16:04:21 +0000 (16:04 +0000)]
Make llvm-bcanalyzer percentages more readable.

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

14 years agoStrip trailing whitespace.
Daniel Dunbar [Fri, 25 Sep 2009 16:03:57 +0000 (16:03 +0000)]
Strip trailing whitespace.

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

14 years agopr4926: ARM requires the stack pointer to be aligned, even for leaf functions.
Bob Wilson [Fri, 25 Sep 2009 14:41:49 +0000 (14:41 +0000)]
pr4926: ARM requires the stack pointer to be aligned, even for leaf functions.
For the AAPCS ABI, SP must always be 4-byte aligned, and at any "public
interface" it must be 8-byte aligned.  For the older ARM APCS ABI, the stack
alignment is just always 4 bytes.  For X86, we currently align SP at
entry to a function (e.g., to 16 bytes for Darwin), but no stack alignment
is needed at other times, such as for a leaf function.

After discussing this with Dan, I decided to go with the approach of adding
a new "TransientStackAlignment" field to TargetFrameInfo.  This value
specifies the stack alignment that must be maintained even in between calls.
It defaults to 1 except for ARM, where it is 4.  (Some other targets may
also want to set this if they have similar stack requirements. It's not
currently required for PPC because it sets targetHandlesStackFrameRounding
and handles the alignment in target-specific code.) The existing StackAlignment
value specifies the alignment upon entry to a function, which is how we've
been using it anyway.

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

14 years agoPrint INST_INBOUNDS_GEP rather than UnknownCode30.
Duncan Sands [Fri, 25 Sep 2009 12:28:37 +0000 (12:28 +0000)]
Print INST_INBOUNDS_GEP rather than UnknownCode30.
Likewise for constant inbounds GEP.

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

14 years agoconvert testcases to filecheck.
Chris Lattner [Fri, 25 Sep 2009 06:49:41 +0000 (06:49 +0000)]
convert testcases to filecheck.

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

14 years agofilecheck should not match a \n with a .
Chris Lattner [Fri, 25 Sep 2009 06:47:09 +0000 (06:47 +0000)]
filecheck should not match a \n with a .

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

14 years agoremove a large unreduced testcase
Chris Lattner [Fri, 25 Sep 2009 06:37:22 +0000 (06:37 +0000)]
remove a large unreduced testcase

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

14 years agoturn a std::pair into a real class.
Chris Lattner [Fri, 25 Sep 2009 06:32:47 +0000 (06:32 +0000)]
turn a std::pair into a real class.

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

14 years agoFix combiner-aa issue with bases which are different, but can alias.
Nate Begeman [Fri, 25 Sep 2009 06:05:26 +0000 (06:05 +0000)]
Fix combiner-aa issue with bases which are different, but can alias.
Previously, it treated GV+28 GV+0 as different bases, and assumed they could
not alias.

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

14 years agoUpdate the description of MachineFrameInfo's OffsetAdjustment. The value of
Bob Wilson [Fri, 25 Sep 2009 05:30:55 +0000 (05:30 +0000)]
Update the description of MachineFrameInfo's OffsetAdjustment.  The value of
this adjustment does not change the direction or the signs of the object
offsets, and the details of the offset calculations can be target-specific.
Also mention that for most targets this value is only used to generate debug
info.

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

14 years agoDon't try to use pre-indexed addressing with sthbrx/stwbrx
Dan Gohman [Fri, 25 Sep 2009 00:57:30 +0000 (00:57 +0000)]
Don't try to use pre-indexed addressing with sthbrx/stwbrx
instructions. This fixes a PowerPC bug exposed by some unrelated
changes I'm working on.

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

14 years agoAdd a version of dumpr() that has a SelectionDAG* argument.
Dan Gohman [Fri, 25 Sep 2009 00:34:34 +0000 (00:34 +0000)]
Add a version of dumpr() that has a SelectionDAG* argument.

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

14 years agoStart of revamping the register scavenging in PEI. ARM Thumb1 is the driving
Jim Grosbach [Thu, 24 Sep 2009 23:52:18 +0000 (23:52 +0000)]
Start of revamping the register scavenging in PEI. ARM Thumb1 is the driving
interest for this, as it currently reserves a register rather than using
the scavenger for matierializing constants as needed.

Instead of scavenging registers on the fly while eliminating frame indices,
new virtual registers are created, and then a scavenged collectively in a
post-pass over the function. This isolates the bits that need to interact
with the scavenger, and sets the stage for more intelligent use, and reuse,
of scavenged registers.

For the time being, this is disabled by default. Once the bugs are worked out,
the current scavenging calls in replaceFrameIndices() will be removed and
the post-pass scavenging will be the default. Until then,
-enable-frame-index-scavenging enables the new code. Currently, only the
Thumb1 back end is set up to use it.

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

14 years agoReenable sqrt IR generation test.
Dale Johannesen [Thu, 24 Sep 2009 23:37:40 +0000 (23:37 +0000)]
Reenable sqrt IR generation test.

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

14 years agoDelete space after function name, before (, reflow a comment and
Mike Stump [Thu, 24 Sep 2009 23:21:26 +0000 (23:21 +0000)]
Delete space after function name, before (, reflow a comment and
delete a few blank lines.

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

14 years agoFix spacing.
Mike Stump [Thu, 24 Sep 2009 23:11:08 +0000 (23:11 +0000)]
Fix spacing.

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

14 years agoadd and document regex support for FileCheck. You can now do stuff like:
Chris Lattner [Thu, 24 Sep 2009 21:47:32 +0000 (21:47 +0000)]
add and document regex support for FileCheck.  You can now do stuff like:

; CHECK: movl {{%e[a-z][xi]}}, %eax

or whatever.

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

14 years agounconditionally request MMI
Chris Lattner [Thu, 24 Sep 2009 21:45:57 +0000 (21:45 +0000)]
unconditionally request MMI

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

14 years agowrap long lines.
Chris Lattner [Thu, 24 Sep 2009 21:44:20 +0000 (21:44 +0000)]
wrap long lines.

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

14 years agoUse CanonicalizeInputFile to canonicalize the entire buffer containing the
Chris Lattner [Thu, 24 Sep 2009 20:45:07 +0000 (20:45 +0000)]
Use CanonicalizeInputFile to canonicalize the entire buffer containing the
CHECK strings, instead of canonicalizing the patterns directly.  This allows
Pattern to just contain a StringRef instead of std::string.

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

14 years agochange 'not' matching to use Pattern, move pattern parsing logic into
Chris Lattner [Thu, 24 Sep 2009 20:39:13 +0000 (20:39 +0000)]
change 'not' matching to use Pattern, move pattern parsing logic into
the Pattern class.

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

14 years agorefactor out the match string into its own Pattern class.
Chris Lattner [Thu, 24 Sep 2009 20:25:55 +0000 (20:25 +0000)]
refactor out the match string into its own Pattern class.

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

14 years agoConvert to FileCheck.
Bob Wilson [Thu, 24 Sep 2009 20:23:02 +0000 (20:23 +0000)]
Convert to FileCheck.

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

14 years agoMake the end-of-itinerary mark explicit. Some cleanup.
David Goodwin [Thu, 24 Sep 2009 20:22:50 +0000 (20:22 +0000)]
Make the end-of-itinerary mark explicit. Some cleanup.

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

14 years agoAdd nounwind to this test.
Dan Gohman [Thu, 24 Sep 2009 20:20:08 +0000 (20:20 +0000)]
Add nounwind to this test.

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

14 years agotidy up, fix a memory leak in Regex::isValid
Chris Lattner [Thu, 24 Sep 2009 20:15:51 +0000 (20:15 +0000)]
tidy up, fix a memory leak in Regex::isValid

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

14 years agoClarify that llvm attaches C language semantics to
Dale Johannesen [Thu, 24 Sep 2009 18:38:21 +0000 (18:38 +0000)]
Clarify that llvm attaches C language semantics to
functions with names that match the C library.

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

14 years agoConstant propagating byval pointer is safe if function is readonly.
Torok Edwin [Thu, 24 Sep 2009 18:33:42 +0000 (18:33 +0000)]
Constant propagating byval pointer is safe if function is readonly.

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

14 years agoAuto-upgrade malloc instructions to malloc calls.
Victor Hernandez [Thu, 24 Sep 2009 17:47:49 +0000 (17:47 +0000)]
Auto-upgrade malloc instructions to malloc calls.

Reviewed by Devang Patel.

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

14 years agoFix a hypothetical problem for targets with StackGrowsUp and a non-zero
Bob Wilson [Thu, 24 Sep 2009 16:42:27 +0000 (16:42 +0000)]
Fix a hypothetical problem for targets with StackGrowsUp and a non-zero
LocalAreaOffset.  (We don't have any of those right now.)
PEI::calculateFrameObjectOffsets includes the absolute value of the
LocalAreaOffset in the cumulative offset value used to calculate the
stack frame size.  It then adds the raw value of the LocalAreaOffset
to the stack size.  For a StackGrowsDown target, that raw value is negative
and has the effect of cancelling out the absolute value that was added
earlier, but that obviously won't work for a StackGrowsUp target.  Change
to subtract the absolute value of the LocalAreaOffset.

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

14 years agoMove parent assertion check before metadata deletion.
Devang Patel [Thu, 24 Sep 2009 16:19:11 +0000 (16:19 +0000)]
Move parent assertion check before metadata deletion.

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

14 years agoDon't constant propagate byval pointers, since they are not really pointers, but
Torok Edwin [Thu, 24 Sep 2009 09:47:18 +0000 (09:47 +0000)]
Don't constant propagate byval pointers, since they are not really pointers, but
rather structs passed by value.
This fixes PR5038.

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

14 years agoAdd count/not tools as executables.
Daniel Dunbar [Thu, 24 Sep 2009 06:23:57 +0000 (06:23 +0000)]
Add count/not tools as executables.
 - Apparently, I'm willing to do incredibly stupid things in the name of portability.

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

14 years agounconditionally compute MMI even if the target doesn't support EH or Debug info,...
Chris Lattner [Thu, 24 Sep 2009 05:44:53 +0000 (05:44 +0000)]
unconditionally compute MMI even if the target doesn't support EH or Debug info, because the target may use it for other things, this fixes PR5036

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

14 years agoreapply r82348 with a fix, thanks Jeffrey.
Chris Lattner [Thu, 24 Sep 2009 05:38:36 +0000 (05:38 +0000)]
reapply r82348 with a fix, thanks Jeffrey.

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

14 years agoFix PR5024 with a big hammer: disable the double-def assertion in the scavenger.
Evan Cheng [Thu, 24 Sep 2009 02:27:09 +0000 (02:27 +0000)]
Fix PR5024 with a big hammer: disable the double-def assertion in the scavenger.

LiveVariables add implicit kills to correctly track partial register kills. This works well enough and is fairly accurate. But coalescer can make it impossible to maintain these markers. e.g.

        BL <ga:sss1>, %R0<kill,undef>, %S0<kill>, %R0<imp-def>, %R1<imp-def,dead>, %R2<imp-def,dead>, %R3<imp-def,dead>, %R12<imp-def,dead>, %LR<imp-def,dead>, %D0<imp-def>, ...
...
%reg1031<def> = FLDS <cp#1>, 0, 14, %reg0, Mem:LD4[ConstantPool]
...
    %S0<def> = FCPYS %reg1031<kill>, 14, %reg0, %D0<imp-use,kill>

When reg1031 and S0 are coalesced, the copy (FCPYS) will be eliminated the the implicit-kill of D0 is lost. In this case it's possible to move the marker to the FLDS. But in many cases, this is not possible. Suppose

%reg1031<def> = FOO <cp#1>, %D0<imp-def>
...
    %S0<def> = FCPYS %reg1031<kill>, 14, %reg0, %D0<imp-use,kill>

When FCPYS goes away, the definition of S0 is the "FOO" instruction. However, transferring the D0 implicit-kill to FOO doesn't work since it is the def of D0 itself. We need to fix this in another time by introducing a "kill" pseudo instruction to track liveness.

Disabling the assertion is not ideal, but machine verifier is doing that job now. It's important to know double-def is not a miscomputation since it means a register should be free but it's not tracked as free. It's a performance issue instead.

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

14 years agoClean up LiveVariables and change how it deals with partial updates and kills. This...
Evan Cheng [Thu, 24 Sep 2009 02:15:22 +0000 (02:15 +0000)]
Clean up LiveVariables and change how it deals with partial updates and kills. This also eliminate the horrible check which scan forward to the end of the basic block. It should be faster and more accurate.

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

14 years agoRoll back r82348, which introduced an infinite loop in ParseCStringVector() that
Jeffrey Yasskin [Thu, 24 Sep 2009 01:14:07 +0000 (01:14 +0000)]
Roll back r82348, which introduced an infinite loop in ParseCStringVector() that
a trivial unittest would have caught.  This revision also adds the trivial
unittest.

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

14 years agoA minor improvment in accuracy to inline cost
Dale Johannesen [Wed, 23 Sep 2009 22:05:24 +0000 (22:05 +0000)]
A minor improvment in accuracy to inline cost
computation, and some cosmetics.

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

14 years agoDisable test; what it's testing for is wrong.
Dale Johannesen [Wed, 23 Sep 2009 21:46:36 +0000 (21:46 +0000)]
Disable test; what it's testing for is wrong.

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

14 years agoCheckpoint NEON scheduling itineraries.
David Goodwin [Wed, 23 Sep 2009 21:38:08 +0000 (21:38 +0000)]
Checkpoint NEON scheduling itineraries.

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

14 years agoUse getStoreSize() instead of getStoreSizeInBits()/8.
Dan Gohman [Wed, 23 Sep 2009 21:07:02 +0000 (21:07 +0000)]
Use getStoreSize() instead of getStoreSizeInBits()/8.

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

14 years agoSpruce up some comments.
Dan Gohman [Wed, 23 Sep 2009 21:06:36 +0000 (21:06 +0000)]
Spruce up some comments.

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

14 years agoRename several variables from EVT to more descriptive names, now that EVT
Dan Gohman [Wed, 23 Sep 2009 21:02:20 +0000 (21:02 +0000)]
Rename several variables from EVT to more descriptive names, now that EVT
is also the name of their type, as declarations like "EVT EVT" look
really odd.

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

14 years agoAdd an EVT::getStoreSize function, like getStoreSizeInBits but in bytes.
Dan Gohman [Wed, 23 Sep 2009 20:59:10 +0000 (20:59 +0000)]
Add an EVT::getStoreSize function, like getStoreSizeInBits but in bytes.

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

14 years agoFix verification of explicit operands.
Jakob Stoklund Olesen [Wed, 23 Sep 2009 20:57:55 +0000 (20:57 +0000)]
Fix verification of explicit operands.

The machine code verifier did not check for explicit operands correctly. It
used MachineInstr::getNumExplicitOperands, but that method may cheat and use
the declared count in the TargetInstrDesc.

Now we check the explicit operands one at a time in visitMachineOperand.

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

14 years agoRemove BlackfinRegisterInfo::getFrameIndexOffset since it is the same as the
Bob Wilson [Wed, 23 Sep 2009 20:57:02 +0000 (20:57 +0000)]
Remove BlackfinRegisterInfo::getFrameIndexOffset since it is the same as the
default implementation.  Update comment on the default version, which made it
sound like most targets override it.  Currently only X86 and SystemZ override
this method.

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

14 years agoCorrect a comment.
Dan Gohman [Wed, 23 Sep 2009 20:40:16 +0000 (20:40 +0000)]
Correct a comment.

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

14 years agoDelete attached metadata when an instruction is deleted.
Devang Patel [Wed, 23 Sep 2009 20:33:51 +0000 (20:33 +0000)]
Delete attached metadata when an instruction is deleted.

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

14 years agoARM does not support offset folding (yet). Disable it for now.
Anton Korobeynikov [Wed, 23 Sep 2009 19:04:09 +0000 (19:04 +0000)]
ARM does not support offset folding (yet). Disable it for now.
This fixes PR5031. Unfortunately, there is no small testcase :(

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

14 years agoEdit a comment.
Bob Wilson [Wed, 23 Sep 2009 18:53:19 +0000 (18:53 +0000)]
Edit a comment.

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

14 years agoDo not leave behind metadata while cloning an instruction.
Devang Patel [Wed, 23 Sep 2009 18:32:25 +0000 (18:32 +0000)]
Do not leave behind metadata while cloning an instruction.

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

14 years agoAdd nounwind.
Evan Cheng [Wed, 23 Sep 2009 18:20:27 +0000 (18:20 +0000)]
Add nounwind.

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

14 years agos/*Location/*DebugLocation/g
Devang Patel [Wed, 23 Sep 2009 17:20:43 +0000 (17:20 +0000)]
s/*Location/*DebugLocation/g

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

14 years agoPR4047: Permit configure --enable-targets=host,cpp for example. "host" has the
Jeffrey Yasskin [Wed, 23 Sep 2009 17:05:42 +0000 (17:05 +0000)]
PR4047: Permit configure --enable-targets=host,cpp for example.  "host" has the
same effect that "host-only" used to have, but can be combined with other
targets.  host-only is still available as a synonym but no longer documented.

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

14 years agoFix bug in kill flag updating for post-register-allocation scheduling. When the kill...
David Goodwin [Wed, 23 Sep 2009 16:35:25 +0000 (16:35 +0000)]
Fix bug in kill flag updating for post-register-allocation scheduling. When the kill flag of a superreg needs to be cleared because there are one or more subregs live, we instead add implicit-defs of those subregs and leave the kill flag on the superreg. This allows us to end the live-range of the superreg without ending the live-ranges of the subregs.

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

14 years agoFix a struct/class mismatch.
Benjamin Kramer [Wed, 23 Sep 2009 11:48:57 +0000 (11:48 +0000)]
Fix a struct/class mismatch.

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

14 years agoMake the type traits for a const pointer defer to those for a unqualified
John McCall [Wed, 23 Sep 2009 06:53:51 +0000 (06:53 +0000)]
Make the type traits for a const pointer defer to those for a unqualified
pointer, instead of providing independent values modelled on the default
implementation.

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

14 years agoFix PR5024. LiveVariables physical register defs should *commit* only after all
Evan Cheng [Wed, 23 Sep 2009 06:28:31 +0000 (06:28 +0000)]
Fix PR5024. LiveVariables physical register defs should *commit* only after all
of the defs are processed.
Also fix a implicit_def propagation bug: a implicit_def of a physical register
should be applied to uses of the sub-registers.

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

14 years agoFix a obvious logic error.
Evan Cheng [Wed, 23 Sep 2009 05:23:19 +0000 (05:23 +0000)]
Fix a obvious logic error.

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

14 years agopretty mechanical changes to match coding guidelines (blessed by sabre on IRC)
Gabor Greif [Wed, 23 Sep 2009 02:46:12 +0000 (02:46 +0000)]
pretty mechanical changes to match coding guidelines (blessed by sabre on IRC)

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

14 years agoerrorstr can be null, don't unconditionally set it. Only report that
Chris Lattner [Wed, 23 Sep 2009 02:03:49 +0000 (02:03 +0000)]
errorstr can be null, don't unconditionally set it.  Only report that
"the jit has not been linked in" if the interpreter failed.

This fixes a unit test failure.

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

14 years agoMake EngineBuilder return more error codes, by KS Sreeram.
Chris Lattner [Wed, 23 Sep 2009 01:46:04 +0000 (01:46 +0000)]
Make EngineBuilder return more error codes, by KS Sreeram.

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

14 years agoGive MachineMemOperand an operator<<, factoring out code from
Dan Gohman [Wed, 23 Sep 2009 01:33:16 +0000 (01:33 +0000)]
Give MachineMemOperand an operator<<, factoring out code from
two different places for printing MachineMemOperands.

Drop the virtual from Value::dump and instead give Value a
protected virtual hook that can be overridden by subclasses
to implement custom printing. This lets printing be more
consistent, and simplifies printing of PseudoSourceValue
values.

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

14 years agoFix X86's unfoldMemoryOperand to properly handle MachineMemOperands.
Dan Gohman [Wed, 23 Sep 2009 01:29:41 +0000 (01:29 +0000)]
Fix X86's unfoldMemoryOperand to properly handle MachineMemOperands.

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

14 years agoThis is overly constraining with respect to clang.
Mike Stump [Wed, 23 Sep 2009 00:13:30 +0000 (00:13 +0000)]
This is overly constraining with respect to clang.

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

14 years agoAdd examples for Kaleidoscope chapters 2 through 6.
Erick Tryzelaar [Tue, 22 Sep 2009 21:15:19 +0000 (21:15 +0000)]
Add examples for Kaleidoscope chapters 2 through 6.

Conflicts:

examples/Makefile

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

14 years agoRename Kaleidoscope to show that it's for Chapter 7 of the tutorial.
Erick Tryzelaar [Tue, 22 Sep 2009 21:15:00 +0000 (21:15 +0000)]
Rename Kaleidoscope to show that it's for Chapter 7 of the tutorial.

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

14 years agoSync c++ kaleidoscope tutorial with test.
Erick Tryzelaar [Tue, 22 Sep 2009 21:14:49 +0000 (21:14 +0000)]
Sync c++ kaleidoscope tutorial with test.

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

14 years agoAdd SetLocation() to allow IRBuilder user to set location info for an instruction...
Devang Patel [Tue, 22 Sep 2009 20:56:31 +0000 (20:56 +0000)]
Add SetLocation() to allow IRBuilder user to set location info for an instruction already created.

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

14 years agoCheck exisiting dbg MDKind first.
Devang Patel [Tue, 22 Sep 2009 20:54:13 +0000 (20:54 +0000)]
Check exisiting dbg MDKind first.

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

14 years agoNo need to verify that malloc's return type is i8*.
Victor Hernandez [Tue, 22 Sep 2009 18:50:03 +0000 (18:50 +0000)]
No need to verify that malloc's return type is i8*.

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

14 years agoUse early returns.
David Goodwin [Tue, 22 Sep 2009 16:47:52 +0000 (16:47 +0000)]
Use early returns.

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

14 years agoRevert "Don't allow formatted_ostream to be unbuffered, even if its underlying
Daniel Dunbar [Tue, 22 Sep 2009 16:33:42 +0000 (16:33 +0000)]
Revert "Don't allow formatted_ostream to be unbuffered, even if its underlying
buffer", while we work out a solution.

Dan convinced me that making debugging annoying for him is worse than 10x being
slower for me. :)

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

14 years ago... missed hiding a variable for MSVC only.
Daniel Dunbar [Tue, 22 Sep 2009 16:10:35 +0000 (16:10 +0000)]
... missed hiding a variable for MSVC only.

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

14 years agoHide MSVC specific CRT interaction behind _MSC_VER.
Daniel Dunbar [Tue, 22 Sep 2009 15:58:35 +0000 (15:58 +0000)]
Hide MSVC specific CRT interaction behind _MSC_VER.

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

14 years agoRemove the GetProcessId() call from Win32/Program.inc, take 2.
Mikhail Glushenkov [Tue, 22 Sep 2009 15:40:32 +0000 (15:40 +0000)]
Remove the GetProcessId() call from Win32/Program.inc, take 2.

GetProcessId() was introduced only in Windows XP, and we want to support earlier
versions.

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

14 years agoFix commento.
Daniel Dunbar [Tue, 22 Sep 2009 10:30:34 +0000 (10:30 +0000)]
Fix commento.

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

14 years agolit: When executing shell scripts internally, don't allow piped stderr on any
Daniel Dunbar [Tue, 22 Sep 2009 09:50:38 +0000 (09:50 +0000)]
lit: When executing shell scripts internally, don't allow piped stderr on any
commands except the last one, instead redirect the stderr to a temporary
file. This sidesteps a potential deadlocking issue.

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

14 years agoAdd a magic LLVM_DISABLE_CRT_DEBUG environment variable which we check in RegisterHan...
Daniel Dunbar [Tue, 22 Sep 2009 09:50:28 +0000 (09:50 +0000)]
Add a magic LLVM_DISABLE_CRT_DEBUG environment variable which we check in RegisterHandler and use to disable the Win32 crash dialogs. These are a major blocker to any kind of automated testing.

Also, tweak the 'lit' test runner to set this variable unconditionally.

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

14 years agoForgot this.
Evan Cheng [Tue, 22 Sep 2009 08:47:59 +0000 (08:47 +0000)]
Forgot this.

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

14 years agoFix PR5024. LiveVariables::FindLastPartialDef should return a set of sub-registers...
Evan Cheng [Tue, 22 Sep 2009 08:34:46 +0000 (08:34 +0000)]
Fix PR5024. LiveVariables::FindLastPartialDef should return a set of sub-registers that were defined by the last partial def, not just a single sub-register.

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