Commit Graph

7852 Commits

Author SHA1 Message Date
Chris Lattner
77942d4ee4 remove a dead class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 00:42:42 +00:00
Chris Lattner
6371ed5e2b random cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 00:35:30 +00:00
Eli Friedman
5aba5c0e88 Add check for completeness. Note that this doesn't actually have any
effect with the way the current code is structured.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 00:14:19 +00:00
Chris Lattner
33adcfb4d2 rename TAI -> MAI, being careful not to make MAILJMP instructions :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 21:43:10 +00:00
Bill Wendling
c75e7d2a06 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:54:03 +00:00
Bill Wendling
70357db30a Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:52:46 +00:00
Chris Lattner
af76e592c7 Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:48:53 +00:00
Bill Wendling
9c52affd37 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:46:59 +00:00
Bill Wendling
960bb85b21 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:41:06 +00:00
Bill Wendling
cbac788324 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79759 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:40:21 +00:00
Bill Wendling
fbb594f351 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:38:09 +00:00
Bill Wendling
c3115a02c5 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:30:53 +00:00
Bill Wendling
1e973aae79 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:26:23 +00:00
Bill Wendling
b7a89928f4 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:25:44 +00:00
Bill Wendling
0d6b1b1248 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:23:49 +00:00
Bill Wendling
8e6179fb13 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:18:03 +00:00
Bill Wendling
44ff7949c7 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:11:17 +00:00
Bill Wendling
fb98a43b31 Normalize how the 'namespace llvm {' is used in this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79750 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:08:44 +00:00
Bill Wendling
b22d8df162 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:07:03 +00:00
Bill Wendling
9311a22830 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:04:03 +00:00
Bill Wendling
3403bcd8f9 Convert DOUT to DEBUG(errs()...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79747 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:03:00 +00:00
Devang Patel
24f20e0832 Record variable debug info at ISel time directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 17:12:53 +00:00
Owen Anderson
02b10347bb Reapply r79708 with the appropriate fix for the case that still requires locking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 06:32:36 +00:00
Chris Lattner
895a55e66d revert r79708 + r79711
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79720 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 04:07:34 +00:00
Eric Christopher
8dde7c0ff1 Actually remove unused static. Previous commit removed trailing
whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 00:41:47 +00:00
Eric Christopher
4d7c18c49b Remove unused static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 00:40:45 +00:00
Owen Anderson
0b7401d3cd Ease contention on this lock by noticing that all writes to the VTs array will
be of (dynamically) constant values, so races on it are immaterial.  We just need
to ensure that at least one write has completed before return the pointer into it.

With this change, parllc exhibits essentially no overhead on 403.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 00:29:12 +00:00
Bill Wendling
636e258a53 Fix typo. Should check both values of RangeUse for 0. Patch by Marius Wachtler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79649 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 18:16:06 +00:00
Bill Wendling
a583c55864 Attempt to comment this code more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 22:02:24 +00:00
Daniel Dunbar
bc84ad95b7 Suppress build warning in -Asserts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79564 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 20:01:34 +00:00
Jim Grosbach
8fc3b6903a Check for shared landing pads when assigning call site values. Invokes which
share a landing pad should also use the same call site value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 01:03:48 +00:00
David Greene
5f3aeac9a7 Add missing forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 22:19:44 +00:00
David Greene
098612b0e8 Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79480 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 22:16:11 +00:00
David Greene
43c76fbba2 Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79479 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 22:08:26 +00:00
David Greene
2a711e36da Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 22:05:21 +00:00
David Greene
0d036d2e81 Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79476 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 22:02:07 +00:00
David Greene
eea1f4cdb7 Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79475 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 21:59:18 +00:00
David Greene
fc4da0cea8 Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79474 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 21:55:33 +00:00
David Greene
b2c66fc322 Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 21:52:55 +00:00
Daniel Dunbar
dddfd34e32 Switch to SmallString::str from SmallString::c_str, and remove
SmallString::c_str.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79456 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 20:07:03 +00:00
Dan Gohman
6a402dc952 Add an x86 peep that narrows TEST instructions to forms that use
a smaller encoding. These kinds of patterns are very frequent in
sqlite3, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 18:16:17 +00:00
David Goodwin
dc4bdcdef1 Use the schedule itinerary operand use/def cycle information to adjust dependence edge latency for post-RA scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 16:08:58 +00:00
Eli Friedman
d68eea2b6d PR4737: Fix a nasty bug in load narrowing with non-power-of-two types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 08:46:10 +00:00
Chris Lattner
663c2d2580 switch asmprinter to emit alignments through OutStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 06:12:02 +00:00
Chris Lattner
6c2f9e14fd eliminate AsmPrinter::SwitchToSection and just have clients
talk to the MCStreamer directly instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 05:49:37 +00:00
Lang Hames
8481e3b368 Added an option to have the PBQP allocator attempt coalescing during allocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 01:36:14 +00:00
Dan Gohman
2c9489d6e9 Be tidy and use a break to exit from a switch block rather than
just falling through the end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 23:52:48 +00:00
Dan Gohman
db8dc2b9fa Legalize the shift amount operand of SRL_PARTS, SHL_PARTS, and
SRA_PARTS, as is done for SRL, SHL, and SRA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79380 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 23:36:17 +00:00
Lang Hames
233fd9cea0 Changes DOUT references in the PBQP allocator to use DEBUG(errs() ...)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 23:34:50 +00:00
Jakob Stoklund Olesen
c0823fe7c6 Simplify RegScavenger::FindUnusedReg.
- Drop the Candidates argument and fix all callers. Now that RegScavenger
  tracks available registers accurately, there is no need to restict the
  search.
- Make sure that no aliases of the found register are in use. This was a potential bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 21:14:54 +00:00
David Greene
fe37ab335b Make various changes suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 19:22:55 +00:00
Chris Lattner
35c3531754 fix COFF targets (mingw/cygwin) to provide ehframe and LSDA sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 16:56:17 +00:00
Dan Gohman
da65822cfc Make tail merging handle blocks with repeated predecessors correctly, and
remove RemoveDuplicateSuccessor, as it is no longer necessary, and because
it breaks assumptions made in
MachineBasicBlock::isOnlyReachableByFallthrough.

Convert test/CodeGen/X86/omit-label.ll to FileCheck and add a testcase
for PR4732.

test/CodeGen/Thumb2/thumb2-ifcvt2.ll sees a diff with this commit due to
it being bugpoint-reduced to the point where it doesn't matter what the
condition for the branch is.

Add some more interesting code to
test/CodeGen/X86/2009-08-06-branchfolder-crash.ll, which is the testcase
that originally motivated the RemoveDuplicateSuccessor code, to help
verify that the original problem isn't being re-broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79338 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 15:18:18 +00:00
Chris Lattner
dabf07c70a Make AsmStreamer maintain a notion of the current section, pushing it up from the
MCAsmStreamer.  Based on this, eliminate the current section from AsmPrinter.

While I'm at it, clean up the last of the horrible "switch to null section" stuff
and add an assert.  This change is in preparation for completely eliminating 
asmprinter::switchtosection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79324 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 06:15:16 +00:00
Chris Lattner
6a66e585b8 add a horrible hack to the dwarf printer. It looks like mingw is not specifying
an EHFrame section, so we just emit ehframe data into a random section.

This is clearly bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 06:13:03 +00:00
Chris Lattner
1f50fc736e fix another bozo bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 04:34:36 +00:00
Chris Lattner
b49a30c109 fix accidentally inverted conditional and add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 04:33:15 +00:00
Chris Lattner
a006d4e60d turn this conditional into something humans might actually
be able to understand ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 04:30:35 +00:00
Jim Grosbach
606f3d696f cleanups per review. Mostly cosmetic, plus use SmallVector in place of std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79287 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 21:40:03 +00:00
Jim Grosbach
2962664227 Remove a bit more cruft from the sjlj moving to a backend pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 20:25:04 +00:00
Benjamin Kramer
ae68a19ef9 Update CMakeLists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 18:47:11 +00:00
Daniel Dunbar
5d17eddb0c Fix build warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 18:41:42 +00:00
Jim Grosbach
8b818d7e98 Move the sjlj exception handling conversions to a back-end pass where they
more properly belong. This allows removing the front-end conditionalized
SJLJ code, and cleans up the generated IR considerably. All of the
infrastructure code (calling _Unwind_SjLj_Register/Unregister, etc) is
added by the SjLjEHPrepare pass.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 16:41:22 +00:00
David Goodwin
fac8541dd4 Extend the instruction itinerary model to include the ability to indicate the def and use cycle for each operand. This additional information is optional, so existing itineraries do not need to be changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 16:02:57 +00:00
Chris Lattner
8f4b1ec02b the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 15:48:08 +00:00
Chris Lattner
975780bb59 change AsmPrinter to switch sections using AsmStreamer instead of
doing it directly.  This requires const'izing a bunch of stuff that
took sections, but this seems like the right semantic thing to do:
emitting a label to a section shouldn't mutate the MCSection object
itself, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 05:49:08 +00:00
Chris Lattner
f3ce009fcb give MCAsmStreamer a TargetAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79222 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 04:23:44 +00:00
Jakob Stoklund Olesen
66a39699fb Replace RegScavenger::DistanceMap with a simpler local algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 17:41:39 +00:00
Jakob Stoklund Olesen
e689ce626c Clean up the public interface of RegScavenger.
Remove unused methods and make others private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 17:41:20 +00:00
Jakob Stoklund Olesen
f7e8af925c Be more clever about regclasses in ScheduleDAGSDNodes::EmitCopyFromReg.
If two uses of a CopyFromReg want different regclasses, first try a common
sub-class, then fall back on the copy emitted in AddRegisterOperand. There is
no need for an assert here. The cross-class joiner usually cleans up nicely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 17:40:59 +00:00
Evan Cheng
8a9d5f96a5 Needs to check whether unaligned load / store of i64 is legal here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 23:41:42 +00:00
Bill Wendling
eb75364020 Remove <iostream>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79146 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 22:28:08 +00:00
Benjamin Kramer
bc037cfcde Unbreak build. Evan, please make sure my changes are correct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79133 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 20:46:16 +00:00
Jakob Stoklund Olesen
16b794d25a Refine EarlyClobber assert in register scavenger.
It is legal for an inline asm operand to use an earlyclobber register if the
use operand is tied to the earlyclobber operand. The issue is discussed here:

  http://gcc.gnu.org/ml/gcc/1999-04n/msg00431.html

We should perhaps let only the machine code verifier worry about these finer
details. EarlyClobber operands are not really interesting to the scavenger.

This fixes PR4528 for the third time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79122 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 18:16:58 +00:00
Jakob Stoklund Olesen
d62c9a697b Don't setCalleeSavedInfoValid() until spills are interted.
In a naked function, the flag is never set and getPristineRegs() returns an
empty list. That means naked functions are able to clobber callee saved
registers, but that is the whole point of naked functions.

This fixes PR4716.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 13:10:46 +00:00
Jakob Stoklund Olesen
4af85b2328 Allow double defs in the machine code verifier after the addPreRegAlloc passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 13:10:15 +00:00
Jakob Stoklund Olesen
7a1e872564 Update LocalRewriter::DistanceMap when inserting stack loads.
In the included test case, a stack load was not included in DistanceMap. That
caused TransferDeadness to ignore the instruction, leading to a scavenger
assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 11:03:03 +00:00
Evan Cheng
e96507c731 80 col violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 08:38:52 +00:00
Dan Gohman
0d24bfbf92 Simplify this code to not depend as much on CurMBB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 02:06:22 +00:00
Devang Patel
6325a5305e Do not completely skip subrange info for a zero sized array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79044 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 20:59:16 +00:00
Anton Korobeynikov
72977a45a8 Allow targets to specify their choice of calling conventions per
libcall. Take advantage of this in the ARM backend to rectify broken
choice of CC when hard float is in effect. PIC16 may want to see if
it could be of use in MakePIC16Libcall, which works unchanged.

Patch by Sandeep!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79033 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 20:10:52 +00:00
Bruno Cardoso Lopes
abd7514a68 *try* to use a better name to describe how common symbols are marked on the elf object file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79029 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 19:45:38 +00:00
Daniel Dunbar
575327b77e Add virtual printMCInst method to AsmPrinter, as a quick way to expose the API
to print one instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:43:57 +00:00
Evan Cheng
7cefd80bd5 Indentation change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78978 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 01:56:37 +00:00
Daniel Dunbar
7894578470 TargetRegistry: Change AsmPrinter constructor to be typed as returning an
AsmPrinter instance (instead of just a FunctionPass)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:48:47 +00:00
Owen Anderson
0e275dc538 Actually privatize a IntegerTypes, and fix a few bugs exposed by this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:27:32 +00:00
Owen Anderson
1d0be15f89 Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:58:54 +00:00
Bruno Cardoso Lopes
d163e8b14c Remove hack used to strip unwanted chars from section name
Use MCSectionELF methods as much as possible, removing some
ELFWriter methods which are now unused



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:25:27 +00:00
Daniel Dunbar
67d894ea64 TargetRegistry: Reorganize AsmPrinter construction so that clients pass in the
TargetAsmInfo. This eliminates a dependency on TargetMachine.h from
TargetRegistry.h, which technically was a layering violation.
 - Clients probably can only sensibly pass in the same TargetAsmInfo as the
   TargetMachine has, but there are only limited clients of this API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 19:38:51 +00:00
Jakob Stoklund Olesen
06789e23d1 Track pristine registers as if they were live-in in the register scavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78913 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 16:20:04 +00:00
Jakob Stoklund Olesen
a6b677d209 Use pristine register info in machine code verifier.
So far these registers are simply tracked as if they were live-in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78912 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 16:19:51 +00:00
Jakob Stoklund Olesen
4a0f08c5fc Add MachineFrameInfo::getPristineRegisters(MBB) method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 16:19:33 +00:00
David Goodwin
710461688b Add callback to allow target to adjust latency of schedule dependency edge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 16:05:04 +00:00
Bruno Cardoso Lopes
b808588a3a Change MCSectionELF to represent a section semantically instead of
syntactically as a string, very similiar to what Chris did with MachO.
The parsing support and validation is not introduced yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 05:07:35 +00:00
Dan Gohman
cf20ac4fd1 Various AsmWriter output cleanups. Use WriteAsOperand instead of
PrintUnmangledNameSafely.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 01:36:44 +00:00
David Goodwin
2ffb0ce7dc Fix counting of Post-RA scheduling stalls. Improve debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78843 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 21:47:46 +00:00
Lang Hames
f7c553e993 Added RegisterCoalescer to required passes for PBQP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78840 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 21:04:53 +00:00
Dan Gohman
46d505647d Use WriteAsOperand to print BasicBlock names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78838 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 20:56:56 +00:00
Dan Gohman
e45da0dce0 Fix a few more places to use PadToColumn instead of tabs. And fix
the basic block label printing to check whether a block has a name
before printing a comment character and whitespace for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 18:47:05 +00:00
Dan Gohman
a12e9d751b Use PadToColumn instead of tabs for aligning comments. Fix one place
that emitted unnecessary whitespace outside of VerboseAsm mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 18:32:22 +00:00
David Goodwin
1a8f36e3ce Enhance the InstrStage object to enable the specification of an Itinerary with overlapping stages. The default is to maintain the current behavior that the "next" stage immediately follows the previous one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 18:31:53 +00:00
Jim Grosbach
bff392384d Add catch block handling to SjLj exception handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78817 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 17:38:44 +00:00
Chris Lattner
a7ac47cee1 Change TargetAsmInfo to be constructed via TargetRegistry from a Target+Triple
pair instead of from a virtual method on TargetMachine.  This cuts the final
ties of TargetAsmInfo to TargetMachine, meaning that MC can now use 
TargetAsmInfo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 07:22:17 +00:00
Dan Gohman
da2775767b This logic was accidentally inverted in r78767.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 01:44:20 +00:00
Dan Gohman
26255adcaa Factor out the code for finding an available register for use
in breaking an anti-dependence into a separate function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78767 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 01:33:27 +00:00
Owen Anderson
23b9b19b1a Add contexts to some of the MVT APIs. No functionality change yet, just the infrastructure work needed to get the contexts to where they need to be first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78759 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 00:36:31 +00:00
Chris Lattner
e2b060161c Change the asmprinter to print the comment character before the
"inlineasmstart/end" strings so that the contents of the directive
are separate from the comment character.  This lets elf targets
get #APP/#NOAPP for free even if they don't use "#" as the comment
character.  This also allows hoisting the darwin stuff up to the
shared TAI class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78737 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 22:39:40 +00:00
David Goodwin
546952fd60 Allow a zero cycle stage to reserve/require a FU without advancing the cycle counter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 22:38:43 +00:00
Owen Anderson
766b5efd99 Fix warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 21:59:30 +00:00
Owen Anderson
825b72b057 Split EVT into MVT and EVT, the former representing _just_ a primitive type, while
the latter is capable of representing either a primitive or an extended type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:47:22 +00:00
Chris Lattner
b3ac6e40d9 "TAI::JumpTableDirective" is always null for current arm targets, simplify
the code based on this and make it fall through better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:29:57 +00:00
David Goodwin
7cd0118c36 Use DEBUG macro for debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:56:42 +00:00
David Goodwin
c93d8373c9 Add some debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:35:23 +00:00
Dan Gohman
ffef8acc3e Tidy #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 16:02:12 +00:00
Dan Gohman
00b0a243bd Remove unnecessary throw() specifications; LLVM doesn't use exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:35:57 +00:00
Dan Gohman
1b2d0b8397 Remove unnecessary casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:15:10 +00:00
Dan Gohman
d443ee6884 Add const qualifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 15:13:43 +00:00
Jakob Stoklund Olesen
8c54a62061 Rebuild RegScavenger::DistanceMap each time it is needed.
The register scavenger maintains a DistanceMap that maps MI pointers to their
distance from the top of the current MBB. The DistanceMap is built
incrementally in forward() and in bulk in findFirstUse(). It is used by
scavengeRegister() to determine which candidate register has the longest
unused interval.

Unfortunately the DistanceMap contents can become outdated. The first time
scavengeRegister() is called, the DistanceMap is filled to cover the MBB. If
then instructions are inserted in the MBB (as they always are following
scavengeRegister()), the recorded distances are too short. This causes bad
behaviour in the included test case where a register use /after/ the current
position is ignored because findFirstUse() thinks is is /before/ the current
position. A "using an undefined register" assertion follows promptly.

The fix is to build a fresh DistanceMap at the top of scavengeRegister(), and
discard it after use. This means that DistanceMap is no longer needed as a
RegScavenger member variable, and forward() doesn't need to update it.

The fix then discloses issue number two in the same test case: The candidate
search in scavengeRegister() finds a CSR that has been saved in the prologue,
but is currently unused. It would be both inefficient and wrong to spill such
a register in the emergency spill slot. In the present case, the emergency
slot restore is placed immediately before the normal epilogue restore, leading
to a "Redefining a live register" assertion.

Fix number two: When scavengerRegister() stumbles upon an unused register that
is overwritten later in the MBB, return that register early. It is important
to verify that the register is defined later in the MBB, otherwise it might be
an unspilled CSR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78650 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 06:25:12 +00:00
Daniel Dunbar
d4d415a1e7 Fix a -Asserts warning.
- Since the function is never called in NDEBUG mode, just dropped the DEBUG()
   uses here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78649 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 06:22:47 +00:00
David Goodwin
3a5f0d444c Replace DOUT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 01:44:26 +00:00
Jim Grosbach
1b747ad8a0 SjLj based exception handling unwinding support. This patch is nasty, brutish
and short. Well, it's kinda short. Definitely nasty and brutish.

The front-end generates the register/unregister calls into the SjLj runtime,
call-site indices and landing pad dispatch. The back end fills in the LSDA
with the call-site information provided by the front end. Catch blocks are
not yet implemented.

Built on Darwin and verified no llvm-core "make check" regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 00:09:57 +00:00
Lang Hames
52c1afcaea Modified VNInfo. The "copy" member is now a union which holds the copy for a register interval, or the defining register for a stack interval. Access is via getCopy/setCopy and getReg/setReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 23:43:28 +00:00
Dan Gohman
00edf39b34 Fix a bug in the DAGCombiner's handling of multiple linked
MERGE_VALUES nodes. Replacing the result values with the
operands in one MERGE_VALUES node may cause another
MERGE_VALUES node be CSE'd with the first one, and bring
its uses along, so that the first one isn't dead, as this
code expects. Fix this by iterating until the node is
really dead. This fixes PR4699.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 23:43:19 +00:00
Dan Gohman
a407ca16c2 Fix a bug where DAGCombine was producing an illegal ConstantFP
node after legalize, and remove the workaround code from the
ARM backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78615 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 23:15:10 +00:00
Owen Anderson
e50ed30282 Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 22:56:29 +00:00
Owen Anderson
4600d179fd Remove a bunch of debugging code that was slowing PBQP down by 25% or so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 21:49:45 +00:00
Owen Anderson
77547befdc Start moving TargetLowering away from using full MVTs and towards SimpleValueType, which will simplify the privatization of IntegerType in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 18:56:59 +00:00
Dan Gohman
eb1fedc62d Make this comment more closely reflect the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 16:50:32 +00:00
David Greene
b71d1b2fe2 Add support for printing loop structure information in asm comments.
This definitely slows down asm output so put it under an -asm-exuberant
flag.

This information is useful when doing static analysis of performance
issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 16:38:07 +00:00
David Goodwin
d94a4e5d8d Post RA scheduler changes. Introduce a hazard recognizer that uses the target schedule information to accurately model the pipeline. Update the scheduler to correctly handle multi-issue targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 15:55:25 +00:00
Bruno Cardoso Lopes
64a6b39417 Move ConstantExpr handling to ResolveConstantExpr method and also
add support for PtrToInt, Add, Mul.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78552 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 03:32:40 +00:00
Chris Lattner
93b6db3de9 sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 23:39:42 +00:00
Chris Lattner
892e182393 1. Make MCSection an abstract class.
2. Move section switch printing to MCSection virtual method which takes a
   TAI.  This eliminates textual formatting stuff from TLOF.
3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and 
   TLOFELF::AtIsCommentChar.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 22:41:53 +00:00
Chris Lattner
5277b22687 eliminate TargetLoweringObjectFileSparc in favor of a TAI hook.
A TAI hook is appropriate in this case because this is just an
asm syntax issue, not a semantic difference. TLOF should model
the semantics of the section.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:43:12 +00:00
Jakob Stoklund Olesen
17421d81fd Don't build illegal ops in DAGCombiner::SimplifyBinOpWithSameOpcodeHands().
Blackfin supports and/or/xor on i32 but not on i16. Teach
DAGCombiner::SimplifyBinOpWithSameOpcodeHands to not produce illegal nodes
after legalize ops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 20:42:17 +00:00
Bruno Cardoso Lopes
3e0094d969 ELF improvements:
Handle large integers, x86_fp80, ConstantAggregateZero, and two more ConstantExpr:
GetElementPtr and IntToPtr
Set SHF_MERGE bit for mergeable strings
Avoid zero initialized strings to be classified as a bss symbol
Don't allow common symbols to be classified as STB_WEAK
Add a constant to be used as a global value offset in data relocations 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78476 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 17:29:04 +00:00
Jakob Stoklund Olesen
6349668fca Clean out per-function data after the machine code verifier is done with it.
Also don't dereference old pointers after they have been deleted causing
random crashes when enabling the machine code verifier.

Ahem...

I have not included a test case for the crash. It hapened when enabling the
verifier on CodeGen/X86/2009-08-06-branchfolder-crash.ll.

The crash depends on an MBB being allocated at the same address as a
previously deleted MBB. I don't think that can be reproduced reliably.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78472 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 15:34:50 +00:00
Jakob Stoklund Olesen
710b13b2c2 Update the machine code verifier to keep up with the scavenger.
* Cleaner handling of <undef>.
* <def> takes precedence over <def,dead>.
* Implement the OK-to-redefine-a-register-that-was-
  live-in-but-has-not-been-used-before rule.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 13:19:25 +00:00
Jakob Stoklund Olesen
9390cd0e86 Remove RegisterScavenger::isSuperRegUsed(). This completely reverses the mistaken commit r77904.
Now there is no special treatment of instructions that redefine part of a
super-register. Instead, the super-register is marked with <imp-use,kill> and
<imp-def>. For instance, from LowerSubregs on ARM:

subreg: CONVERTING: %Q1<def> = INSERT_SUBREG %Q1<undef>, %D1<kill>, 5
subreg: %D2<def> = FCPYD %D1<kill>, 14, %reg0, %Q1<imp-def>

subreg: CONVERTING: %Q1<def> = INSERT_SUBREG %Q1, %D0<kill>, 6
subreg: %D3<def> = FCPYD %D0<kill>, 14, %reg0, %Q1<imp-use,kill>, %Q1<imp-def>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 13:19:10 +00:00
Jakob Stoklund Olesen
dffb051c21 Simplify RegScavenger::forward a bit more.
Verify that early clobber registers and their aliases are not used.

All changes to RegsAvailable are now done as a transaction so the order of
operands makes no difference.

The included test case is from PR4686. It has behaviour that was dependent on the order of operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78465 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 13:18:47 +00:00
Daniel Dunbar
8a1871d10b Fix some -Asserts unused variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 00:40:46 +00:00
Chris Lattner
5f51cd0579 code cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 23:42:01 +00:00
Chris Lattner
db0a9706e7 remove a bunch of now-dead crud from the asmprinter and TAI interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 23:16:27 +00:00
Evan Cheng
c40f613034 Back out some of recent register scavenger change by John Mosby. It broke a number of ARM tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 22:39:43 +00:00
Chris Lattner
23510d36ac tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 22:26:50 +00:00
Dale Johannesen
1c5a28706d Rewrite previous patch to follow Chris' stylistic
preference; no functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 17:41:29 +00:00
Evan Cheng
15c592ddff Another coalescer bug. When a dead copy is eliminated, transfer the kill to a def of the exact register rather than a super-register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 07:14:14 +00:00
Daniel Dunbar
08ada178b8 Update CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 03:59:06 +00:00
Dan Gohman
7db949df78 Fix a bunch of namespace pollution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 01:32:21 +00:00
Dan Gohman
748f98f908 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 01:26:06 +00:00
Evan Cheng
3a3cce59c4 Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 00:28:58 +00:00
Lang Hames
caaf120a67 Added legal stuff, fixed some formatting issues. Removed the graph generator stuff as it was only meant for debugging the solver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 00:25:12 +00:00
Lang Hames
6699fb2709 New C++ PBQP solver. Currently about as fast (read _slow_) as the old C based solver, but I'll be working to improve that. The PBQP allocator has been updated to use the new solver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 23:32:48 +00:00
Dale Johannesen
14e545d18e Fix PR 4626, a crash in branch folding after OptimizeBlock
produced a CFG it wasn't prepared for.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78351 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 22:56:40 +00:00
Dale Johannesen
76711246d9 Use stripPointerCasts instead of partially rewriting it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 22:45:51 +00:00
Jakob Stoklund Olesen
31f5591c91 Get rid of RegScavenger::backwards() before the bitrot spreads.
If we need it one day, there is nothing wrong with putting it back in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 21:19:03 +00:00
John Mosby
e0161ea105 Reg Scavenging generalization (Thumb support):
- start support for new PEI w/reg alloc, allow running RS from emit{Pro,Epi}logue() target hooks.
- fix minor issue with recursion detection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 16:32:47 +00:00
Dan Gohman
5e86606f45 Add assertion checks after the calls to LowerFormalArguments, LowerCall,
and LowerReturn, to verify that the targets' hooks have respected some
of their postconditions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 15:37:27 +00:00
Dan Gohman
e483feded9 Remove an over-aggressive assert. Functions with empty struct return
types don't have any return values, from CodeGen's perspective.
This fixes PR4688.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 15:07:58 +00:00
Dan Gohman
5cbd37e505 Fix a few places in DAGCombiner that were creating all-ones-bits
and high-bits values in ways that weren't correct for integer
types wider than 64 bits. This fixes a miscompile in
PPMacroExpansion.cpp in clang on x86-64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78295 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 09:18:59 +00:00
Owen Anderson
d7f2a6cb3f Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 23:16:16 +00:00
David Greene
a5bb59f856 Fix some column padding bugs, reorganize things as suggested by Chris
and eliminate complexity.  Yay!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 21:00:52 +00:00
Chris Lattner
cafbdc5c09 remove the 'DataSectionStartSuffix' and 'TextSectionStartSuffix' knobs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 20:49:52 +00:00
Benjamin Kramer
0ffc470396 Rename a variable to make MSVC happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78202 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 16:08:58 +00:00
Evan Cheng
6248fa4529 Disable stack coloring with register for now. It's not able to set kill markers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78179 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 07:26:17 +00:00
Evan Cheng
9cd1632814 Another nasty coalescer bug (is there another kind):
After coalescing reg1027's def and kill are both at the same point:
 %reg1027,0.000000e+00 = [56,814:0)  0@70-(814)

bb5:
60   %reg1027<def> = t2MOVr %reg1027, 14, %reg0, %reg0
68   %reg1027<def> = t2LDRi12 %reg1027<kill>, 8, 14, %reg0
76   t2CMPzri %reg1038<kill,undef>, 0, 14, %reg0, %CPSR<imp-def>
84   %reg1027<def> = t2MOVr %reg1027, 14, %reg0, %reg0
96   t2Bcc mbb<bb5,0x2030910>, 1, %CPSR<kill>

Do not remove the kill marker on t2LDRi12.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78178 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 07:05:41 +00:00
Bruno Cardoso Lopes
6e88a51599 Remove accidental commited comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78177 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 07:00:43 +00:00
Bruno Cardoso Lopes
52d0851446 - Remove custom handling of jumptables by the elf writter (this was
a dirty hack and isn't need anymore since the last x86 code emitter patch)
- Add a target-dependent modifier to addend calculation
- Use R_X86_64_32S relocation for X86::reloc_absolute_word_sext
- Use getELFSectionFlags whenever possible
- fix getTextSection to use TLOF and emit the right text section 
- Handle global emission for static ctors, dtors and Type::PointerTyID
- Some minor fixes



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 06:57:03 +00:00
Chris Lattner
d250329291 add a temporary hook to allow reuse of the asmprinter from the disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78154 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 04:09:18 +00:00
Evan Cheng
6ade93bbdc Turn some insert_subreg, extract_subreg, subreg_to_reg into implicit_defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78151 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 03:53:14 +00:00
Evan Cheng
b018a1e5a7 One more. Transfer kill of the larger register when lowering an EXTRACT_SUBREG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 02:25:11 +00:00
Evan Cheng
a72dfb522d One more place where subreg lowering forgot to transfer undefness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 01:57:22 +00:00
Dan Gohman
98ca4f2a32 Major calling convention code refactoring.
Instead of awkwardly encoding calling-convention information with ISD::CALL,
ISD::FORMAL_ARGUMENTS, ISD::RET, and ISD::ARG_FLAGS nodes, TargetLowering
provides three virtual functions for targets to override:
LowerFormalArguments, LowerCall, and LowerRet, which replace the custom
lowering done on the special nodes. They provide the same information, but
in a more immediately usable format.

This also reworks much of the target-independent tail call logic. The
decision of whether or not to perform a tail call is now cleanly split
between target-independent portions, and the target dependent portion
in IsEligibleForTailCallOptimization.

This also synchronizes all in-tree targets, to help enable future
refactoring and feature work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 01:29:28 +00:00
Evan Cheng
518ad1a880 If the insert_subreg source is <undef>, insert an implicit_def instead of a copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78141 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 01:29:24 +00:00
Dan Gohman
a5225add0d Various comment fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78139 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 01:19:01 +00:00
Jakob Stoklund Olesen
323e7d32ab Clean up the handling of two-address operands in RegScavenger.
This fixes PR4528.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 21:30:30 +00:00
Jakob Stoklund Olesen
f955cbf56f Don't give implicit machine operands special treatment in the register scavenger.
Imp-def is *not* allowed to redefine a live register.
Imp-use is *not* allowed to use a dead register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 21:29:11 +00:00
Chris Lattner
f9c1ccf280 rip out SectionEndDirectiveSuffix support, only uses by
the masm backend.  If anyone cares about masm in the future,
we'll have semantic sections it can hang off of.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 20:09:41 +00:00
Jakob Stoklund Olesen
efb8e3e113 Don't tamper with <undef> operands in MachineInstr::addRegisterKilled.
For an undef operand, MO.getReg() is meaningless and we should not use it.
Undef operands should be skipped entirely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 20:09:25 +00:00
Jakob Stoklund Olesen
ded2e3b0d0 LowerSubregsInstructionPass::LowerExtract should not extend the live range of registers.
When LowerExtract eliminates an EXTRACT_SUBREG with a kill flag, it moves the
kill flag to the place where the sub-register is killed. This can accidentally
overlap with the use of a sibling sub-register, and we have trouble.

In the test case we have this code:

Live Ins: %R0 %R1 %R2
	%R2L<def> = EXTRACT_SUBREG %R2<kill>, 1
	%R2H<def> = LOAD16fi <fi#-1>, 0, Mem:LD(2,4) [FixedStack-1 + 0]
	%R1L<def> = EXTRACT_SUBREG %R1<kill>, 1
	%R0L<def> = EXTRACT_SUBREG %R0<kill>, 1
	%R0H<def> = ADD16 %R2H<kill>, %R2L<kill>, %AZ<imp-def>, %AN<imp-def>, %AC0<imp-def>, %V<imp-def>, %VS<imp-def>

subreg: CONVERTING: %R2L<def> = EXTRACT_SUBREG %R2<kill>, 1
subreg: eliminated!
subreg: killed here: %R0H<def> = ADD16 %R2H, %R2L, %R2<imp-use,kill>, %AZ<imp-def>, %AN<imp-def>, %AC0<imp-def>, %V<imp-def>, %VS<imp-def>

The kill flag on %R2 is moved to the last instruction, and the live range overlaps with the definition of %R2H:

*** Bad machine code: Redefining a live physical register ***
- function:    f
- basic block:  0x18358c0 (#0)
- instruction: %R2H<def> = LOAD16fi <fi#-1>, 0, Mem:LD(2,4) [FixedStack-1 + 0]
Register R2H was defined but already live.

The fix is to replace EXTRACT_SUBREG with IMPLICIT_DEF instead of eliminating
it completely:

subreg: CONVERTING: %R2L<def> = EXTRACT_SUBREG %R2<kill>, 1
subreg: replace by: %R2L<def> = IMPLICIT_DEF %R2<kill>

Note that these IMPLICIT_DEF instructions survive to the asm output. It is
necessary to fix the stack-color-with-reg test case because of that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78093 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 20:01:11 +00:00
Jakob Stoklund Olesen
d37bc5a27b Enforce stricter rules in machine code verifier.
Implicit operands no longer get a free pass: Imp-use requires a live register
and imp-def requires a dead register.

There is also no special rule allowing redefinition of a sub-register when the
super-register is live. The super register must have imp-kill+imp-def operands
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 19:18:01 +00:00
Evan Cheng
7d35249e89 Fix PR4528. This scavenger assertion is too strict. The two-address value is
killed by another operand.

There is probably a better fix. Either 1) scavenger can look at other operands, or
2) livevariables can be smarter about kill markers. Patches welcome.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 16:52:44 +00:00
Dan Gohman
206ad10c14 Propogate the Depth argument when calling
TLI.computeMaskedBitsForTargetNode from ComputeMaskedBits, since
the former may call back into the latter. This fixes a major
compile time problem on a testcase that happnened to hit this
in a particularly bad way, PR4643.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 00:24:42 +00:00
Ted Kremenek
f6e75c3435 Update CMake files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 23:44:01 +00:00
Chris Lattner
290c2f56ce eliminate CurrentSection, rename CurrentSection_ -> CurrentSection, make it private,
eliminate IsInTextSection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78017 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 23:20:21 +00:00
Chris Lattner
c6fdced3db Kill off SwitchToDataSection and SwitchToTextSection, woo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 23:10:34 +00:00
David Greene
b525766479 Re-apply LiveInterval index dumping patch, with fixes suggested by Bill
and others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78003 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 21:55:09 +00:00
Jakob Stoklund Olesen
980daea857 Fix Bug 4657: register scavenger asserts with subreg lowering
When LowerSubregsInstructionPass::LowerInsert eliminates an INSERT_SUBREG
instriction because it is an identity copy, make sure that the same registers
are alive before and after the elimination.

When the super-register is marked <undef> this requires inserting an
IMPLICIT_DEF instruction to make sure the super register is live.

Fix a related bug where a kill flag on the inserted sub-register was not transferred properly.

Finally, clear the undef flag in MachineInstr::addRegisterKilled. Undef implies dead and kill implies live, so they cant both be valid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77989 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 20:08:18 +00:00
Chris Lattner
38c398808c make getObjFileLowering() return a non-const reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 19:12:26 +00:00
Bob Wilson
6e7a85c075 Revert 77974. It breaks 3 of the ARM tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 19:06:29 +00:00
Chris Lattner
d54a6b8c58 make SwitchToSection accept null sections for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 18:04:42 +00:00
Sanjiv Gupta
2caf1b212e Allow targets to custom handle softening of results or operands before trying the standard stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 17:35:21 +00:00
Benjamin Kramer
d5fe92efbc llvm_report_error already prints "LLVM ERROR:". So stop reporting errors like "LLVM ERROR: llvm: error:" or "LLVM ERROR: ERROR:".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 13:33:33 +00:00
Evan Cheng
eed0ff147c Fix a coaelescer bug. If a copy val# is extended to eliminate a non-trivially coalesced copy, and the copy kills its source register. Trim the source register's live range to the last use if possible. This fixes up kill marker to make the scavenger happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77967 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 08:41:59 +00:00
Daniel Dunbar
275872e799 Fix some comments referring to std::cerr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 01:02:24 +00:00
Jakob Stoklund Olesen
b36eb9df20 Fix issue in regscavenger when scavenging a callee-saved register that has not been spilled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77912 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 20:29:41 +00:00
Jakob Stoklund Olesen
ece4818516 Never add a kill flag to a constrained physical register in a two-addr instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 19:13:03 +00:00
Jakob Stoklund Olesen
0e6a4efdd4 Scavenger asserts.
Allow imp-def and imp-use of anything in the scavenger asserts, just like the machine code verifier.
Allow redefinition of a sub-register of a live register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 18:28:41 +00:00
Dan Gohman
4ea480499c Avoid forming a SELECT_CC in a type that the target doesn't
support. This isn't immediately interesting, because Legalize
ends up lowering SELECT_CC if the target doesn't support it,
but this simplifies the process.

Also, if the SELECT_CC would be expanded in Legalize, it
can potentially end up with two copies of the condition
expression. By leaving it as SELECT+SETCC, the SELECT can be
expanded into two SELECTs that use a single SETCC.

The two comparisons are usually CSE'd, but depending on
when various expressions get legalized, the comparison
expression could involve calls to library functions, such
that the comparison expression may not be able to be CSE'd.
This will be needed by a future patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77896 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 16:19:38 +00:00
Jakob Stoklund Olesen
bcdbcb9f95 Handle <undef> flag in machine code verifier.
Use of an <undef> register is treated like an <imp-use>. It is not an error to use a dead <undef> register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 07:38:21 +00:00