Dan Gohman
2e20dfb0f2
Fix a case where instcombine was stripping metadata (and alignment)
...
from stores when folding in bitcasts.
llvm-svn: 117265
2010-10-25 16:16:27 +00:00
Duncan Sands
31c803b2ba
Fix PR8445: a block with no predecessors may be the entry block, in which case
...
it isn't unreachable and should not be zapped. The check for the entry block
was missing in one case: a block containing a unwind instruction. While there,
do some small cleanups: "M" is not a great name for a Function* (it would be
more appropriate for a Module*), change it to "Fn"; use Fn in more places.
llvm-svn: 117224
2010-10-24 12:23:30 +00:00
Benjamin Kramer
76229bc128
SmallVectorize.
...
llvm-svn: 117213
2010-10-23 17:10:24 +00:00
Chandler Carruth
88c54b82c1
Switch attribute macros to use 'LLVM_' as a prefix. We retain the old names
...
until other LLVM projects using these are cleaned up.
llvm-svn: 117200
2010-10-23 08:10:43 +00:00
Bob Wilson
a4e231c880
Teach instcombine to set the alignment arguments for NEON load/store intrinsics.
...
llvm-svn: 117154
2010-10-22 21:41:48 +00:00
Duncan Sands
94da154558
RetOp is not actually used for anything useful (though
...
it looks like maybe it was supposed to be used in the
test...), so zap it (gcc-4.6 warning).
llvm-svn: 117023
2010-10-21 16:05:44 +00:00
Dan Gohman
f372cf869b
Reapply r116831 and r116839, converting AliasAnalysis to use
...
uint64_t, plus fixes for places I missed before.
llvm-svn: 116875
2010-10-19 22:54:46 +00:00
Dan Gohman
b4aa503501
Revert r116831 and r116839, which are breaking selfhost builds.
...
llvm-svn: 116858
2010-10-19 21:06:16 +00:00
Owen Anderson
a4fefc1949
Passes do not need to recursively initialize passes that they preserve, if
...
they do not also require them. This allows us to reduce inter-pass linkage
dependencies.
llvm-svn: 116854
2010-10-19 20:08:44 +00:00
Dan Gohman
896ac62346
Oops, check in all the files for converting AliasAnalysis to
...
use uint64_t.
llvm-svn: 116839
2010-10-19 18:08:27 +00:00
Owen Anderson
6c18d1aac0
Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
...
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.
Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.
I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.
llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Dan Gohman
14fe8cf238
Consistently use AliasAnalysis::UnknownSize instead of hardcoding ~0u.
...
llvm-svn: 116815
2010-10-19 17:06:23 +00:00
Mikhail Glushenkov
2072db24ed
GlobalOpt: EvaluateFunction() must not evaluate stores to weak_odr globals.
...
Fixes PR8389.
llvm-svn: 116812
2010-10-19 16:47:23 +00:00
Mikhail Glushenkov
cf2afe008d
Trailing whitespace.
...
llvm-svn: 116749
2010-10-18 21:16:00 +00:00
Dan Gohman
71af9db0e8
Make AliasSetTracker TBAA-aware, enabling TBAA-enabled LICM.
...
llvm-svn: 116743
2010-10-18 20:44:50 +00:00
Devang Patel
218f3206fa
Transfer debug loc to lowered call.
...
Patch by Alexander Herz!
llvm-svn: 116733
2010-10-18 18:53:44 +00:00
Benjamin Kramer
1dc34b48dd
Eliminate some calls to Value::getNameStr.
...
llvm-svn: 116670
2010-10-16 11:28:23 +00:00
Owen Anderson
18e4fed3fa
Generalize MemCpyOpt's handling of call slot forwarding to function properly when the call slot
...
forwarding is implemented with a load/store pair rather than a memcpy.
llvm-svn: 116637
2010-10-15 22:52:12 +00:00
Owen Anderson
071cee0c81
CallGraphSCC passes implicity require CallGraph analysis.
...
llvm-svn: 116443
2010-10-13 22:00:45 +00:00
Rafael Espindola
c2240adcc7
Fix PR8313 by changing ValueToValueMap use a TrackingVH.
...
llvm-svn: 116390
2010-10-13 02:08:17 +00:00
Rafael Espindola
229e38f0fe
Be more consistent in using ValueToValueMapTy.
...
llvm-svn: 116387
2010-10-13 01:36:30 +00:00
Owen Anderson
8ac477ffb5
Begin adding static dependence information to passes, which will allow us to
...
perform initialization without static constructors AND without explicit initialization
by the client. For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve. I hope to be able to relax
the latter requirement in the future.
llvm-svn: 116334
2010-10-12 19:48:12 +00:00
Kenneth Uildriks
b8d7efe785
Now using a variant of the existing inlining heuristics to decide whether to create a given specialization of a function in PartialSpecialization. If the total performance bonus across all callsites passing the same constant exceeds the specialization cost, we create the specialization.
...
llvm-svn: 116158
2010-10-09 22:06:36 +00:00
Dan Gohman
2fd85d7cd2
Filter out illegal formulae after updating offsets, not before, so that
...
formulae which become illegal as a result of the offset updating don't
escape.
This is for rdar://8529692. No testcase yet, because the given cases
hit use-list ordering differences.
llvm-svn: 116093
2010-10-08 19:33:26 +00:00
Daniel Dunbar
d4e9c3b43a
Update CMake.
...
llvm-svn: 116034
2010-10-08 02:30:03 +00:00
Dan Gohman
5947e1626a
Delete the FormulaSorter class and inline its one method into its
...
one user. This code will be restructured soon and FormulaSorter
is getting in the way.
llvm-svn: 116012
2010-10-07 23:52:18 +00:00
Dan Gohman
1b61fd9bff
Fix a spello.
...
llvm-svn: 116011
2010-10-07 23:43:09 +00:00
Dan Gohman
34f37e0d04
Charge a formula for explicit multiplies on scaled registers too,
...
not just base registers.
llvm-svn: 116010
2010-10-07 23:41:58 +00:00
Dan Gohman
49d638b45a
Use size_t for consistency.
...
llvm-svn: 116009
2010-10-07 23:37:58 +00:00
Dan Gohman
8e72611058
When merging one use into another, transfer the offsets from
...
the old use to the new one.
llvm-svn: 116008
2010-10-07 23:36:45 +00:00
Dan Gohman
a7b68d6d95
Fix LSR to keep the RegUseTracker up to date when combining users.
...
This doesn't usually matter, because the other heuristics usually
succeed regardless, but it's good to keep the register use
bookkeeping consistent.
llvm-svn: 116005
2010-10-07 23:33:43 +00:00
Devang Patel
57da4caa85
Remove LoopIndexSplit pass. It is neither maintained nor used by anyone.
...
llvm-svn: 116004
2010-10-07 23:29:37 +00:00
Owen Anderson
df7a4f2515
Now with fewer extraneous semicolons!
...
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Owen Anderson
9786868939
Add initialization routines for Instrumentation.
...
llvm-svn: 115971
2010-10-07 20:17:24 +00:00
Owen Anderson
f7ef5dfccc
Add initialization routines to InstCombine.
...
llvm-svn: 115965
2010-10-07 20:04:55 +00:00
Owen Anderson
bf70a035f0
Add an initialization routine for libLLVMipo.a
...
llvm-svn: 115933
2010-10-07 18:09:59 +00:00
Owen Anderson
4698c5d7f7
Next step on the getting-rid-of-static-ctors train: begin adding per-library
...
initialization functions that initialize the set of passes implemented in
that library. Add C bindings for these functions as well.
llvm-svn: 115927
2010-10-07 17:55:47 +00:00
Owen Anderson
5e19bfcde3
Move the pass initialization helper functions into the llvm namespace, and add
...
a header declaring them all. This is also where we will declare per-library pass-set
initializer functions down the road.
llvm-svn: 115900
2010-10-07 04:13:08 +00:00
Owen Anderson
6da4d820fa
Since the Hello pass is built as a loadable dynamic library, don't try to convert it to new-style registration yet.
...
llvm-svn: 115881
2010-10-07 00:31:16 +00:00
Owen Anderson
13a642da0b
Now that the profitable bits of EnableFullLoadPRE have been enabled by default, rip out the remainder.
...
Anyone interested in more general PRE would be better served by implementing it separately, to get real
anticipation calculation, etc.
llvm-svn: 115337
2010-10-01 20:02:55 +00:00
Eric Christopher
3ad2f3a2f2
Fix the other half of the alignment changing issue by making sure that the
...
memcpy alignment is the minimum of the incoming alignments.
Fixes PR 8266.
llvm-svn: 115305
2010-10-01 09:02:05 +00:00
Chris Lattner
c663a67384
fix PR8267 - Instcombine shouldn't optimizer away volatile memcpy's.
...
llvm-svn: 115296
2010-10-01 05:51:02 +00:00
Dale Johannesen
dd224d2333
Massive rewrite of MMX:
...
The x86_mmx type is used for MMX intrinsics, parameters and
return values where these use MMX registers, and is also
supported in load, store, and bitcast.
Only the above operations generate MMX instructions, and optimizations
do not operate on or produce MMX intrinsics.
MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into
smaller pieces. Optimizations may occur on these forms and the
result casted back to x86_mmx, provided the result feeds into a
previous existing x86_mmx operation.
The point of all this is prevent optimizations from introducing
MMX operations, which is unsafe due to the EMMS problem.
llvm-svn: 115243
2010-09-30 23:57:10 +00:00
Owen Anderson
3170a25a84
We do want to allow LoadPRE to perform LICM-like transformations: we already consider PHI nodes to be negligible for
...
code size (making this transform code size neutral), and it allows us to hoist values out of loops, which is always
a good thing.
llvm-svn: 115205
2010-09-30 20:53:04 +00:00
Jakob Stoklund Olesen
eb12f49fb7
Try again to disable critical edge splitting in CodeGenPrepare.
...
The bug that broke i386 linux has been fixed in r115191.
llvm-svn: 115204
2010-09-30 20:51:52 +00:00
Benjamin Kramer
5d66e5feb8
Tighten up prototype verification of strchr and strrchr to avoid a crash in the very unlikely case that someone passes an integer > i64 to strchr.
...
llvm-svn: 115144
2010-09-30 11:21:59 +00:00
Benjamin Kramer
2b76c66fd6
Add constant folding for strspn and strcspn to SimplifyLibCalls.
...
llvm-svn: 115116
2010-09-30 00:58:35 +00:00
Benjamin Kramer
38d22f69fc
Add strpbrk folding to SimplifyLibCalls.
...
llvm-svn: 115111
2010-09-29 23:52:12 +00:00
Benjamin Kramer
8e861d7eee
Simplify the loop in StrChrOptimizer. FileCheckize test.
...
llvm-svn: 115095
2010-09-29 22:29:12 +00:00
Benjamin Kramer
824645abc9
Teach SimplifyLibCalls how to optimize strrchr.
...
llvm-svn: 115091
2010-09-29 21:50:51 +00:00