Commit Graph

23674 Commits

Author SHA1 Message Date
Duncan Sands
6f7e1cddf6 ExpungeNode is only needed for new nodes! This
fixes CodeGen/PowerPC/2008-06-19-LegalizerCrash.ll
when using the new LegalizeTypes infrastructure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52903 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 16:43:45 +00:00
Duncan Sands
d3ca9fc998 Support for VAARG. As noted in a comment, this is
wrong for types like x86 long double and i1, but
no worse than what is done in LegalizeDAG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52898 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 13:55:15 +00:00
Duncan Sands
7fc8ab81f5 Support for promoting select_cc operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 11:50:11 +00:00
Duncan Sands
f9516208e5 Revert the SelectionDAG optimization that makes
it impossible to create a MERGE_VALUES node with
only one result: sometimes it is useful to be able
to create a node with only one result out of one of
the results of a node with more than one result, for
example because the new node will eventually be used
to replace a one-result node using ReplaceAllUsesWith,
cf X86TargetLowering::ExpandFP_TO_SINT.  On the other
hand, most users of MERGE_VALUES don't need this and
for them the optimization was valuable.  So add a new
utility method getMergeValues for creating MERGE_VALUES
nodes which by default performs the optimization.
Change almost everywhere to use getMergeValues (and
tidy some stuff up at the same time).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52893 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 10:19:09 +00:00
Evan Cheng
0ff39b3feb - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag.
- Correctly handle memcpy from constant string which is zero-initialized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 07:31:25 +00:00
Chris Lattner
80c1a5622a Implement split and scalarize for SELECT_CC, fixing PR2504
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 02:43:01 +00:00
Nick Lewycky
a11e2eb845 Add a value range analysis that lazily computes ranges using ScalarEvolutions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 00:04:21 +00:00
Anton Korobeynikov
6d116bc7ce Revert (52748 and friends):
Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.

This unbreaks llvm-gcc bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-29 17:57:03 +00:00
Anton Korobeynikov
28a2b54580 Start refactoring of asmprinters: provide a TAI hook, which will select a 'section kind' for a global.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 13:45:57 +00:00
Anton Korobeynikov
4d580651b3 Unbreak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:10:06 +00:00
Anton Korobeynikov
f0302cd1ae Temporary rever invalid commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:09:48 +00:00
Anton Korobeynikov
e51ab444f4 Move printing of module-level GVs into dedicated helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:09:32 +00:00
Anton Korobeynikov
31f98154a7 Use common naming convention
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:09:17 +00:00
Anton Korobeynikov
1ecf0eedc4 Factor out stuff into helper function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52862 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:09:01 +00:00
Anton Korobeynikov
36a5701ad7 Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:08:44 +00:00
Anton Korobeynikov
75b6882d3c Remove X86SharedAsmPrinter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52860 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:08:27 +00:00
Anton Korobeynikov
9136438b08 whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52859 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:08:09 +00:00
Anton Korobeynikov
1c4b5eaa46 Make intel asmprinter child of generic asmprinter, not x86 shared asm printer. This leads to some code duplication, which will be resolved later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:07:54 +00:00
Anton Korobeynikov
271329af24 Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:07:35 +00:00
Anton Korobeynikov
b131b44443 Whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52856 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 11:07:18 +00:00
Chris Lattner
03a5707955 Really fix the bootstrap failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52854 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 06:24:50 +00:00
Chris Lattner
b746b82113 Add back the capability to include nul characters in strings with
GetConstantStringInfo.  This will hopefully restore llvm-gcc to 
happy bootstrap land.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 05:33:32 +00:00
Chris Lattner
3284d42c17 Tighten up checking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 04:37:04 +00:00
Dan Gohman
77455617fb When folding a bitcast into a load or store, preserve the alignment
information of the original load or store, which is checked to be
at least as good, and possibly better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 00:45:22 +00:00
Seo Sanghyeon
fd6437f4f9 Fix GetMainExecutable. Patch by Sam Bishop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52847 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 22:55:30 +00:00
Evan Cheng
01b2e236b5 Looks like this condition is inverted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52841 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 22:11:49 +00:00
Chris Lattner
97388469b1 implement some fixme's by making "autorenaming" in the value symbol table not
thrash the heap with string stuff (e.g. utostr).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52838 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:26:26 +00:00
Chris Lattner
48cd712d4c simplify some code to avoid string thrashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52837 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:25:24 +00:00
Anton Korobeynikov
8573986f30 Use StringSet instead of std::set<std::string>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:22:49 +00:00
Chris Lattner
bb0e248718 Add a new version of Module::getFunction that takes a const char* instead
of a std::string.  This avoids copying the string to the heap in common
cases.  Patch by Pratik Solanki!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:09:10 +00:00
Devang Patel
42af887105 Add dominator info printer pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52829 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 16:43:21 +00:00
Anton Korobeynikov
b2931f29f3 Provide correct encoding for PPC LWARX instructions.
Patch by Gary Benson!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52828 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 16:10:20 +00:00
Bill Wendling
f0e9c56540 Reduce number of times .size() is called on a vector. Rename some variables to
match normal naming scheme.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 07:13:44 +00:00
Owen Anderson
bffdf66b80 Use a SmallSet when we can to reduce memory allocations.
This speeds up a particular testcase from 0.0302s to 0.0222s in LiveVariables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52819 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 07:05:59 +00:00
Owen Anderson
1360b7d8f8 Cache subregister relationships in a set in TargetRegisterInfo to allow faster lookups.
This speeds up LiveVariables from 0.6279s to 0.6165s on kimwitu++.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 06:56:04 +00:00
Chris Lattner
3648f9f0ae fix the regressions from Eric's patch by making GetConstantStringInfo
tolerate a non-nul-terminated string, and handling a direct global 
reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52813 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 03:36:51 +00:00
Chris Lattner
07c68f9b6f simplify this check, GetConstantStringInfo validates that a
global is constant already.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52812 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 03:18:41 +00:00
Chris Lattner
a534b0f7bf when linking globals, make sure to preserve the address space of the global.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52810 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 03:10:24 +00:00
Bill Wendling
0ac1b6d768 Cruft left from patch revert...sorry. :-(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52808 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 01:32:08 +00:00
Bill Wendling
914c970899 Reverting broken patch r52803.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52806 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 01:27:56 +00:00
Owen Anderson
b827c26e1e Don't perform expensive queries checking for super and sub registers when we know that there aren't any.
This speed up LiveVariables on instcombine at -O0 -g from 0.3855s to 0.3503s.  Look for more improvements in this area soon!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52804 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 01:22:50 +00:00
Bill Wendling
e6b6bae536 - Remove a use of std::vector.
- Make sure that we're not recalculating the size of a vector
  that never changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52803 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 00:56:36 +00:00
Bill Wendling
305635abea Refactor the DebugInfoDesc stuff out of the MachineModuleInfo file. Clean up
some uses of std::vector, where it's return std::vector by value. Yuck!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52800 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 00:09:40 +00:00
Chris Lattner
f77e46be6d duncan points out that isOperationLegal includes a check for
type legality.  Thanks Duncan!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52786 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 17:16:00 +00:00
Owen Anderson
8342cfff9a Don't create a whole new string just to copy the elements into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52785 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 17:06:02 +00:00
Matthijs Kooijman
f512281d61 Make LLVM compile on DragonFly BSD (PR2499).
Patch by Hasso Tepper!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52781 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 10:36:58 +00:00
Bill Wendling
fc1fd54a34 Cleanup for unitialized types. Patch by Jean-Daniel Dupas!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 08:32:05 +00:00
Chris Lattner
6521549188 "An improved Mach-O file type detection for sys::IdentifyFileType()
This patch add supports for single architecture mach-o files (the current implementation only support Universal Binary), and solve the signature conflict between java class and Universal Binary magics.

Note that this function will always returned dynamic library for Universal Binaries (like the current implementation) because the binary type is not include in the file header."

Patch by Jean-Daniel Dupas!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 05:17:18 +00:00
Owen Anderson
aefacb5972 Reserve the size we'll need in advance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52763 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 04:47:41 +00:00
Dale Johannesen
b5dae00325 Fixes the last x86-64 test failure in compat.exp:
<16 x float> is 64-byte aligned (for some reason),
which gets us into the stack realignment code.  The
computation changing FP-relative offsets to SP-relative
was broken, assiging a spill temp to a location
also used for parameter passing.  This
fixes it by rounding up the stack frame to a multiple
of the largest alignment (I concluded it wasn't fixable
without doing this, but I'm not very sure.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52750 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 01:51:13 +00:00