Chris Lattner
db204cbe42
convert ConstantVector::get to use ArrayRef.
...
llvm-svn: 125537
2011-02-15 00:14:00 +00:00
Chris Lattner
ee7f7c2494
revert my ConstantVector patch, it seems to have made the llvm-gcc
...
builders unhappy.
llvm-svn: 125504
2011-02-14 18:15:46 +00:00
Chris Lattner
34f32cb4c2
Switch ConstantVector::get to use ArrayRef instead of a pointer+size
...
idiom. Change various clients to simplify their code.
llvm-svn: 125487
2011-02-14 07:55:32 +00:00
Rafael Espindola
ce499efe1d
Add unnamed_addr when we can show that address of a global is not used.
...
llvm-svn: 123834
2011-01-19 16:32:21 +00:00
Rafael Espindola
1cab858a5c
Reduce indentation and remove commented out code.
...
llvm-svn: 123729
2011-01-18 04:36:06 +00:00
Owen Anderson
6e0fa67f91
Improve the safety of my globalopt enhancement by ensuring that the bitcast
...
of the stored value to the new store type is always. Also, add a testcase.
llvm-svn: 123563
2011-01-16 04:33:33 +00:00
Chris Lattner
e3d0c7819e
simplify this code, it is still broken but will follow up on llvm-commits.
...
llvm-svn: 123558
2011-01-16 02:05:10 +00:00
Benjamin Kramer
91f0608676
Try to unbreak selfhost.
...
llvm-svn: 123537
2011-01-15 11:25:34 +00:00
Owen Anderson
63902f2c99
Fix a false-positive warning.
...
llvm-svn: 123480
2011-01-14 22:31:13 +00:00
Owen Anderson
51dcd56f96
Enhance GlobalOpt to be able evaluate initializers that involve stores through
...
bitcasts, at least in simple cases. This fixes clang's CodeGenCXX/virtual-base-dtor.cpp
llvm-svn: 123477
2011-01-14 22:19:20 +00:00
Chris Lattner
fda382af51
fix a globalopt crash on two Adobe-C++ testcases that the recent
...
loop idiom pass exposed.
llvm-svn: 122674
2011-01-01 22:31:46 +00:00
Chris Lattner
12c2c17ac7
reapply r121100 with a tweak to constant fold ConstExprs with TargetData
...
(if available) as we go so that we get simple constantexprs not insane ones.
This fixes the failure of clang/test/CodeGenCXX/virtual-base-ctor.cpp
that the previous iteration of this patch had.
llvm-svn: 121111
2010-12-07 04:33:29 +00:00
Eric Christopher
cab6997dc8
Temporarily revert r121100 as it's causing clang to fail
...
CodeGenCXX/virtual-base-ctor.cpp.
llvm-svn: 121102
2010-12-07 02:41:11 +00:00
Chris Lattner
5996a47663
fix PR8710 - teach global opt that some constantexprs are too complex to
...
put in a global variable's initializer.
llvm-svn: 121100
2010-12-07 01:59:32 +00:00
Chris Lattner
599e271a46
replace a linear scan with a symtab lookup, reduce indentation.
...
No functionality change.
llvm-svn: 121042
2010-12-06 21:53:07 +00:00
Owen Anderson
46990c17f7
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
Mikhail Glushenkov
0c09a4b97f
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
48553997d2
Trailing whitespace.
...
llvm-svn: 116749
2010-10-18 21:16:00 +00:00
Owen Anderson
69cbf2e8b7
Now with fewer extraneous semicolons!
...
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Owen Anderson
f2fea95f2f
Reapply r110396, with fixes to appease the Linux buildbot gods.
...
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca
Revert r110396 to fix buildbots.
...
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb
Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
...
ID member as the sole unique type identifier. Clean up APIs related to this change.
llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Oscar Fuentes
4742c01c2a
Prefix next' iterator operation with llvm::'.
...
Fixes potential ambiguity problems on VS 2010.
Patch by nobled!
llvm-svn: 110029
2010-08-02 06:00:15 +00:00
Gabor Greif
a7509fca78
undo 80 column trespassing I caused
...
llvm-svn: 109092
2010-07-22 10:37:47 +00:00
Owen Anderson
f8addbb0a1
Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
...
llvm-svn: 109045
2010-07-21 22:09:45 +00:00
Chris Lattner
663dd0eb36
eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
...
so there is no locking involved in type refinement.
llvm-svn: 108553
2010-07-16 20:50:13 +00:00
Gabor Greif
de1c22125f
cache result of operator*
...
llvm-svn: 108144
2010-07-12 14:13:15 +00:00
Chris Lattner
c6f9c11878
make the prototypes for CreateMalloc and CreateFree more consistent. Patch
...
by Hans Vandierendonck from PR7605
llvm-svn: 108116
2010-07-12 00:57:28 +00:00
Gabor Greif
e0e7111f4e
cache result of operator*
...
llvm-svn: 107990
2010-07-09 16:51:20 +00:00
Gabor Greif
520f2c6cb9
use ArgOperand API and CallSite for arg range; add necessary casts and perform some cosmetics
...
llvm-svn: 106747
2010-06-24 14:42:01 +00:00
Gabor Greif
2eaf8afcff
use abstract accessors to CallInst
...
llvm-svn: 101899
2010-04-20 13:13:04 +00:00
Eric Christopher
e78496e5f1
Revert 101465, it broke internal OpenGL testing.
...
Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.
llvm-svn: 101579
2010-04-16 23:37:20 +00:00
Gabor Greif
e7d6812008
reapply r101434
...
with a fix for self-hosting
rotate CallInst operands, i.e. move callee to the back
of the operand array
the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary
llvm-svn: 101465
2010-04-16 15:33:14 +00:00
Gabor Greif
cd116e8c6a
back out r101423 and r101397, they break llvm-gcc self-host on darwin10
...
llvm-svn: 101434
2010-04-16 01:16:20 +00:00
Gabor Greif
2e18d34d80
reapply r101364, which has been backed out in r101368
...
with a fix
rotate CallInst operands, i.e. move callee to the back
of the operand array
the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary
llvm-svn: 101397
2010-04-15 20:51:13 +00:00
Gabor Greif
6022150477
back out r101364, as it trips the linux nightlybot on some clang C++ tests
...
llvm-svn: 101368
2010-04-15 12:46:56 +00:00
Gabor Greif
428ca23bbd
rotate CallInst operands, i.e. move callee to the back
...
of the operand array
the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary
llvm-svn: 101364
2010-04-15 10:49:53 +00:00
Evan Cheng
31483b8c9b
- Code clean up to reduce indentation.
...
- TryToOptimizeStoreOfMallocToGlobal should check if TargetData is available and bail out if it is not. The transformations being done requires TD.
llvm-svn: 101285
2010-04-14 20:52:55 +00:00
Chris Lattner
c5ee900be8
fix PR6760, a missing check in heap SRoA.
...
llvm-svn: 100936
2010-04-10 18:19:22 +00:00
Gabor Greif
f2480270e1
fix 80-col violations
...
llvm-svn: 100677
2010-04-07 18:59:26 +00:00
Gabor Greif
2afbfcfaa4
make more two predicates constant
...
llvm-svn: 100549
2010-04-06 19:24:18 +00:00
Gabor Greif
3969e04cb9
performance: get rid of repeated dereferencing of use_iterator by caching its result
...
llvm-svn: 100547
2010-04-06 19:14:05 +00:00
Gabor Greif
6e9847b04f
const-ize predicate ValueIsOnlyUsedLocallyOrStoredToOneGlobal
...
llvm-svn: 100546
2010-04-06 18:58:22 +00:00
Gabor Greif
a1fcda6242
use CallSite to access calls vs. invokes uniformly
...
and remove assumptions about operand order
llvm-svn: 100544
2010-04-06 18:45:08 +00:00
Dan Gohman
7051600e3f
Revert the recent alignment changes. They're broken for -Os because,
...
in particular, they end up aligning strings at 16-byte boundaries, and
there's no way for GlobalOpt to check OptForSize.
llvm-svn: 100172
2010-04-02 03:04:37 +00:00
Dan Gohman
ece7e3c015
Make globalopt refine global variable alignment.
...
llvm-svn: 100160
2010-04-02 00:14:16 +00:00
Gabor Greif
0ed92c6e98
Introduce ImmutableCallSite, useful for contexts where no mutation
...
is necessary. Inherits from new templated baseclass CallSiteBase<>
which is highly customizable. Base CallSite on it too, in a configuration
that allows full mutation.
Adapt some call sites in analyses to employ ImmutableCallSite.
llvm-svn: 100100
2010-04-01 08:21:08 +00:00
Gabor Greif
abb84bec5c
Add a setCalledFunction member to InvokeInst (like in CallInst)
...
and use this (as well as getCalledValue) to access the callee,
instead of {g|s}etOperand(0).
llvm-svn: 99084
2010-03-20 21:00:25 +00:00
Chris Lattner
8e0bfd5ce0
Fix rdar://7694996 a miscompile of 183.equake from my patch yesterday,
...
confusing the old MAT variable with the new GlobalType one. This caused
us to promote the @disp global pointer into:
@disp.body = internal global double*** undef
instead of:
@disp.body = internal global [3 x double**] undef
llvm-svn: 97285
2010-02-26 23:42:13 +00:00
Chris Lattner
995bac5839
remove dead code, by this point all uses of CI are gone.
...
llvm-svn: 97283
2010-02-26 23:35:25 +00:00