Commit Graph

9217 Commits

Author SHA1 Message Date
Dan Gohman
8f78e3c87d Fix another bitwidth calculation to handle vector types; based on a
patch by Micah Villmow for PR6572.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98188 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 21:04:53 +00:00
Dale Johannesen
2cd9ffef6e Fix another place where DEBUG_VALUE affected codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98181 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 19:57:56 +00:00
Dale Johannesen
a2f767b1a7 Fix a bug in DEBUG_VALUE handling Devang ran into.
I'll get this loop right yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 15:06:26 +00:00
Chris Lattner
09d53fecfc move three lowering hooks from MAI to TLOF and make one of them
semantic instead of syntactic.  This completes MCization of
darwin/x86[-64]!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 07:20:42 +00:00
Dale Johannesen
c5cf227f3d This survived a bootstrap, so let's try 98104 again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 05:45:47 +00:00
Evan Cheng
fac4f1f181 Enable machine cse pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 03:07:41 +00:00
Chris Lattner
974c0fb404 mcize the rest of EH emission, only one more directive missing
for darwin/x86 to be completely mcized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 02:48:06 +00:00
Chris Lattner
49f618a1e4 add missing filename!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98125 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 02:29:31 +00:00
Chris Lattner
98cdab53c3 set the temporary bit on MCSymbols correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98124 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 02:25:11 +00:00
Evan Cheng
2938a00f29 Add a couple more heuristics to neuter machine cse some more.
1. Be careful with cse "cheap" expressions. e.g. constant materialization. Only cse them when the common expression is local or in a direct predecessor. We don't want cse of cheap instruction causing other expressions to be spilled.
2. Watch out for the case where the expression doesn't itself uses a virtual register. e.g. lea of frame object. If the common expression itself is used by copies (common for passing addresses to function calls), don't perform the cse. Since these expressions do not use a register, it creates a live range but doesn't close any, we want to be very careful with increasing register pressure.

Note these are heuristics so machine cse doesn't make register allocator unhappy. Once we have proper live range splitting and re-materialization support in place, these should be evaluated again.

Now machine cse is almost always a win on llvm nightly tests on x86 and x86_64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 02:12:03 +00:00
Chris Lattner
d85fc6e0b1 inline away a form of IsPCRelative, eliminating the
dead IsPCRel argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 01:17:49 +00:00
Chris Lattner
188a87da79 add some fixme's for MCizing. EH still has a few things that
need to be MCized, but the last debug info thing are LEB and
cygwin specific (which the MC api doesn't support yet) and
one specific form of EmitReference which I'll tackle next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 01:04:13 +00:00
Jim Grosbach
7c617b5e53 Clear up the last (famous last words) frame index value reuse issues for Thumb1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 00:13:42 +00:00
Dale Johannesen
7dda453410 Speculatively revert 98104; could be what's causing crashes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 00:11:34 +00:00
Chris Lattner
90e4af7b9d mcize uses of PrintRelDirective and eliminate it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98107 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 00:09:21 +00:00
Chris Lattner
4aeaca4053 inline the bool form of PrintRelDirective away, leaving just the unsigned form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:54:52 +00:00
Chris Lattner
233f52be36 eliminate EOL, adding all comments with the OutStreamer.AddComment
method.  With this, comments should end up on the same lines as the .byte
directives (for example) and we now get no output with:

$ llc CodeGen/X86/2009-02-12-DebugInfoVLA.ll -o - -filetype=null -asm-verbose

woot.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:52:58 +00:00
Dale Johannesen
7f876967c0 Ever more complicated DEBUG_VALUE fixes for branch folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:52:37 +00:00
Chris Lattner
0d9d70f013 eliminate a bunch of \n's that are being printed to O. Next up is to kill
off "EOL".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:38:23 +00:00
Chris Lattner
fcdae492ea convert the non-"ispcrel" case of EmitReference to MC,
significant debug info testcases are now all going through
MCStreamer, though they print a lot of extraneous newlines to "O".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 23:19:15 +00:00
Jim Grosbach
dff4b4c5a7 Change the Value argument to eliminateFrameIndex to a type-tagged value. This
is preparatory to having PEI's scavenged frame index value reuse logic
properly distinguish types of frame values (e.g., whether the value is
stack-pointer relative or frame-pointer relative).

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 21:45:49 +00:00
Evan Cheng
bfc9999563 Allow more cross-rc coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 06:38:17 +00:00
Chris Lattner
c608784dc8 reapply r98035:
Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 04:54:43 +00:00
Chris Lattner
6c7dfc0463 add some extra checks. I'm not sure why, but this does unbreak a
failure remaining on mainline.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98046 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 04:48:35 +00:00
Evan Cheng
7ef1840d9e Revert accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 04:04:38 +00:00
Jakob Stoklund Olesen
1552cccc76 Don't do illegal cross-class coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 03:56:06 +00:00
Evan Cheng
31f94c7c22 - Make the machine cse dumb coalescer (as opposed to the more awesome simple
coalescer) handle sub-register classes.
- Add heuristics to avoid non-profitable cse. Given the current lack of live
  range splitting, avoid cse when an expression has PHI use and the would be
  new use is in a BB where the expression wasn't already being used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 03:21:12 +00:00
Eric Christopher
ee6414cf04 Speculatively revert r98035. It appears to have caused a set of buildbot
failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 02:36:31 +00:00
Dan Gohman
19b3826d0f Attempt to make this debug output meaningful, both in the case of
multibyte opcodes and in the case of multiple scopes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 02:15:05 +00:00
Chris Lattner
1e233f510c Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98035 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 02:08:02 +00:00
Chris Lattner
b7db733482 change DbgScope to keep track of the start/end label as MCSymbol*
now that the dependence on ID is removed from MMI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:58:53 +00:00
Chris Lattner
5b9062cb3a remove a useless optimization: now that label replacement never
happens, the start/end of a scope can never be the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:52:43 +00:00
Chris Lattner
a34ec2290f strength reduce MMI::MappedLabel to MMI::isLabelDeleted,
and add a FIXME about how we are eventually going to zap this
lookup table once mc world domination is complete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:51:43 +00:00
Chris Lattner
b2cc1a39f7 mcstreamerize AsmPrinter::printLabel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 01:02:30 +00:00
Jakob Stoklund Olesen
35071a0847 Disable physical register coalescing when the number of live ranges for the
physreg becomes ridiculously high.

std::upper_bound may be log(N), but for sufficiently large live intervals, it
becomes log(N)*cachemiss = a long long time.

This patch improves coalescer time by 4500x for a function with 20000
function calls. The generated code is different, but not significantly worse -
the allocator hints are almost as good as physreg coalescing anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:59:48 +00:00
Chris Lattner
6cde3e6e99 add a EmitSymbolValue convenience method to MCStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98017 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:39:24 +00:00
Chris Lattner
6ed0f90dac make InlineInfoLabels hold MCSymbol*'s, avoiding
recomputation of the labels.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:31:02 +00:00
Chris Lattner
b9dc5f7b58 mc'ize the last use of PrintLabelName and eliminate PrintLabelName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98015 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:26:09 +00:00
Chris Lattner
ef6b14f51c eliminate an argument from PrintRelDirective, sinking
the one special case into EmitSectionOffset.  MCize
the non-special case in EmitSectionOffset.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:17:58 +00:00
Dan Gohman
8f03d75161 Print the correct index in the "match failed at index" message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:07:36 +00:00
Chris Lattner
b67d69df65 remove the suffix form of PrintLabelName, which was only
used for 'flavor'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:00:57 +00:00
Chris Lattner
c3421bb805 now that the debug and eh emitters use a common .set counter,
we can eliminate "flavor".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 00:00:15 +00:00
Chris Lattner
0d50c7620d move .set generation out of DwarfPrinter into AsmPrinter and
MCize it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:58:37 +00:00
Evan Cheng
5196018d9c Don't waste time trying to CSE labels, phis, inline asm. Definitely avoid cse implicit-def for obvious performance reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:49:12 +00:00
Evan Cheng
6c3b8ac6c9 Restrict machine cse to really trivial coalescing. Leave the heavy lifting to a real coalescer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98007 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:28:08 +00:00
Chris Lattner
57578766aa simplify EmitSectionOffset to always use .set if it is
available, the only thing this affects is that we produce
.set in one case we didn't before, which shouldn't harm
anything.  Make EmitSectionOffset call EmitDifference
instead of duplicating it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98005 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:23:25 +00:00
Chris Lattner
effa868d38 Remove a version of EmitDifference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98002 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 23:02:59 +00:00
Chris Lattner
dd8187a3e9 eliminate a form of PrintLabelName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:52:49 +00:00
Chris Lattner
326861c4c8 remove another form of EmitReference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:50:36 +00:00
Chris Lattner
c7249da2e9 eliminate the non-MCSymbol versions of EmitReference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97997 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:47:57 +00:00
Chris Lattner
f829eef8fa mc'ize EmitLabel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:44:40 +00:00
Chris Lattner
4faf59af82 merge DIEObjectLabel and DIEDwarfLabel into DIELabel.
Yes, DIE you fiendish labels, die all of you.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:31:46 +00:00
Chris Lattner
b98b1bf432 elimiante the DWLabel class, using MCSymbol instead. Start
switching some stuff over to passing around MCSymbol* instead
of stem+ID.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97993 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:23:36 +00:00
Devang Patel
77bf295dbb Derive DIType from DIScope. This simplifies getContext() where for members the context is a type. This also eliminates need of CompileUnitMaps maintained by dwarf writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97990 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 22:02:50 +00:00
Devang Patel
3c91b05d2b Avoid using DIDescriptor.isNull().
This is a first step towards eliminating checks in Descriptor constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 20:52:55 +00:00
Devang Patel
0ef3fa6aab Revert r97947.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 19:20:38 +00:00
Devang Patel
d8cc5d5256 Avoid using DIDescriptor.isNull().
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:25:48 +00:00
Dale Johannesen
fab4a25d46 Add Order to SDDbgValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 05:39:50 +00:00
Dale Johannesen
84839daa59 Fix dbg value handling in tail merging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 05:38:13 +00:00
Douglas Gregor
1ddcf35b68 Revert r97917, which was causing Clang Debug self-host failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97932 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 02:58:37 +00:00
Jeffrey Yasskin
9467f0e3bd Roll r97906 forward again, without double-deleting CompileUnit::IndexTyDie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 17:10:13 +00:00
Chris Lattner
acee647b13 Use Other as a sentinel instead of iAny.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 07:45:08 +00:00
Jeffrey Yasskin
8c42ca9374 _2_ gcc crashes, ah, ah, ah...
(Rolling back r97906.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 07:16:49 +00:00
Jeffrey Yasskin
f7399bf929 Avoid leaking CompileUnits and DbgScopes from DwarfDebug. Leaks found by Valgrind!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 06:55:35 +00:00
Chris Lattner
98f15d27cd tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 04:28:09 +00:00
Evan Cheng
6cc1aeaad2 Don't update physical register def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 01:14:19 +00:00
Dale Johannesen
06a26637da Add some new bits of debug info handling. No
functional change yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 00:03:23 +00:00
Dan Gohman
0fa9d1d901 Reapply r97778 and r97779, enabled only for unsigned i64 to f64
conversions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 00:00:55 +00:00
Charles Davis
314fef6127 Don't emit global symbols into the (__TEXT,__ustring) section on Darwin. This
is a workaround for <rdar://problem/7672401/> (which I filed).

This let's us build Wine on Darwin, and it gets the Qt build there a little bit
further (so Doug says).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 22:28:45 +00:00
Jakob Stoklund Olesen
53e000bac3 Better handling of dead super registers in LiveVariables. We used to do this:
CALL ... %RAX<imp-def>
   ... [not using %RAX]
   %EAX = ..., %RAX<imp-use, kill>
   RET %EAX<imp-use,kill>

Now we do this:

   CALL ... %RAX<imp-def, dead>
   ... [not using %RAX]
   %EAX = ...
   RET %EAX<imp-use,kill>

By not artificially keeping %RAX alive, we lower register pressure a bit.

The correct number of instructions for 2008-08-05-SpillerBug.ll is obviously
55, anybody can see that. Sheesh.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 21:49:17 +00:00
Jakob Stoklund Olesen
a76e816844 We don't really care about correct register liveness information after the
post-ra scheduler has run. Disable the verifier checks that late in the game.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 21:49:13 +00:00
Jakob Stoklund Olesen
580bba2b0d Avoid creating bad PHI instructions when BR is being const-folded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97836 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 21:49:10 +00:00
Chris Lattner
18fdabadca Fix PR6497, a bug where we'd fold a load into an addc
node which has a flag.  That flag in turn was used by an
already-selected adde which turned into an ADC32ri8 which
used a selected load which was chained to the load we
folded.  This flag use caused us to form a cycle.  Fix
this by not ignoring chains in IsLegalToFold even in
cases where the isel thinks it can.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 06:19:13 +00:00
Chris Lattner
9bbcd5ee5b inline a small function with one call site.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 05:49:45 +00:00
Dan Gohman
b6b343d77a Revert r97778 and r97779. They're somehow breaking llvm-gcc builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 02:40:23 +00:00
Dan Gohman
808ab341b4 Fix these constants to be more portable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 02:13:10 +00:00
Dan Gohman
cfa7ca1997 Rewrite i64-to-f64 conversion using an algorithm which handles
rounding correctly. This implementation is a generalization of
the x86_64 code in compiler-rt.

This fixes rdar://7683708.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 02:00:46 +00:00
Dale Johannesen
b0812f114b Fix some more places where dbg_value affected codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97765 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 00:02:59 +00:00
Jeffrey Yasskin
e8cfa63e4e Fix memcheck-found leaks: one false positive from using new[], and one true
positive where pointers would be leaked on llvm_shutdown.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 22:15:01 +00:00
Jim Grosbach
b58a59b3c1 For SJLJ exception handling, make sure that all calls that are not marked
as nounwind are marked with a -1 call-site value. This is necessary to, for
example, correctly process exceptions thrown from within an "unexpected"
execption handler (see SingleSource/Regression/C++/EH/expection_spec_test.cpp).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97757 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 22:07:46 +00:00
Evan Cheng
c46e293e94 Run machine licm before machine cse to avoid messing up licm opportunities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 21:28:09 +00:00
Evan Cheng
a5f32cb3d3 Avoid cse load instructions unless they are known to be invariant loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97747 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 21:18:08 +00:00
Chris Lattner
c19ae9d91d add a statistic for # times fastisel fails.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97738 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 19:46:56 +00:00
Dan Gohman
ba72b0c4e1 Fix a typo Duncan noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97735 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 19:11:28 +00:00
Evan Cheng
9763f709e2 Rename -machine-cse to -enable-machine-cse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97713 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 02:08:04 +00:00
Evan Cheng
b3958e8032 Look ahead a bit to determine if a physical register def that is not marked dead is really alive. This is necessary to catch a lot of common cse opportunities for targets like x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 01:33:55 +00:00
Chris Lattner
57bf8a483e change the new isel matcher to emit ComplexPattern matches
as the very last thing before node emission.  This should
dramatically reduce the number of times we do 'MatchAddress'
on X86, speeding up compile time.  This also improves comments
in the tables and shrinks the table a bit, now down to 
80506 bytes for x86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 01:23:08 +00:00
Dan Gohman
6900a39d28 Fix more code to work properly with vector operands. Based on
a patch my Micah Villmow for PR6465.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 00:23:16 +00:00
Chris Lattner
2c4afd1d8e inline CannotYetSelectIntrinsic into CannotYetSelect and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97690 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 00:21:16 +00:00
Evan Cheng
67bda7215b Fix a logic error. An instruction that has a live physical register def cannot be CSE'ed, but it *can* be used to replace a common subexpression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97688 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 23:59:08 +00:00
Evan Cheng
a92dced4a1 Remove PHINodeTraits and use MachineInstrExpressionTrait instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 23:55:49 +00:00
Evan Cheng
67eaa08f2b Move MachineInstrExpressionTrait::getHashValue() out of line so it can skip over only virtual register defs. This matches what isEqual() is doing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97680 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 23:37:30 +00:00
Evan Cheng
05bdcbb1ae Re-apply r97667 but with a little bit of thought put into the patch. This implements a special DenseMapInfo trait for DenseMap<MachineInstr*> that compare the value of the MachineInstr rather than the pointer value. Since the hashing and equality test functions ignore defs it's useful for doing CSE kind optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97678 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 23:27:36 +00:00
Dan Gohman
319dfa3fb3 Revert 97667. It broke a bunch of tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 22:40:03 +00:00
Evan Cheng
34cdf6edf5 Fix funky indentation and add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:54:14 +00:00
Evan Cheng
a054ae02fd Move DenseMapInfo for MachineInstr* to MachineInstr.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:47:16 +00:00
Dan Gohman
a72d2a210c Fix a bug in SelectionDAG's ReplaceAllUsesWith in the case where
CSE and recursive RAUW calls delete a node from the use list,
invalidating the use list iterator. There's currently no known
way to reproduce this in an unmodified LLVM, however there's no
fundamental reason why a SelectionDAG couldn't be formed which
would trigger this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:33:37 +00:00
Evan Cheng
16b48b8a05 Machine CSE work in progress. It's doing some CSE now. But implicit def of physical registers are getting in the way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:20:05 +00:00
Evan Cheng
1423c70b8f Add MachineRegisterInfo::hasOneUse and hasOneNonDBGUse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97663 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:18:38 +00:00
Bill Wendling
fec8657351 Revert...
--- Reverse-merging r97592 into '.':
U    lib/CodeGen/TargetLoweringObjectFileImpl.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97657 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 19:31:05 +00:00