Dan Gohman
e9f33e576d
Don't use ISD namespace opcodes for MachineInstrs.
...
llvm-svn: 52932
2008-06-30 22:23:08 +00:00
Dan Gohman
082b08f33a
Use a simpler but equivalent form of RecordSource.
...
llvm-svn: 52931
2008-06-30 22:21:03 +00:00
Evan Cheng
3ec3837c38
Add timing report for various sub-passes under SelectionDAGISel.
...
llvm-svn: 52930
2008-06-30 22:10:09 +00:00
Dan Gohman
c8c04b1ff4
std::ostream and std::string microoptimizations for asm printing.
...
llvm-svn: 52929
2008-06-30 22:03:41 +00:00
Dan Gohman
9997cc353f
Use reserve.
...
SelectionDAG::allnodes_size is linear, but that doesn't appear to
outweigh the benefit of reducing heap traffic. If it does become a
problem, we should teach SelectionDAG to keep a count of how many
nodes are live, because there are several other places where that
information would be useful as well.
llvm-svn: 52926
2008-06-30 21:04:06 +00:00
Dan Gohman
e58f07e5d6
Update comments to new-style syntax.
...
llvm-svn: 52925
2008-06-30 21:00:56 +00:00
Dan Gohman
6cc648891b
Rename ISD::LOCATION to ISD::DBG_STOPPOINT to better reflect its
...
purpose, and give it a custom SDNode subclass so that it doesn't
need to have line number, column number, filename string, and
directory string, all existing as individual SDNodes to be the
operands.
This was the only user of ISD::STRING, StringSDNode, etc., so
remove those and some associated code.
This makes stop-points considerably easier to read in
-view-legalize-dags output, and reduces overhead (creating new
nodes and copying std::strings into them) on code containing
debugging information.
llvm-svn: 52924
2008-06-30 20:59:49 +00:00
Evan Cheng
3f664b6fd3
Split scheduling from instruction selection.
...
llvm-svn: 52923
2008-06-30 20:45:06 +00:00
Dale Johannesen
30d136e2c6
No need to align the stack if there are no stack
...
objects. Fixes a couple of tests on Linux.
llvm-svn: 52921
2008-06-30 20:40:16 +00:00
Evan Cheng
a83d69e3b9
Remove unneeded include.
...
llvm-svn: 52920
2008-06-30 20:38:22 +00:00
Dan Gohman
295abfe228
Replace some std::vectors that showed up in heap profiling with
...
SmallVectors. Change the signature of TargetLowering::LowerArguments
to avoid returning a vector by value, and update the two targets
which still use this directly, Sparc and IA64, accordingly.
llvm-svn: 52917
2008-06-30 20:31:15 +00:00
Dan Gohman
62c0b69aec
Correct the allocation size for CCState's UsedRegs member, which
...
only needs one bit for each register. UsedRegs is a SmallVector
sized at 16, so this eliminates a heap allocation/free for every
call and return processed by Legalize on most targets.
llvm-svn: 52915
2008-06-30 20:25:31 +00:00
Devang Patel
5b8e75e2fe
Move dominator info printer into tool/opt/GraphPrinters.cpp
...
llvm-svn: 52907
2008-06-30 17:32:58 +00:00
Duncan Sands
93d7b1b4fa
ExpungeNode is only needed for new nodes! This
...
fixes CodeGen/PowerPC/2008-06-19-LegalizerCrash.ll
when using the new LegalizeTypes infrastructure.
llvm-svn: 52903
2008-06-30 16:43:45 +00:00
Duncan Sands
c68385d4b5
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.
llvm-svn: 52898
2008-06-30 13:55:15 +00:00
Duncan Sands
a706115957
Support for promoting select_cc operands.
...
llvm-svn: 52895
2008-06-30 11:50:11 +00:00
Duncan Sands
c882a4eba9
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).
llvm-svn: 52893
2008-06-30 10:19:09 +00:00
Evan Cheng
2005804de6
- 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.
llvm-svn: 52891
2008-06-30 07:31:25 +00:00
Chris Lattner
95fecdd63a
Implement split and scalarize for SELECT_CC, fixing PR2504
...
llvm-svn: 52887
2008-06-30 02:43:01 +00:00
Nick Lewycky
d63159dcd4
Add a value range analysis that lazily computes ranges using ScalarEvolutions.
...
llvm-svn: 52885
2008-06-30 00:04:21 +00:00
Anton Korobeynikov
6f260767ec
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.
llvm-svn: 52884
2008-06-29 17:57:03 +00:00
Anton Korobeynikov
9e8c154272
Start refactoring of asmprinters: provide a TAI hook, which will select a 'section kind' for a global.
...
llvm-svn: 52868
2008-06-28 13:45:57 +00:00
Anton Korobeynikov
0b708e559e
Unbreak
...
llvm-svn: 52866
2008-06-28 11:10:06 +00:00
Anton Korobeynikov
8562255056
Temporary rever invalid commit
...
llvm-svn: 52865
2008-06-28 11:09:48 +00:00
Anton Korobeynikov
ea88d91267
Move printing of module-level GVs into dedicated helper
...
llvm-svn: 52864
2008-06-28 11:09:32 +00:00
Anton Korobeynikov
77c3528f69
Use common naming convention
...
llvm-svn: 52863
2008-06-28 11:09:17 +00:00
Anton Korobeynikov
2331efee7e
Factor out stuff into helper function
...
llvm-svn: 52862
2008-06-28 11:09:01 +00:00
Anton Korobeynikov
908c1fab55
Cleanup
...
llvm-svn: 52861
2008-06-28 11:08:44 +00:00
Anton Korobeynikov
adec555f96
Remove X86SharedAsmPrinter
...
llvm-svn: 52860
2008-06-28 11:08:27 +00:00
Anton Korobeynikov
dcc6a8314a
whitespace cleanup
...
llvm-svn: 52859
2008-06-28 11:08:09 +00:00
Anton Korobeynikov
03a62267fe
Make intel asmprinter child of generic asmprinter, not x86 shared asm printer. This leads to some code duplication, which will be resolved later.
...
llvm-svn: 52858
2008-06-28 11:07:54 +00:00
Anton Korobeynikov
b75aeb6b1a
Cleanup
...
llvm-svn: 52857
2008-06-28 11:07:35 +00:00
Anton Korobeynikov
f4017f7d50
Whitespace cleanup
...
llvm-svn: 52856
2008-06-28 11:07:18 +00:00
Chris Lattner
2deb9ae6ad
Really fix the bootstrap failure.
...
llvm-svn: 52854
2008-06-28 06:24:50 +00:00
Chris Lattner
090d81df5e
Add back the capability to include nul characters in strings with
...
GetConstantStringInfo. This will hopefully restore llvm-gcc to
happy bootstrap land.
llvm-svn: 52851
2008-06-28 05:33:32 +00:00
Chris Lattner
98b286ff98
Tighten up checking.
...
llvm-svn: 52850
2008-06-28 04:37:04 +00:00
Dan Gohman
6b87f869e4
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.
llvm-svn: 52849
2008-06-28 00:45:22 +00:00
Seo Sanghyeon
12944690d5
Fix GetMainExecutable. Patch by Sam Bishop.
...
llvm-svn: 52847
2008-06-27 22:55:30 +00:00
Evan Cheng
36adcb1eea
Looks like this condition is inverted.
...
llvm-svn: 52841
2008-06-27 22:11:49 +00:00
Chris Lattner
8e2bd43f29
implement some fixme's by making "autorenaming" in the value symbol table not
...
thrash the heap with string stuff (e.g. utostr).
llvm-svn: 52838
2008-06-27 21:26:26 +00:00
Chris Lattner
5c75711282
simplify some code to avoid string thrashing.
...
llvm-svn: 52837
2008-06-27 21:25:24 +00:00
Anton Korobeynikov
e48fe3dde8
Use StringSet instead of std::set<std::string>
...
llvm-svn: 52836
2008-06-27 21:22:49 +00:00
Chris Lattner
6b3b22747a
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!
llvm-svn: 52834
2008-06-27 21:09:10 +00:00
Devang Patel
d5faa747e9
Add dominator info printer pass.
...
llvm-svn: 52829
2008-06-27 16:43:21 +00:00
Anton Korobeynikov
eb63554d81
Provide correct encoding for PPC LWARX instructions.
...
Patch by Gary Benson!
llvm-svn: 52828
2008-06-27 16:10:20 +00:00
Bill Wendling
39cc6881e1
Reduce number of times .size() is called on a vector. Rename some variables to
...
match normal naming scheme.
llvm-svn: 52820
2008-06-27 07:13:44 +00:00
Owen Anderson
e0604d46c2
Use a SmallSet when we can to reduce memory allocations.
...
This speeds up a particular testcase from 0.0302s to 0.0222s in LiveVariables.
llvm-svn: 52819
2008-06-27 07:05:59 +00:00
Owen Anderson
59ed35b2c2
Cache subregister relationships in a set in TargetRegisterInfo to allow faster lookups.
...
This speeds up LiveVariables from 0.6279s to 0.6165s on kimwitu++.
llvm-svn: 52818
2008-06-27 06:56:04 +00:00
Chris Lattner
c94b39d65c
fix the regressions from Eric's patch by making GetConstantStringInfo
...
tolerate a non-nul-terminated string, and handling a direct global
reference.
llvm-svn: 52813
2008-06-27 03:36:51 +00:00
Chris Lattner
635da8cff5
simplify this check, GetConstantStringInfo validates that a
...
global is constant already. No functionality change.
llvm-svn: 52812
2008-06-27 03:18:41 +00:00
Chris Lattner
f40ef5f964
when linking globals, make sure to preserve the address space of the global.
...
llvm-svn: 52810
2008-06-27 03:10:24 +00:00
Bill Wendling
e0ea004d40
Cruft left from patch revert...sorry. :-(
...
llvm-svn: 52808
2008-06-27 01:32:08 +00:00
Bill Wendling
e9909a1c2a
Reverting broken patch r52803.
...
llvm-svn: 52806
2008-06-27 01:27:56 +00:00
Owen Anderson
242026fa70
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!
llvm-svn: 52804
2008-06-27 01:22:50 +00:00
Bill Wendling
d0c2026584
- Remove a use of std::vector.
...
- Make sure that we're not recalculating the size of a vector
that never changes.
llvm-svn: 52803
2008-06-27 00:56:36 +00:00
Bill Wendling
2ab62b9a92
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!
llvm-svn: 52800
2008-06-27 00:09:40 +00:00
Chris Lattner
85cf534e04
duncan points out that isOperationLegal includes a check for
...
type legality. Thanks Duncan!
llvm-svn: 52786
2008-06-26 17:16:00 +00:00
Owen Anderson
889d683ee8
Don't create a whole new string just to copy the elements into it.
...
llvm-svn: 52785
2008-06-26 17:06:02 +00:00
Matthijs Kooijman
b1217bdbb0
Make LLVM compile on DragonFly BSD (PR2499).
...
Patch by Hasso Tepper!
llvm-svn: 52781
2008-06-26 10:36:58 +00:00
Bill Wendling
2d9397ea16
Cleanup for unitialized types. Patch by Jean-Daniel Dupas!
...
llvm-svn: 52775
2008-06-26 08:32:05 +00:00
Chris Lattner
d67c47bc62
"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!
llvm-svn: 52766
2008-06-26 05:17:18 +00:00
Owen Anderson
8c36469880
Reserve the size we'll need in advance.
...
llvm-svn: 52763
2008-06-26 04:47:41 +00:00
Dale Johannesen
f170e29cf5
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.)
llvm-svn: 52750
2008-06-26 01:51:13 +00:00
Eric Christopher
155c3679f6
Remove unused function.
...
llvm-svn: 52749
2008-06-26 01:19:35 +00:00
Eric Christopher
4f05c48718
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.
llvm-svn: 52748
2008-06-26 00:31:12 +00:00
Chris Lattner
2b67ff8632
when we know the signbit of an input to uint_to_fp is zero,
...
change it to sint_to_fp on targets where that is cheaper (and
visaversa of course). This allows us to compile uint_to_fp to:
_test:
movl 4(%esp), %eax
shrl $23, %eax
cvtsi2ss %eax, %xmm0
movl 8(%esp), %eax
movss %xmm0, (%eax)
ret
instead of:
.align 3
LCPI1_0: ## double
.long 0 ## double least significant word 4.5036e+15
.long 1127219200 ## double most significant word 4.5036e+15
.text
.align 4,0x90
.globl _test
_test:
subl $12, %esp
movl 16(%esp), %eax
shrl $23, %eax
movl %eax, (%esp)
movl $1127219200, 4(%esp)
movsd (%esp), %xmm0
subsd LCPI1_0, %xmm0
cvtsd2ss %xmm0, %xmm0
movl 20(%esp), %eax
movss %xmm0, (%eax)
addl $12, %esp
ret
llvm-svn: 52747
2008-06-26 00:16:49 +00:00
Owen Anderson
68f11ecb86
Remember which MachineOperand we were processing, so we don't have to scan the list to find it again later.
...
This speeds up live intervals from 0.37s to 0.30s on instcombine.
llvm-svn: 52745
2008-06-25 23:39:39 +00:00
Dan Gohman
d1467012f5
Fix the text in an assert string.
...
llvm-svn: 52744
2008-06-25 22:14:43 +00:00
Evan Cheng
71fbfe73c1
- Fix a x86 vector isel bug: illegal transformation of a vector_shuffle into a
...
shift.
- Add a readme entry for a missing vector_shuffle optimization that results in
awful codegen.
llvm-svn: 52740
2008-06-25 20:52:59 +00:00
Duncan Sands
12c1bee452
Add support for expanding PPC 128 bit floats.
...
For this it is convenient to permit floats to
be used with EXTRACT_ELEMENT, so I tweaked
things to allow that. I also added libcalls
for ppcf128 to i32 forms of FP_TO_XINT, since
they exist in libgcc and this case can certainly
occur (and does occur in the testsuite) - before
the i64 libcall was being used. Also, the
XINT_TO_FP result seemed to be wrong when
the argument is an i128: the wrong fudge
factor was added (the i32 and i64 cases were
handled directly, but the i128 code fell
through to some generic softening code which
seemed to think it was i64 to f32!). So I
fixed it by adding a fudge factor that I
found in my breakfast cereal.
llvm-svn: 52739
2008-06-25 20:24:48 +00:00
Chris Lattner
9c5a1a7da3
Implement JIT support for global aliases, patch by David Chisnall!
...
llvm-svn: 52738
2008-06-25 20:21:35 +00:00
Evan Cheng
5ed0e42cc3
Restore DeadArgElim back to 52570. It's breaking 447.dealII.
...
llvm-svn: 52736
2008-06-25 18:10:09 +00:00
Chris Lattner
ef1aa7c9db
Switch the PPC backend and target-independent JIT to use the libsystem
...
InvalidateInstructionCache method instead of calling through
a hook on the JIT. This is a host feature, not a target feature.
llvm-svn: 52734
2008-06-25 17:18:44 +00:00
Chris Lattner
a42eed01e2
fix compilation errors in my previous patch
...
llvm-svn: 52733
2008-06-25 17:17:53 +00:00
Chris Lattner
24c59453f6
Add a new InvalidateInstructionCache method to sys::Memory.
...
llvm-svn: 52731
2008-06-25 17:14:10 +00:00
Dan Gohman
8205b235b9
SimpleInstructionSelector is here no more.
...
llvm-svn: 52725
2008-06-25 16:38:59 +00:00
Duncan Sands
ab85726912
Add/complete support for integer and float
...
select_cc and friends. This code could be
factorized a bit but I'm not sure that it's
worth it.
llvm-svn: 52724
2008-06-25 16:34:21 +00:00
Duncan Sands
93aacd5b48
Pacify gcc-4.3.
...
llvm-svn: 52723
2008-06-25 16:31:18 +00:00
Dan Gohman
404964dbc0
Remove the OrigVT member from AtomicSDNode, as it is redundant with
...
the base SDNode's VTList.
llvm-svn: 52722
2008-06-25 16:07:49 +00:00
Mon P Wang
7d89d61387
Added MemOperands to Atomic operations since Atomics touches memory.
...
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub
llvm-svn: 52706
2008-06-25 08:15:39 +00:00
Matthijs Kooijman
45bffc6580
Fix a (false) warning on darwin.
...
llvm-svn: 52705
2008-06-25 08:12:16 +00:00
Matthijs Kooijman
9b78534b71
Fix some cosmetics in comments.
...
llvm-svn: 52704
2008-06-25 08:10:21 +00:00
Evan Cheng
9a3db8fb91
- Use O(1) check of basic block size limit.
...
- Avoid speculatively execute vector ops.
llvm-svn: 52703
2008-06-25 07:50:12 +00:00
Chris Lattner
73b52018e9
Fix PR2488, a case where we deleted stack restores too aggressively.
...
llvm-svn: 52702
2008-06-25 05:59:28 +00:00
Evan Cheng
bab5925a0b
Enable two-address remat by default.
...
llvm-svn: 52701
2008-06-25 01:16:38 +00:00
Owen Anderson
968d4e2444
Use push_back rather than operator[], which is incorrect in this cases. Unfortunately, this slow the testcase down a little bit,
...
but only marginally.
llvm-svn: 52700
2008-06-25 01:05:05 +00:00
Dan Gohman
a08868acb3
Append to the ActiveTimers std::vector before looking at the timer instead
...
of after, so that any reallocation it does doesn't get counted for the pass
being timed. This probably doesn't account for a timing discrepancy I was
looking into, but I'm fixing it anyway.
llvm-svn: 52693
2008-06-24 22:07:07 +00:00
Dale Johannesen
fdf8fe6c03
Add v2f32 (MMX) type to X86. Support is primitive:
...
load,store,call,return,bitcast. This is enough to
make call and return work.
llvm-svn: 52691
2008-06-24 22:01:44 +00:00
Owen Anderson
673cae8561
In ConstantArray::getAsString(), we know the size of the resultant string in advance so we can pre-allocate it and just fill in
...
the entries. This improves the time for the AsmPrinter on InstructionCombining.cpp from 0.4248s to 0.3370s.
llvm-svn: 52690
2008-06-24 21:58:29 +00:00
Owen Anderson
8b2f51618a
Use SmallVector instead of std::vector for a minor compile time improvement.
...
llvm-svn: 52689
2008-06-24 21:44:59 +00:00
Dan Gohman
b9384c5e87
Revert 52645, the loop unroller changes. It caused a regression in 252.eon.
...
llvm-svn: 52688
2008-06-24 20:44:42 +00:00
Dan Gohman
e9f0a28c64
Fix a typo in a comment.
...
llvm-svn: 52687
2008-06-24 18:00:21 +00:00
Dan Gohman
fcb2dc2dd6
Use const_cast instead of a C-style cast.
...
llvm-svn: 52684
2008-06-24 17:47:37 +00:00
Matthijs Kooijman
ff03ea8aeb
Commit the new DeadArgElim pass again, this time with the gcc bootstrap failures fixed.
...
Also add a testcase to reproduce the gcc bootstrap failure in very much reduced form.
llvm-svn: 52677
2008-06-24 16:30:26 +00:00
Matthijs Kooijman
bb456f6b42
Rename a few variables to be more consistent.
...
llvm-svn: 52672
2008-06-24 09:14:10 +00:00
Evan Cheng
a62f5f0f82
If it's determined safe, remat MOV32r0 (i.e. xor r, r) and others as it is instead of using the longer MOV32ri instruction.
...
llvm-svn: 52670
2008-06-24 07:10:51 +00:00
Dan Gohman
29c5903a80
Fix some signed vs. unsigned issues in array and vector handling.
...
llvm-svn: 52664
2008-06-24 01:17:52 +00:00
Dan Gohman
9941a2dab3
Add a note about a potential PIC optimization.
...
llvm-svn: 52663
2008-06-24 00:53:07 +00:00
Dan Gohman
ebc59c90b7
Fixes for being compiled PIC on Linux. This isn't the most
...
general solution possible, but it's a fairly simple one.
Based on a patch from the OpenGTL project!
llvm-svn: 52662
2008-06-24 00:50:01 +00:00
Dan Gohman
0e992740a0
A brief survey of priority_queue usage in the tree turned this up
...
as a questionable case, but the code isn't actually needed.
llvm-svn: 52657
2008-06-23 23:51:16 +00:00