Chris Lattner
5d135cc20a
The isNotSuitableForSRA property is now dead, don't compute it.
...
llvm-svn: 45948
2008-01-14 01:32:52 +00:00
Chris Lattner
760b05a331
Change SRAGlobal to not depend on isNotSuitableForSRA, which makes it very
...
difficult to understand the invariants.
llvm-svn: 45947
2008-01-14 01:31:05 +00:00
Chris Lattner
c2933482a0
Make the 'shrink global to bool' optimization more self contained, and thus
...
easier to show that its safe. No functionality change.
llvm-svn: 45946
2008-01-14 01:17:44 +00:00
Chris Lattner
d22a5f6314
Turn a memcpy from a double* into a load/store of double instead of
...
a load/store of i64. The later prevents promotion/scalarrepl of the
source and dest in many cases.
This fixes the 300% performance regression of the byval stuff on
stepanov_v1p2.
llvm-svn: 45945
2008-01-14 00:28:35 +00:00
Chris Lattner
8560bb9d98
factor memcpy/memmove simplification out to its own SimplifyMemTransfer
...
method, no functionality change.
llvm-svn: 45944
2008-01-13 23:50:23 +00:00
Chris Lattner
5fbf76aaf4
simplify some code. If we can infer alignment for source and dest that are
...
greater than memcpy alignment, and if we lower to load/store, use the best
alignment info we have.
llvm-svn: 45943
2008-01-13 22:30:28 +00:00
Chris Lattner
4f69f1a721
simplify some code by adding a InsertBitCastBefore method,
...
make memmove->memcpy conversion a bit simpler.
llvm-svn: 45942
2008-01-13 22:23:22 +00:00
Duncan Sands
0c362b8606
Whitespace tweak.
...
llvm-svn: 45940
2008-01-13 21:20:29 +00:00
Duncan Sands
423244deda
Remove the assumption that byval has been applied to
...
a pointer to a struct.
llvm-svn: 45939
2008-01-13 21:19:59 +00:00
Duncan Sands
86c17f2ebf
Allow the byval attribute for pointers to any type with
...
a size, not just structs.
llvm-svn: 45938
2008-01-13 21:19:12 +00:00
Chris Lattner
32eae5daa5
Fix PR1907, a nasty miscompilation because instcombine didn't
...
realize that ne & sgt was a signed comparison (it was only
looking at whether the left compare was signed).
llvm-svn: 45937
2008-01-13 20:59:02 +00:00
Duncan Sands
1853262730
Check that nested functions don't get pointless
...
static chains.
llvm-svn: 45936
2008-01-13 18:44:12 +00:00
Duncan Sands
560625b701
Small simplification.
...
llvm-svn: 45932
2008-01-13 08:12:17 +00:00
Duncan Sands
7414cc131b
When turning a call to a bitcast function into a direct call,
...
if this becomes a varargs call then deal correctly with any
parameter attributes on the newly vararg call arguments.
llvm-svn: 45931
2008-01-13 08:02:44 +00:00
Chris Lattner
a20247cd7b
new testcase for rdar://5685492
...
llvm-svn: 45918
2008-01-13 00:19:57 +00:00
Chris Lattner
7fa87a190a
improve cygwin compatibility, patch by Sam Bishop
...
llvm-svn: 45917
2008-01-12 22:54:07 +00:00
Chris Lattner
8b29caac2c
clarify a note
...
llvm-svn: 45914
2008-01-12 18:58:46 +00:00
Evan Cheng
a5183224b0
Add hasByValArgument() to test if a call instruction has byval argument(s).
...
llvm-svn: 45913
2008-01-12 18:57:32 +00:00
Chris Lattner
d90840eddc
we don't have to make an explicit copy of a byval argument when
...
inlining a function if we know that the function does not write
to *any* memory. This implements test/Transforms/Inline/byval2.ll
llvm-svn: 45912
2008-01-12 18:54:29 +00:00
Evan Cheng
1e7cbf32c2
Indirect call with byval parameter requires a cast first.
...
llvm-svn: 45911
2008-01-12 18:53:07 +00:00
Duncan Sands
3b617cbe30
Be more liberal in what parameter attributes are
...
allowed on the vararg arguments of a call.
llvm-svn: 45909
2008-01-12 16:42:01 +00:00
Chris Lattner
fb5876f0be
Allow clients to specify the inline threshold when creating
...
the inliner pass. Patch by Robert Zeh.
llvm-svn: 45903
2008-01-12 06:49:13 +00:00
Chris Lattner
e1bd3e1e72
Add support for NetBSD, patch by Krister Walfridsson!
...
llvm-svn: 45902
2008-01-12 06:46:09 +00:00
Evan Cheng
01ee195d38
Add -disable-lto optimization.
...
llvm-svn: 45900
2008-01-12 04:27:18 +00:00
Chris Lattner
c23b7b79fa
this actually does pass with 4.0
...
llvm-svn: 45899
2008-01-12 01:45:22 +00:00
Evan Cheng
08584fc86a
Code clean up.
...
llvm-svn: 45898
2008-01-12 01:08:07 +00:00
Evan Cheng
2e84453e5b
ByVal arguments are passed on stack. Make sure to allocate a slot using size and alignment information on the parameter attribute.
...
llvm-svn: 45897
2008-01-12 01:07:41 +00:00
Chris Lattner
5e112f44c8
fix a wordo that gordon noticed :)
...
llvm-svn: 45896
2008-01-12 00:53:16 +00:00
Chris Lattner
0242c393d1
Any x86 instruction that reads from an invariant location is invariant.
...
This allows us to sink things like:
cvtsi2sd 32(%esp), %xmm1
when reading from the argument area, for example.
llvm-svn: 45895
2008-01-12 00:35:08 +00:00
Chris Lattner
efa13b2edd
implement support for sinking a load out the bottom of a block that
...
has no stores between the load and the end of block. This works
great and sinks hundreds of stores, but we can't turn it on because
machineinstrs don't have volatility information and we don't want to
sink volatile stores :(
llvm-svn: 45894
2008-01-12 00:17:41 +00:00
Chris Lattner
433aca5066
remove some incorrect classof's.
...
llvm-svn: 45893
2008-01-11 23:25:16 +00:00
Duncan Sands
6f49217a5e
When DAE drops the varargs part of a function, ensure any
...
attributes on the vararg call arguments are also dropped.
llvm-svn: 45892
2008-01-11 23:13:45 +00:00
Evan Cheng
438d36bf7d
More cbe byval fixes.
...
llvm-svn: 45891
2008-01-11 23:10:11 +00:00
Chris Lattner
3cc116abce
llvm-g++ 4.0 has completely different code for this warning,
...
just xfail it.
llvm-svn: 45890
2008-01-11 23:06:56 +00:00
Chris Lattner
e330f0fe21
new testcase
...
llvm-svn: 45888
2008-01-11 23:04:14 +00:00
Duncan Sands
e55a5806ac
Do not allow attributes beyond a function's last
...
parameter, even if it is a varargs function. Do
allow attributes on the varargs part of a call,
but not beyond the last argument. Only allow
selected attributes to be on the varargs part of
a call (currently only 'byval' is allowed). The
reasoning here is that most attributes, eg inreg,
simply make no sense here.
llvm-svn: 45887
2008-01-11 22:36:48 +00:00
Chris Lattner
a1246ba8ed
Teach argpromote to ruthlessly hack small byval structs when it can
...
get away with it, which exposes opportunities to eliminate the memory
objects entirely. For example, we now compile byval.ll to:
define internal void @f1(i32 %b.0, i64 %b.1) {
entry:
%tmp2 = add i32 %b.0, 1 ; <i32> [#uses=0]
ret void
}
define i32 @main() nounwind {
entry:
call void @f1( i32 1, i64 2 )
ret i32 0
}
This seems like it would trigger a lot for code that passes around small
structs (e.g. SDOperand's or _Complex)...
llvm-svn: 45886
2008-01-11 22:31:41 +00:00
Duncan Sands
41029353f9
Two occurrences on one line count as one...
...
llvm-svn: 45885
2008-01-11 21:46:24 +00:00
Duncan Sands
d99973b822
If there are attributes on the varargs part of a
...
call, don't discard them.
llvm-svn: 45884
2008-01-11 21:23:39 +00:00
Scott Michel
5afa19350b
More CellSPU refinements:
...
- struct_2.ll: Completely unaligned load/store testing
- call_indirect.ll, struct_1.ll: Add test lines to exercise
X-form [$reg($reg)] addressing
At this point, loads and stores should be under control (he says
in an optimistic tone of voice.)
llvm-svn: 45882
2008-01-11 21:01:19 +00:00
Dale Johannesen
8ca78844b0
Disable for now.
...
llvm-svn: 45881
2008-01-11 20:47:33 +00:00
Chris Lattner
8644bdca87
Use smallptrset instead of std::set for efficiency.
...
llvm-svn: 45878
2008-01-11 19:36:30 +00:00
Chris Lattner
44aaf42d14
a byval argument is guaranteed to be valid to load.
...
llvm-svn: 45877
2008-01-11 19:34:32 +00:00
Chris Lattner
129a0e4f7d
Update this code to use eraseFromParent where possible. Compute
...
whether an argument is byval and pass into isSafeToPromoteArgument.
llvm-svn: 45876
2008-01-11 19:20:39 +00:00
Chris Lattner
85a0b511cc
replace a loop with a constant time check.
...
llvm-svn: 45875
2008-01-11 18:55:10 +00:00
Chris Lattner
c9666b967f
another minor datastructure tweak.
...
llvm-svn: 45874
2008-01-11 18:47:45 +00:00
Chris Lattner
a6b0783f14
start using smallvector to avoid vector heap thrashing.
...
llvm-svn: 45873
2008-01-11 18:43:58 +00:00
Chris Lattner
89d996afce
add operator==/!= to smallvector.
...
llvm-svn: 45872
2008-01-11 18:42:02 +00:00
Chris Lattner
0293fca6d8
rename MachineInstr::setInstrDescriptor -> setDesc
...
llvm-svn: 45871
2008-01-11 18:10:50 +00:00
Chris Lattner
a83f66d1bb
remove xchg and shift-reg-by-1 instructions, which are dead.
...
llvm-svn: 45870
2008-01-11 18:00:50 +00:00