Commit Graph

19471 Commits

Author SHA1 Message Date
Duncan Sands
f664e41b20 The exception handling intrinsics return values,
so must be lowered to a value, not nothing at all.
Subtle point: I made eh_selector return 0 and
eh_typeid_for return 1.  This means that only
cleanups (destructors) will be run as the exception
unwinds [if eh_typeid_for returned 0 then it would
be as if the first catch always matched, and the
corresponding handler would be run], which is
probably want you want in the CBE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37947 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 14:46:23 +00:00
Gabor Greif
e75ca3d809 eliminate residual cruft related to recognizing bytecode
files.
bitcode files are the only LLVM format left.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37945 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 13:38:17 +00:00
Duncan Sands
fccf0a2b25 Indexes into the list of filter ids cannot be output
directly: they need to be turned into byte offsets
(often the same, but may not be if there are many
type infos).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37942 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 12:46:24 +00:00
Rafael Espindola
1aa7efbd2c Add the byval attribute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37940 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 10:57:03 +00:00
Gabor Greif
aa6b7fd5ec Solaris 2.x does not have RLIMIT_RSS, check for this symbol (analog NetBSD below), should subsume Cygwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37939 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 10:31:27 +00:00
Duncan Sands
902919541f Remove propagateEHRegister in favour of a more limited
fix, that is adequate while PR1508 remains unresolved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 09:18:59 +00:00
Duncan Sands
b4fd45e2fc Remove ExtractGlobalVariable - use StripPointerCasts
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37937 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 09:10:03 +00:00
Zhou Sheng
33b0b8d242 Correct a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37936 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 06:01:16 +00:00
Evan Cheng
86da6600ae Workaround of getCopyToRegs and getCopyFromRegs bugs for big-endian machines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37935 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 01:47:35 +00:00
Evan Cheng
991262834d Change CalculateHeights and CalculateDepths to be non-recursive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37934 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 01:37:28 +00:00
Evan Cheng
dfb2ebac29 Print the s bit if the instruction is toggled to its CPSR setting form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37932 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 01:01:34 +00:00
Evan Cheng
04c813d00c PredicateDefOperand -> OptionalDefOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37931 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 01:00:49 +00:00
Evan Cheng
e496d78f16 Add OptionalDefOperand to stand for optionally defined result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37930 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 01:00:16 +00:00
Owen Anderson
2a5c9d8aac Fix a bunch of issues found in a testcase from 400.perlbench.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37929 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 23:11:26 +00:00
Evan Cheng
148b6a419f Initial ARM JIT support by Raul Fernandes Herbster.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37926 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 21:15:40 +00:00
Anton Korobeynikov
4304bcc1ed Proper flag __alloca call
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37923 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 20:36:08 +00:00
Dan Gohman
50b153335d Make the debug string for ISD::MERGE_VALUES consistent with the others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 20:15:43 +00:00
Dan Gohman
6183f78cf8 Add a parameter to getCopyToParts and getCopyFromParts to specify whether
endian swapping should be done, and update the code to use it. This fixes
some register ordering issues on big-endian systems, such as PowerPC,
introduced by the recent illegal by-val arguments changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37921 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 20:12:34 +00:00
Chris Lattner
1bfb8b7333 This enum is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37920 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:28:01 +00:00
Chris Lattner
ce5f24e0ed update the .cvs files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:26:49 +00:00
Evan Cheng
c48072fed5 Doh
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:21:33 +00:00
Chris Lattner
3a08abfd34 remove a dead case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37916 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:18:32 +00:00
Evan Cheng
1f6d77b54a Unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37915 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:13:56 +00:00
Evan Cheng
d54874a06d Unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37914 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:13:19 +00:00
Gabor Greif
a99be51bf5 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37913 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:07:56 +00:00
Chris Lattner
461d79c2ee the arm backend is not building, temporarily disable it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37911 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 16:11:52 +00:00
Duncan Sands
14da32a486 Make sure only one copy of a filter is placed in the
exception handling table if we encounter it multiple
times.  Filters could be folded harder than this, but
that would mean a lot more work for not much gain.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37908 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 15:15:01 +00:00
Evan Cheng
0e1d37904a Reflects the chanegs made to PredicateOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37898 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 07:18:20 +00:00
Evan Cheng
16b6598325 Added ARM::CPSR to represent ARM CPSR status register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37897 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 07:17:13 +00:00
Evan Cheng
ee568cf794 Unfortunately we now require C++ code to isel Bcc, conditional moves, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37896 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 07:15:27 +00:00
Evan Cheng
c85e832eb7 Each ARM use predicate operand is now made up of two components. The new component is the CPSR register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37895 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 07:13:32 +00:00
Evan Cheng
3b5b8368f3 Added ARM::CPSR to represent ARM CPSR status register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37894 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 07:11:03 +00:00
Evan Cheng
7e36966de4 PPC conditional branch predicate does not change after isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37893 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 07:09:50 +00:00
Evan Cheng
2aa133ef72 - Added zero_reg def to stand for register 0.
- Added two variants of PredicateOperand: ImmutablePredicateOperand, whose predicate does not change after isel; PredicateDefOperand, which represent a predicate defintion operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37892 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 07:09:09 +00:00
Evan Cheng
0e4a276c72 Do not check isPredicated() on non-predicable instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37891 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 07:06:46 +00:00
Evan Cheng
5db322acef Better assertion messages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37890 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 07:05:38 +00:00
Nick Lewycky
29a05b6a71 Break "variable canonicalization" out of InequalityGraph and into its own class
"ValueNumbering".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37881 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 03:15:00 +00:00
Owen Anderson
ec3ed5f8e4 Fix another bug, this time in PREing select instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-04 22:33:23 +00:00
Dale Johannesen
e377d4d142 Refactor X87 instructions. As a side effect, all
their names are changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37876 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-04 21:07:47 +00:00
Duncan Sands
cf26d7ccac Extend eh.selector to support both catches and filters.
Drop the eh.filter intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37875 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-04 20:52:51 +00:00
Owen Anderson
df30b63663 Fix a typo that was killing GVNPRE of select instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37871 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-04 18:26:18 +00:00
Owen Anderson
9eee94c5f7 Fix an error in phi translation of GEPs that was causing failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37868 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-04 04:51:16 +00:00
Bill Wendling
10404c47d1 Support generation of GR64 to MMX code in the JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37866 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-04 01:29:22 +00:00
Bill Wendling
93888428d4 Allow a GR64 to be moved into an MMX register via the "movd" instruction.
Still need to have JIT generate this code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37863 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-04 00:19:54 +00:00
Owen Anderson
5653322e72 Add support for performing GVNPRE on GEP instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37862 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-03 23:51:19 +00:00
Owen Anderson
eb21686ea9 Add functionality to value number GEP instructions. This also provides the infrastructure that will
be used for function calls.  NOTE: This does not yet do any transformation of GEPs or function calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37860 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-03 22:50:56 +00:00
Owen Anderson
3d6fac3993 Make the unary operator case a bit faster, since casts are the only kind of unary operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37857 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-03 19:01:42 +00:00
Owen Anderson
216394f9b3 Add support for performing GVNPRE on cast instructions, and add a testcase for this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37856 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-03 18:37:08 +00:00
Dale Johannesen
411d9c5467 Some spacing fixes. Cosmetic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37853 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-03 17:07:33 +00:00
Dan Gohman
613e0d8008 Fix several over-aggressive folds for undef nodes in dagcombine, to
follow the rules for undef used in instcombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37851 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-03 14:03:57 +00:00
Dale Johannesen
849f214a4e Fix for PR 1505 (and 1489). Rewrite X87 register
model to include f32 variants.  Some factoring
improvments forthcoming.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37847 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-03 00:53:03 +00:00
Dan Gohman
1866f6ec7b Vector results may be returned in XMM0 and XMM1, not just XMM0. With
the recent lowering changes, this allows types like <4 x double> to
be returned, using two vector registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37844 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-02 16:21:53 +00:00
Dan Gohman
27a70be55f Replace ExpandScalarFormalArgs and ExpandScalarCallArgs with the newly
refactored getCopyFromParts and getCopyToParts, which are more general.
This effectively adds support for lowering illegal by-val vector call
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37843 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-02 16:18:06 +00:00
Dan Gohman
23ff1826b9 Teach GetNegatedExpression to negate 0-B to B in UnsafeFPMath mode, and
visitFSUB to fold 0-B to -B in UnsafeFPMath mode. Also change visitFNEG
to use isNegatibleForFree/GetNegatedExpression instead of doing a subset
of the same thing manually.

This fixes test/CodeGen/X86/negative-sin.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37842 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-02 15:48:56 +00:00
Dan Gohman
a6900c7ad9 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37839 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-02 14:53:37 +00:00
Nick Lewycky
ea332946d3 Fix undefined behaviour reported by the new --enable-expensive-checks option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37829 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-01 03:06:30 +00:00
Evan Cheng
9da60f92d9 (For Chris): Fix failure where we rejected compiling stubs when lazy compilation is disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37825 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-30 00:10:37 +00:00
Devang Patel
1a957d563f Add loop info verification mechanism.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37822 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 23:13:42 +00:00
Devang Patel
f34a43acc0 Preserve DominanceFrontier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37820 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 23:11:49 +00:00
Evan Cheng
c45453fa1d Only do FNEG xform when the vector type is a floating point type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 21:44:35 +00:00
David Greene
821262953a Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37816 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 21:42:03 +00:00
Evan Cheng
c908dcde45 Fix a vector FP constant CSE bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37814 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 21:36:04 +00:00
John Criswell
e644ef7b09 Convert .cvsignore files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37801 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 16:35:07 +00:00
David Greene
a2a488594d Remove unnecessary attributions in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37799 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 03:42:23 +00:00
David Greene
c08fa28897 Fix reference to iterator invalidated by an erase operation. Uncovered
by _GLIBCXX_DEBUG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37796 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 02:53:16 +00:00
David Greene
cfacc8f5d2 Fix reference to cached end iterator invalidated by an erase operation.
Uncovered by _GLIBCXX_DEBUG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37795 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 02:49:11 +00:00
David Greene
a4ab2e8c72 Remove the "special tie breaker" because it resulted in inconsistent
ordering and thus violated the strict weak ordering requirement of
priority_queue.  Uncovered by _GLIBCXX_DEBUG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37794 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 02:48:09 +00:00
David Greene
8a46d342d8 Fix misue of iterator pointing to erased object. Uncovered by
_GLIBCXX_DEBUG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37793 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 02:45:24 +00:00
Devang Patel
6c631988c7 Do not filter loop if candidate branch is in loop header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37792 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 01:39:53 +00:00
Evan Cheng
2bda17c922 Prevent PPC::BCC first operand, the PRED number, from being isel'd into a LI instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37790 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 01:25:06 +00:00
Owen Anderson
ca6c31cc41 Add support for value numbering (but not actually optimizing) cast instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37789 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 00:51:03 +00:00
Owen Anderson
40dc00eb82 Add a type field to expressions in preparation for performing GVNPRE on casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37788 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 00:40:05 +00:00
Evan Cheng
a72cb0ea09 No vector fneg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37786 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 00:18:15 +00:00
Dan Gohman
10a7aa6dea Fix an assertion failure in legalizing bitcast operators on targets where
vectors are split down to single elements as part of legalization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 00:09:08 +00:00
Evan Cheng
0db5862cb8 Type of vector extract / insert index operand should be iPTR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37784 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 00:01:20 +00:00
Owen Anderson
890e1a0401 Add support for performing GVNPRE on select instructions. This fixes test/Transforms/GVNPRE/select.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37783 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 23:51:21 +00:00
Dan Gohman
b6f5b00c3b Add new TargetLowering code to provide the final register type that an
illegal value type will be transformed to, for code that needs the
register type after all transformations instead of just after the first
transformation.

Factor out the code that uses this information to do copy-from-regs and
copy-to-regs for various purposes into separate functions so that they
are done consistently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 23:29:44 +00:00
Lauro Ramos Venancio
00d8a84b44 Fix a bug in my previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37778 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 20:06:38 +00:00
Lauro Ramos Venancio
31ed0fb804 When linking two modules, we should copy the alias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 19:02:54 +00:00
Devang Patel
eb62eca503 - Undo previous check and allow loop switch for condtion that is not inside
loop.
- Avoid loop unswich for loop header branch.
- While cloning dominators fix typo and handle self dominating blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37772 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 02:05:46 +00:00
Devang Patel
cce624a7a9 Update LoopUnswitch pass to preserve DomiantorTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37771 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 00:49:00 +00:00
Devang Patel
558f1b8439 If a condition is not inside a loop then the condition is suitable
to loop unswitch candidate for the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37770 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 00:44:10 +00:00
Owen Anderson
a20f35d2e7 Make many sets a much more reasonable size. This decreases the time to optimize
Anton's testcase from 35.5s to 34.7s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 00:34:34 +00:00
Bill Wendling
1a636de33b Set implied features based upon the CPU's feature list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37768 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 23:34:06 +00:00
Devang Patel
1ceda1d63e Remove ETForest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37765 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 20:53:52 +00:00
Evan Cheng
292da949f6 If a livein is not used in the block. It's live through.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37764 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 18:47:28 +00:00
Evan Cheng
e47c333a12 Partial fix for PR1502: If a EH register is needed in a successor of landing pad, add it as livein to all the blocks in the paths between the landing pad and the specified block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37763 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 18:45:32 +00:00
Owen Anderson
68cb52e468 Use cached information that has already been computed to make clean() simpler and faster. This is a small speedup on most cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37761 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 17:38:29 +00:00
Owen Anderson
7b317d2f59 Fold a lot of code into two cases: binary instructions and ternary instructions.
This saves many lines of code duplication.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 17:03:03 +00:00
Dan Gohman
6595cb3000 Rename ("shrinkify") MVT::isExtendedValueType to MVT::isExtendedVT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37758 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 16:08:04 +00:00
Dan Gohman
6445f61806 Remove a redundant newline in the asm output for ELF .rodata sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 15:09:47 +00:00
Dan Gohman
8c8c5fcbd7 Use getVectorTypeBreakdown in FunctionLoweringInfo::CreateRegForValue
to compute the number and type of registers needed for vector values
instead of computing it manually. This fixes PR1529.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 14:34:07 +00:00
Dan Gohman
89b20c07e9 Make the comment for ScalarizeVectorOp mention that it is only for use
with single-element vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 14:06:22 +00:00
Zhou Sheng
0d7d3656f3 Fix a bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 09:50:26 +00:00
Duraid Madina
df82c93f2a ok, this is something of a dirty hack, but it seems to work. (fixes e.g.
the SPASS miscompilation)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 09:01:14 +00:00
Duraid Madina
b2efabd571 ok, this much doesn't seem to bork anything
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37749 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 08:31:07 +00:00
Duraid Madina
4e378c6504 revert evan's fixes (and my doofusness) since they had a huge code
quality hit. will look at this soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37748 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 08:11:59 +00:00
Duraid Madina
669f7382be pull evan's fixes - should help the nightly tester (but there are still
some issues)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 07:07:13 +00:00
Evan Cheng
041040717d Replace std::set with SmallPtrSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37746 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 05:23:00 +00:00
Owen Anderson
62cf8babdb Add support for performing GVNPRE on the three vector-specific operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37745 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 04:10:46 +00:00
Evan Cheng
75611fb4e6 Fix an obvious bug. Old code only worked for the entry block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37743 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 01:16:36 +00:00
Owen Anderson
6032a5ba64 1. Correct some comments and clean up some dead code.
2. When calculating ANTIC_IN, only iterate the changed blocks.  For most average
inputs this is a small speedup, but for cases with unusual CFGs, this can be a significant win.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37742 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-26 23:29:41 +00:00
Evan Cheng
7ac19afbb1 Correctly handle implcit def / use operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37740 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-26 21:05:13 +00:00
Evan Cheng
4efe74129f Properly handle kills of a physical register which has sub-registers that are read by later instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37739 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-26 21:03:35 +00:00
Evan Cheng
e2446c6076 Silence a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37737 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-26 18:31:22 +00:00
Dan Gohman
acaf32e236 Use utostr from StringExtras.h instead of ostringstream from <sstream>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37731 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-26 15:14:48 +00:00
Dan Gohman
d45eddd214 Revert the earlier change that removed the M_REMATERIALIZABLE machine
instruction flag, and use the flag along with a virtual member function
hook for targets to override if there are instructions that are only
trivially rematerializable with specific operands (i.e. constant pool
loads).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37728 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-26 00:48:07 +00:00
Duraid Madina
837a600a90 tidy this file up a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37725 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-26 00:21:58 +00:00
Duraid Madina
2e0930cf37 A bunch of fixes to the BigBlock allocator improve compile-time by ~20%
and code quality by ~2% on my tests.

A big thank you to Roman Levenstein for this patch! See
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070618/050717.html
for more details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37724 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 23:46:54 +00:00
Chris Lattner
ba6801e6e7 fix Transforms/Inline/2007-06-25-WeakInline.ll by not inlining functions
with weak linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37723 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 21:50:09 +00:00
Owen Anderson
9030d384c4 Use the built-in postorder iterators rather than computing a postorder walk by hand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37721 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 18:25:31 +00:00
Dan Gohman
7f32156bb9 Generalize MVT::ValueType and associated functions to be able to represent
extended vector types. Remove the special SDNode opcodes used for pre-legalize
vector operations, and the special MVT::Vector type used with them. Adjust
lowering and legalize to work with the normal SDNode kinds instead, and to
use the normal MVT functions to work with vector types instead of using the
two special operands that the pre-legalize nodes held.

This allows pre-legalize and post-legalize DAGs, and the code that operates
on them, to be more consistent. Pre-legalize vector operators can be handled
more consistently with scalar operators. And, -view-dag-combine1-dags and
-view-legalize-dags now look prettier for vector code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37719 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 16:23:39 +00:00
Dan Gohman
32791e06d8 Make minor adjustments to whitespace and comments to reduce differences
between SSE1 instructions and their respective SSE2 analogues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37718 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 15:44:19 +00:00
Dan Gohman
01976307d2 Fix loadv2i32 to be loadv4i32, though it isn't actually used anywhere yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37717 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 15:19:03 +00:00
Dan Gohman
8bc49c2fe7 Say AT&T instead of Intel in the comments for AT&T support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37716 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 15:11:25 +00:00
Anton Korobeynikov
5248896635 Provide hook for alloca on VCPP. Patch by Scott Graham
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37715 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 07:12:14 +00:00
Owen Anderson
f62c44a38d 1) Fix an issue with non-deterministic iteration order in phi_translate
2) Remove some maximal-set computing code that is no longer used.
3) Use a post-order CFG traversal to compute ANTIC_IN instead of a postdom traversal.
This causes the ANTIC_IN calculation to converge much faster.  Thanks to Daniel Berlin for suggesting this.

With this patch, the time to optimize 403.gcc decreased from 17.5s to 7.5s, and Anton's huge
testcase decreased from 62 minutes to 38 seconds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37714 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 05:41:12 +00:00
Nick Lewycky
4390feb7ae Fix value ranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-24 20:14:22 +00:00
Owen Anderson
79a6370133 Fix a silly mistake that was causing failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37712 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-24 08:42:24 +00:00
Nick Lewycky
dea252689d Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37710 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-24 04:40:16 +00:00
Nick Lewycky
984504b912 Remove use of ETForest. Also cleaned up issues around unreachable basic
blocks, and optimizing within one basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37709 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-24 04:36:20 +00:00
Owen Anderson
647580483c Rework topo_sort so eliminate some behavior that scaled terribly. This reduces the time to optimize 403.gcc from 18.2s to 17.5s,
and has an even larger effect on larger testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37708 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 21:31:16 +00:00
Owen Anderson
2106f61f23 Perform fewer set insertions while calculating ANTIC_IN. This reduces the amount of time to optimize 403.gcc from 21.9s to 18.2s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37707 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 18:27:04 +00:00
Owen Anderson
b3b37345de Remove some code that I was using for collecting performance information that should not have been committed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37706 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 17:04:40 +00:00
Owen Anderson
0819a9d386 Fix the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37705 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 16:59:54 +00:00
Dan Gohman
ea859be53c Move ComputeMaskedBits, MaskedValueIsZero, and ComputeNumSignBits from
TargetLowering to SelectionDAG so that they have more convenient
access to the current DAG, in preparation for the ValueType routines
being changed from standalone functions to members of SelectionDAG for
the pre-legalize vector type changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37704 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 14:59:07 +00:00
Duraid Madina
a8c7682939 check in the BigBlock local register allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37703 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 08:27:12 +00:00
Owen Anderson
124084604d Avoid excessive calls to find_leader when calculating AVAIL_OUT. This reduces the time to optimize 403.gcc from 23.5s to 21.9s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37702 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 03:14:03 +00:00
Evan Cheng
0b2ce1fc19 std::set is really really terrible. Switch to SmallPtrSet to reduce compile time. For Duraid's example. The overall isel time is reduced from 0.6255 sec to 0.1876 sec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37701 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 01:35:51 +00:00
Dale Johannesen
5411835165 Quote complex names for Darwin X86 and ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37700 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 00:54:56 +00:00
Owen Anderson
e8138ffeaf Reserve space in vectors before topologically sorting into them. This improves the time to optimize 403.gcc from 28s to 23.5s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37699 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 00:43:22 +00:00
Owen Anderson
82575d8ab1 Make a bunch of optimizations for compile time to GVNPRE, including smarter set unions, deferring blocks rather than computing maximal sets, and smarter use of sets. With these enhancements, the time to optimize 273.perlbmk goes from 5.3s to 2.7s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37698 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 00:20:30 +00:00
Owen Anderson
6394e5e4fd Fix a bug in SmallPtrSet that was causing GVNPRE to enter an infinite loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-22 00:11:18 +00:00
Chris Lattner
61766cae0b Two changes:
1. Make SmallPtrSet::erase faster in the small case by replacing a memmove
    with a pointer copy.
 2. Fix a bug where the null terminator at the end of the array in the small
    case was not copied


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37696 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 23:23:32 +00:00
Devang Patel
25e681ac22 CallGraphSCCPass manager may require other passes.
Use schedulePass() to accomodate these requirement instead of directly
assigning a manager to new CallGraph PassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37695 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 22:29:02 +00:00
Chris Lattner
1dbfd48fa2 Significantly improve the documentation of the instcombine divide/compare
transformation.  Also, keep track of which end of the integer interval overflows
occur on.  This fixes Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll
and rdar://5278853, a miscompilation of perl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 18:11:19 +00:00
Owen Anderson
66fd906074 Change lots of sets from std::set to SmallPtrSet. This reduces the time required to optimize 253.perlbmk from 10.9s to 5.3s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37690 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 17:57:53 +00:00
Devang Patel
0e7f728ad1 Move code to update dominator information after basic block is split
from LoopSimplify.cpp to Dominator.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37689 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 17:23:45 +00:00
Dan Gohman
2d74a318de Tidy up ValueType names in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37688 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 14:48:26 +00:00
Dan Gohman
b9f1019696 Rename TargetLowering::getNumElements and friends to
TargetLowering::getNumRegisters and similar, to avoid confusion with
the actual number of elements for vector types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37687 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 14:42:22 +00:00
Evan Cheng
b13cdbd865 Xforms:
(add (select cc, 0, c), x) -> (select cc, x, (add, x, c))
(sub x, (select cc, 0, c)) -> (select cc, x, (sub, x, c))


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37685 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 07:39:16 +00:00
Owen Anderson
58e087b6e3 Eliminate a redundant check. This speeds up optimization of 253.perlbmk from 13.5 seconds to 10.9 seconds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37683 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 01:59:05 +00:00
Owen Anderson
9cb56014ce Comment-ize the functions in GVNPRE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37681 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-21 00:19:05 +00:00
Chris Lattner
562ef78df2 refactor a bunch of code out of visitICmpInstWithInstAndIntCst into its own
routine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37679 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-20 23:46:26 +00:00
Owen Anderson
3eaca716bf Split runOnFunction into many smaller functions. This make it easier to get accurate performance analysis of GVNPRE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37678 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-20 22:10:02 +00:00
Owen Anderson
0304b2bc2b Make GVNPRE accurate report whether it modified the function or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37673 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-20 18:30:20 +00:00
Owen Anderson
5dbea73e35 Get rid of an unneeded helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37670 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-20 00:43:33 +00:00
Evan Cheng
97e604e7d8 Be more conservative of duplicating blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37669 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19 23:55:02 +00:00
Owen Anderson
4f703ec0a1 Use a DenseMap instead of an std::map for the value numbering. This reduces the time to optimize lencod on a PPC Debug build from ~300s to ~140s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37668 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19 23:23:54 +00:00
Owen Anderson
52471b102c Make dependsOnInvoke much more specific in what it tests, which in turn make it much faster to run. This reduces the time to optimize lencondwith a debug build on PPC from ~450s to ~300s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37667 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19 23:07:16 +00:00