Zhou Sheng
09b12fef98
Commit first round work of PR1373. "noalias" is now fully supported in
...
VMCore, BitCode, and Assembly. Documentation and test case paramattrs.ll
updated also.
llvm-svn: 37432
2007-06-05 05:28:26 +00:00
Devang Patel
3ad9b9f927
Add FIXMEs.
...
llvm-svn: 37417
2007-06-04 17:38:00 +00:00
Devang Patel
2ef6caf14f
s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
...
llvm-svn: 37407
2007-06-04 00:32:22 +00:00
Devang Patel
d58b82f83a
s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
...
llvm-svn: 37403
2007-06-03 06:26:14 +00:00
Dan Gohman
2c5d31ee81
Minor comment cleanups.
...
llvm-svn: 37321
2007-05-24 14:36:04 +00:00
Dan Gohman
a98a5763f9
Add cases for v2f32.
...
llvm-svn: 37319
2007-05-24 14:29:12 +00:00
Devang Patel
bf5c49f62c
Add dump() routines for debugging assistance.
...
llvm-svn: 37314
2007-05-23 19:55:36 +00:00
Devang Patel
c81283a894
If user wants to run instcombine twice, do not block it.
...
llvm-svn: 37301
2007-05-23 05:08:52 +00:00
Reid Spencer
c60a73917d
Reinstate the patch for escaping non-printing characters and allow for
...
\\ to escape \. All these cases are now handled by the AsmParser.
llvm-svn: 37295
2007-05-22 19:27:35 +00:00
Chris Lattner
1509e17e6c
temporarily revert reid's asmwriter patch, it is missing the asmparser piece
...
that decodes the escape sequences, thus breaking all cases that use them.
This fixes test/Assembler/2007-05-21-Escape.ll
llvm-svn: 37284
2007-05-22 07:00:50 +00:00
Reid Spencer
dbc381aedd
Get the order of the hext digits right!
...
llvm-svn: 37261
2007-05-19 14:44:42 +00:00
Reid Spencer
7170d7ab1b
Adjust how LLVM names are produced:
...
1. Always use % for local and @ for global.
2. Replace NameNeedsQuotes with QuoteNameIfNeeded so that any adjustments
to the name can be done in one pass.
3. Implement generation of hex escapes so we don't get "wonky" characters
in the output.
llvm-svn: 37260
2007-05-19 07:25:21 +00:00
Dan Gohman
03114bee5f
Update comments to say "vector" instead of "packed".
...
llvm-svn: 36995
2007-05-11 21:43:24 +00:00
Chris Lattner
8070a25149
handle gep aliasee
...
llvm-svn: 36815
2007-05-05 23:49:02 +00:00
Chris Lattner
da3b0264f7
if functiontype is going to have a pointer to a paramattr object, it better
...
be const. The only way to get a pointer to these returns a const pointer.
llvm-svn: 36734
2007-05-04 03:39:28 +00:00
Jeff Cohen
d59084b6f6
Unbreak VC++ build.
...
llvm-svn: 36700
2007-05-03 22:09:21 +00:00
Devang Patel
e0b9bd0e49
Use iterative while loop instead of recursive function call.
...
llvm-svn: 36694
2007-05-03 20:55:18 +00:00
Devang Patel
cd45427a87
Drop 'const'
...
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel
8ee9065162
Use 'static const char' instead of 'static const int'.
...
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.
llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
32786f1037
Re-install patch to enable use of PassID.
...
I am preparing another patch to address the failure that prompted
Chris to revert this patch earlier.
llvm-svn: 36649
2007-05-02 20:38:25 +00:00
Chris Lattner
055c13234b
revert enough of devang's recent patches to get the tree basically working again
...
llvm-svn: 36638
2007-05-02 04:25:31 +00:00
Chris Lattner
6a176b8f47
disable this assertion as a hack to get the build more unbroken :(
...
llvm-svn: 36637
2007-05-02 04:01:44 +00:00
Devang Patel
38a66bc82e
Do not use typeinfo to identify pass in pass manager.
...
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Anton Korobeynikov
202b9dff0e
Fix typo. Interesting, but old variant worked too :)
...
llvm-svn: 36588
2007-04-30 10:28:40 +00:00
Anton Korobeynikov
3d95e52ea2
Implement protected visibility. This partly implements PR1363. Linker
...
should be taught to deal with protected symbols.
llvm-svn: 36565
2007-04-29 18:35:00 +00:00
Anton Korobeynikov
cb2004f82c
Implement review feedback
...
llvm-svn: 36564
2007-04-29 18:02:48 +00:00
Anton Korobeynikov
2070ca3361
Let Verifier check aliasees
...
llvm-svn: 36540
2007-04-28 14:35:41 +00:00
Anton Korobeynikov
45162c6dad
Implement review feedback. Aliasees can be either GlobalValue's or
...
bitcasts of them.
llvm-svn: 36537
2007-04-28 13:45:00 +00:00
Chris Lattner
ab3ae8dd2f
add a way to make this less brittle
...
llvm-svn: 36528
2007-04-28 05:38:52 +00:00
Chris Lattner
0b40f6db6c
represent indirect operands explicitly in inline asm strings.
...
llvm-svn: 36522
2007-04-28 01:02:58 +00:00
Chris Lattner
9bfe8f4517
add a GEP helper function
...
llvm-svn: 36515
2007-04-27 20:35:56 +00:00
Devang Patel
e7e2cb2826
Move ~Pass() from Pass.h into Pass.cpp
...
llvm-svn: 36498
2007-04-26 21:33:42 +00:00
Devang Patel
8d4025a924
Use toplevel function pass manager as OnTheFly manager.
...
llvm-svn: 36481
2007-04-26 17:50:19 +00:00
Chris Lattner
bb09b15fe3
print aliases before functions
...
llvm-svn: 36459
2007-04-26 02:24:10 +00:00
Anton Korobeynikov
25dc9a61cb
Implement aliases. This fixes PR1017 and it's dependent bugs. CFE part
...
will follow.
llvm-svn: 36435
2007-04-25 14:27:10 +00:00
Chris Lattner
cb6020a638
simplify some code
...
llvm-svn: 36427
2007-04-25 05:49:09 +00:00
Jeff Cohen
726786aa76
Have compiler enforce this.
...
llvm-svn: 36353
2007-04-22 22:16:55 +00:00
Christopher Lamb
5606cd66e2
PR400 work phase 1. Add attributed load/store instructions for volatile/align to LLVM.
...
llvm-svn: 36349
2007-04-22 19:24:39 +00:00
Reid Spencer
4169952dab
For PR1136:
...
Add reference counting to ParamAttrsList and make use of it in Function,
CallInst and InvokeInst classes.
llvm-svn: 36346
2007-04-22 17:28:03 +00:00
Reid Spencer
4721577334
For PR1146:
...
Make ParamAttrsList objects unique. You can no longer directly create or
destroy them but instead must go through the ParamAttrsList::get()
interface.
llvm-svn: 36327
2007-04-22 05:46:44 +00:00
Reid Spencer
81070d52da
Revert Christopher Lamb's load/store alignment changes.
...
llvm-svn: 36309
2007-04-21 18:36:27 +00:00
Christopher Lamb
b56b6a7ad7
add support for alignment attributes on load/store instructions
...
llvm-svn: 36301
2007-04-21 08:16:25 +00:00
Devang Patel
3e8b6494fb
Reset vertex.
...
Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/048092.html
llvm-svn: 36294
2007-04-21 00:36:45 +00:00
Chris Lattner
a1e3b9487f
Fix a bug that prevented the JIT from working correctly after llvm_shutdown.
...
Pass info objects are initialized by static ctors, so deleting them at
llvm_shutdown time prevents resurrection from working.
llvm-svn: 36292
2007-04-21 00:12:18 +00:00
Chris Lattner
1907945816
Fix regressions introduced by my previous patch: opt calls verifier in a
...
way that the "Mod" ivar was not getting set.
llvm-svn: 36291
2007-04-20 23:59:29 +00:00
Chris Lattner
4928ec0460
Fix a problem where primitive types lose their name after llvm_shutdown is called.
...
This also reduces the amount of work done at static construction time.
llvm-svn: 36285
2007-04-20 22:33:47 +00:00
Chris Lattner
aff65c98a2
catch a case that was biting jeffc
...
llvm-svn: 36284
2007-04-20 21:48:08 +00:00
Chris Lattner
0ee78670b8
don't access argument list of prototypes
...
llvm-svn: 36238
2007-04-18 00:57:22 +00:00
Chris Lattner
09139c7951
eliminate a use of Instruction::getPrev(), patch by Gabor Greif in 2005.
...
llvm-svn: 36197
2007-04-17 17:36:12 +00:00
Chris Lattner
db7de8e497
merge several fields in GlobalValue to use the same word, move CallingConv
...
field into SubclassData in Value. This shrinks GlobalVAlue from 48->40
bytes, Function from 88->76, and GlobalVariable from 76->68. This trims
4640 bytes off my testcase, reading a bc file without materializing any
functions.
llvm-svn: 36192
2007-04-17 04:31:29 +00:00
Chris Lattner
cc56e116fe
The (negative) offset from a SymbolTableListTraits-using ilist to its container
...
object is always constant. As such, evaluate it at compile time instead of storing
it as an ivar in SymbolTableListTraits. This shrinks every SymbolTableListTraits
ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes,
and Module from 60->52 bytes.
llvm-svn: 36189
2007-04-17 04:04:14 +00:00
Chris Lattner
71a21677f4
Refactor SymbolTableListTraits to only have a single pointer in it, instead
...
of two. This shrinkifies Function by 8 bytes (104->96) and Module by 8
bytes (68->60). On a testcase of mine, this reduces the memory used to
read a module header from 565680b to 561024, a little over 4K.
llvm-svn: 36188
2007-04-17 03:26:42 +00:00
Devang Patel
af0b4b4191
Proivde getAnalysis<FPAnalysis>(Func) support.
...
llvm-svn: 36159
2007-04-16 20:56:24 +00:00
Devang Patel
4bf452b5e4
Do not assert during analysis implementation initialization.
...
llvm-svn: 36158
2007-04-16 20:44:16 +00:00
Devang Patel
814d1deba8
Print and delete on the fly pass managers.
...
llvm-svn: 36157
2007-04-16 20:39:59 +00:00
Devang Patel
3b4e226a87
Update module pass manager to support module passes that require
...
function passes.
llvm-svn: 36154
2007-04-16 20:27:05 +00:00
Devang Patel
c1010840fa
Give each pass manager chance to manage lower level analysis pass, which is
...
pass required by one of pass managed by the manager.
llvm-svn: 36153
2007-04-16 20:12:57 +00:00
Anton Korobeynikov
f3e62a428a
Removed tabs everywhere except autogenerated & external files. Add make
...
target for tabs checking.
llvm-svn: 36146
2007-04-16 18:10:23 +00:00
Reid Spencer
16f6e75cf5
Don't return 0 if the len == 5, let the assert handle that case.
...
Thanks, Chris.
llvm-svn: 36139
2007-04-16 16:56:54 +00:00
Reid Spencer
4b8e900991
Fix test/CodeGen/Generic/vector-constantexpr.ll
...
llvm-svn: 36123
2007-04-16 07:08:44 +00:00
Reid Spencer
f12ab5a55b
For PR1328:
...
Don't assert everytime an intrinsic name isn't recognized. Instead, make
the assert optional when callin getIntrinsicID(). This allows the assembler
to handle invalid intrinsic names gracefully.
llvm-svn: 36120
2007-04-16 06:54:34 +00:00
Owen Anderson
b371956400
Tabs -> Spaces
...
llvm-svn: 36094
2007-04-15 23:14:18 +00:00
Owen Anderson
ea857029ea
Remove ImmediateDominator analysis. The same information can be obtained from DomTree. A lot of code for
...
constructing ImmediateDominator is now folded into DomTree construction.
This is part of the ongoing work for PR217.
llvm-svn: 36063
2007-04-15 08:47:27 +00:00
Owen Anderson
1d837200f2
Fix some unsafe code. Also, tabs -> spaces.
...
llvm-svn: 36035
2007-04-14 23:57:00 +00:00
Owen Anderson
41582c8198
Make ETForest depend on DomTree rather than IDom. This is the first step
...
in the long process that will be fixing PR 217.
llvm-svn: 36034
2007-04-14 23:49:24 +00:00
Chris Lattner
5ed58fc4a9
add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method.
...
Writing it twice in the same day was too much for me.
llvm-svn: 35978
2007-04-14 00:12:57 +00:00
Lauro Ramos Venancio
a76c2806de
Implement the "thread_local" keyword.
...
llvm-svn: 35950
2007-04-12 18:32:50 +00:00
Reid Spencer
82da0eb67c
For PR1284:
...
Implement the "part_set" intrinsic.
llvm-svn: 35938
2007-04-12 02:48:46 +00:00
Reid Spencer
bd2afc8391
Fix a bug where ICmpInst objects instantiated directly with a name would
...
not retain that name. Not noticed because AsmParser always sets name after
construction. However, llvm2cpp noticed.
llvm-svn: 35903
2007-04-11 13:04:48 +00:00
Reid Spencer
2792e203c5
For PR1146:
...
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.
llvm-svn: 35877
2007-04-11 02:44:20 +00:00
Chris Lattner
8557e71577
unbreak the build :(
...
llvm-svn: 35857
2007-04-10 03:18:19 +00:00
Jeff Cohen
9bc2960be6
Fix build problem.
...
llvm-svn: 35856
2007-04-10 03:10:46 +00:00
Reid Spencer
93a57ef458
For PR1146:
...
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory
leaks. This will change when ParamAttrsList is uniquified but needs to
be correct until then.
llvm-svn: 35824
2007-04-09 18:00:57 +00:00
Reid Spencer
1acc089771
Remove a memory leak, until ParamAttrsList is uniqued.
...
llvm-svn: 35823
2007-04-09 17:20:18 +00:00
Reid Spencer
d2380cfb76
For PR1146:
...
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp
llvm-svn: 35818
2007-04-09 15:01:12 +00:00
Chris Lattner
730f5588be
Convert ImmediateDominators::DFSPass from being recursive to being iterative.
...
llvm-svn: 35815
2007-04-09 06:44:42 +00:00
Reid Spencer
1f674acbdf
For PR1146:
...
Simplify construction of FunctionType to use default arguments.
llvm-svn: 35810
2007-04-09 06:12:07 +00:00
Reid Spencer
a2b16b4ee5
For PR1146:
...
Parameter attributes can now be defaulted for intrinsics.
llvm-svn: 35809
2007-04-09 06:11:23 +00:00
Reid Spencer
3d414b473d
For PR1146:
...
Adjust writing of parameter attributes to use ParamAttrList class.
llvm-svn: 35808
2007-04-09 06:10:42 +00:00
Chris Lattner
884f49c47e
minor cleanups
...
llvm-svn: 35807
2007-04-09 06:10:06 +00:00
Reid Spencer
6bc0205a2a
For PR1146:
...
Move parameter attributes functionality to ParamAttrsList class.
llvm-svn: 35806
2007-04-09 06:07:52 +00:00
Owen Anderson
e4c29f0b01
Move isReachableFromEntry out of line to avoid an unnecessary #include
...
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Owen Anderson
4b323657b9
Remove DomSet completely. This concludes work on PR1171.
...
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Nick Lewycky
26652f5681
Don't crash when encountering a BasicBlock that hasn't been registered yet.
...
llvm-svn: 35756
2007-04-08 01:02:12 +00:00
Owen Anderson
7cf9d12f2e
Add DomSet back, and revert the changes to LoopSimplify. Apparently the
...
ETForest updating mechanisms don't work as I thought they did. These changes
will be reapplied once the issue is worked out.
llvm-svn: 35741
2007-04-07 18:23:27 +00:00
Owen Anderson
85b0e20f2a
Completely purge DomSet. This is the (hopefully) final patch for PR1171.
...
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Reid Spencer
5d36a01dba
For PR1209:
...
Implement Type class's ContainedTys without using a std::vector.
llvm-svn: 35693
2007-04-06 02:02:20 +00:00
Reid Spencer
6eb55df794
Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
...
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Reid Spencer
d371e2e492
For PR1297:
...
Implement "actual" argument types for the Intrinsic member functions. This
involves changing the getName, getType, and getDeclaration methods to have
optional parameters for the actual types. These are necessary in order for
the type/name to be constructed properly for overloaded intrinsics. Only
the caller knows the actual argument types desired.
llvm-svn: 35541
2007-04-01 07:25:33 +00:00
Reid Spencer
1db694fe4b
For PR1297:
...
1. Clear up confusion between "GotBits" and "ExpectBits". GotBits is the
type actually provided. ExpectedBits is the type expected for the
intrinsics. Before this patch, it was reversed!
2. Implement checks for overloaded intrinsics. This involves computing the
suffix expected and making sure the suffix matches the function name. It
also includes some intrinsic-specific checks such as ensuring that the
bswap parameter and result are the same width and an even number of bytes.
llvm-svn: 35540
2007-04-01 07:22:57 +00:00
Chris Lattner
546138e3dd
add a method to turn a type into a VT.
...
llvm-svn: 35526
2007-03-31 04:03:02 +00:00
Devang Patel
7cde72cbc1
It is not possible to determine dominance between two PHI nodes
...
based on their ordering. This is applicable to ETForest::dominates() also.
llvm-svn: 35423
2007-03-28 14:57:43 +00:00
Reid Spencer
bd89a6ea1c
No need to generate the implementation keyword any more. Its frivolous.
...
llvm-svn: 35405
2007-03-28 01:53:20 +00:00
Devang Patel
67eede36f7
Use SmallPtrSet.
...
llvm-svn: 35388
2007-03-27 20:50:46 +00:00
Devang Patel
8330ee3120
Spell check.
...
llvm-svn: 35374
2007-03-27 00:16:08 +00:00
Devang Patel
58a8e74de6
It is not possible to determie dominance between two PHI nodes
...
based on their ordering.
llvm-svn: 35369
2007-03-26 23:18:28 +00:00
Devang Patel
3062ae001d
Use std::vector<DFCalculateWorkObject> instead of
...
std::vector<DFCalculateWorkObject *> to reduce malloc/free traffic.
llvm-svn: 35368
2007-03-26 23:17:19 +00:00
Reid Spencer
4af99334ea
Add a comment to explain a folding transform.
...
llvm-svn: 35360
2007-03-26 20:09:02 +00:00
Chris Lattner
f4ff1dc689
fold constantexprs more aggressively, fixing PR1265
...
llvm-svn: 35336
2007-03-25 05:47:04 +00:00
Chris Lattner
3a16450eaf
add a valuetype for v1i64, which is needed by mmx.
...
llvm-svn: 35298
2007-03-24 17:36:26 +00:00
Reid Spencer
7a9c981d80
Fix constant fold of div by zero and rem by zero to match IEEE 754
...
requirements. We must return NaN in some cases and correctly signed
infinity in other cases. Passes CFP2006 (not that that says much).
llvm-svn: 35277
2007-03-23 05:33:23 +00:00
Dan Gohman
d0a0ea9916
Change uses of Function::front to Function::getEntryBlock for readability.
...
llvm-svn: 35265
2007-03-22 16:38:57 +00:00
Reid Spencer
a2d8b5e7a1
Add the NoUnwind function attribute.
...
llvm-svn: 35260
2007-03-22 02:14:48 +00:00
Devang Patel
3a426e1c86
DominanceFrontier::calculate().
...
Avoid recursion, Use iterative algorithm.
llvm-svn: 35225
2007-03-20 21:25:31 +00:00
Devang Patel
18146cf2a2
LoopSimplify::FindPHIToPartitionLoops()
...
Use ETForest instead of DominatorSet.
llvm-svn: 35221
2007-03-20 20:18:12 +00:00
Chris Lattner
6dbed4d4ca
Fix a nasty memory leak, caused by my revamp of the value symbol table.
...
llvm-svn: 35195
2007-03-20 00:18:10 +00:00
Reid Spencer
7d20e42a97
Allow ConstantInt::get(Ty, uint64_t) to interpret the 64-bit values as a
...
negative number. This is needed to fix test/Assembler/2007-03-19-NegValue.ll
llvm-svn: 35181
2007-03-19 20:39:08 +00:00
Reid Spencer
135ca5e8c4
For PR1258:
...
Radically simplify the SlotMachine. There is no need to keep Value planes
around any more. This change causes slot numbering to number all un-named,
non-void values starting at 0 and incrementing monotonically through the
function, regardless of type (including BasicBlocks). Getting slot numbers
is now a single lookup operation instead of a double lookup.
llvm-svn: 35171
2007-03-19 18:32:53 +00:00
Devang Patel
94228897e7
Speed Up Pass Manager.
...
- Check Immutableness before searching PreservedSet.
- Avoid unnecessary traversal while setting Last User.
llvm-svn: 35028
2007-03-08 19:05:01 +00:00
Evan Cheng
7513c95267
Added ContainsRelocations() to check if a constant might only be resolvable at load time.
...
llvm-svn: 35014
2007-03-08 00:59:12 +00:00
Devang Patel
b9e705f09e
Keep track of higher level analysis.
...
llvm-svn: 34974
2007-03-06 17:52:53 +00:00
Devang Patel
45343b04b3
Keep track of inherited analysis. For example, if a loop pass does not
...
preserve dominator info then it should update parent FPPassManager's
available analysis info to reflect this.
llvm-svn: 34942
2007-03-06 01:55:46 +00:00
Devang Patel
edbde240be
Add preparePassManager() hook. This allows each pass to check whether
...
current active pass manager is appropriate or not.
A loop pass may consider current LPPassManager in appropraite if loop
pass is not preserving analysis information that is used by other
passes managed by current LPPassManager. In such situation, loop pass
can pop current LPPassManager from the PMStack using this hook
and use new LPPassManager for itself.
llvm-svn: 34941
2007-03-06 01:06:16 +00:00
Devang Patel
79495d839e
Current pass manager, not the parent pass manager, assumes the role of
...
last user when one of the managed pass uses info provided by parent pass
manager.
This was exposed by LPPassManager work.
llvm-svn: 34936
2007-03-05 22:57:49 +00:00
Devang Patel
6668a341ae
Avoid constructing std::strings unless pass debugging is ON.
...
llvm-svn: 34933
2007-03-05 20:01:30 +00:00
Devang Patel
ca90313b39
Account for time consumed by releaseMemory() properly.
...
llvm-svn: 34932
2007-03-05 18:20:51 +00:00
Jeff Cohen
98c99a3a02
Unbreak VC++ build.
...
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Reid Spencer
6037b564a0
Fix constant folding of fp->int bitcast for vectors.
...
llvm-svn: 34880
2007-03-03 08:32:46 +00:00
Reid Spencer
1f970769e8
Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
...
Constant::isNullValue() in situations where it is possible.
llvm-svn: 34821
2007-03-02 00:28:52 +00:00
Reid Spencer
5790924b21
Use the APInt versions of the bit-wise conversions of float/double to int
...
and back. While this is not strictly necessary, it does pave the way for
future changes in casting. It should now be possible to improve vector
casting to deal with un-equal fp/int sizes.
llvm-svn: 34808
2007-03-01 20:44:23 +00:00
Reid Spencer
5d9574f37e
Use modern variable name. ConstantUnsignedInt is long since dead. No
...
functional change with this patch.
llvm-svn: 34806
2007-03-01 20:27:41 +00:00
Reid Spencer
b0a7bfa105
Use a simpler constructor when constructing ConstantInst.
...
llvm-svn: 34793
2007-03-01 19:31:12 +00:00
Reid Spencer
b4e877c488
Drop the ConstantInt(const Type&, const APInt&) constructor. It is
...
redundant and more verbose than the ConstantInt(const APInt&) constructor.
llvm-svn: 34792
2007-03-01 19:30:34 +00:00
Reid Spencer
32d0051c64
Reduce #includage by taking a method out of line.
...
llvm-svn: 34774
2007-03-01 04:02:06 +00:00
Reid Spencer
f632e1cd14
Provide an ICmpInst::makeConstantRange to generate a ConstantRange value
...
from a predicate and an APInt. This is removed from ConstantRange class
so that ConstantRange doesn't have to depend on lib/VMCore.
llvm-svn: 34760
2007-02-28 22:00:54 +00:00
Reid Spencer
a9d0cc903b
Implement a convenience method to construct a ConstantInt directly from an
...
APInt. The implied type is the integer type that corresponds to the bit
width of the APInt.
llvm-svn: 34757
2007-02-28 19:50:21 +00:00
Reid Spencer
24430077d5
Pull out the stops.
...
llvm-svn: 34703
2007-02-27 23:33:03 +00:00
Reid Spencer
58f7a497bb
Remove some redundancy.
...
llvm-svn: 34702
2007-02-27 23:27:26 +00:00
Reid Spencer
8178fd7bd5
Adjust to changes in the APInt interface.
...
llvm-svn: 34681
2007-02-27 20:25:25 +00:00
Reid Spencer
a3b5b71616
For PR1205:
...
Implement review feedback:
1. Use new APInt::RoundDoubleToAPInt interface to specify the bit width so
that we don't have to truncate or extend in constant folding.
2. Fix a pasteo in SDiv that prevented a check for overflow.
3. Fix the shift operators: undef happens when the shift amount is equal
to the bitwidth.
llvm-svn: 34677
2007-02-27 19:29:54 +00:00
Devang Patel
89791371ce
Make getPassManagerType() const.
...
llvm-svn: 34669
2007-02-27 15:00:39 +00:00
Reid Spencer
b05cb31bdf
Allow the AsmWriter to print out arbitrary precision integers.
...
llvm-svn: 34664
2007-02-27 08:34:09 +00:00
Reid Spencer
74764708fa
Correct the implelmentation of ConstantInt::getAllOnesValue() for bit
...
widths > 64 bits.
llvm-svn: 34663
2007-02-27 07:57:53 +00:00
Reid Spencer
de3bbe0489
For PR1205:
...
Implement constant folding via APInt instead of uint64_t.
llvm-svn: 34660
2007-02-27 06:23:51 +00:00
Chris Lattner
ae7cc3e0e0
ConstantFolding.cpp/h -> ConstantFold.cpp/h to avoid confusion with
...
lib/Analysis/ConstantFolding.
llvm-svn: 34653
2007-02-27 03:05:06 +00:00
Reid Spencer
c8cc0f997e
For PR1205:
...
Implement the first step towards arbitrary precision integer support in
LLVM. The APInt class provides arbitrary precision arithmetic and value
representation. This patch changes ConstantInt to use APInt as its value
representation without supporting bit widths > 64 yet. That change will
come after ConstantFolding handles bit widths > 64 bits.
llvm-svn: 34647
2007-02-26 23:54:03 +00:00
Chris Lattner
cdbef93603
reapply my previous patch with a bugfix.
...
llvm-svn: 34627
2007-02-26 05:02:39 +00:00
Chris Lattner
96aac36de5
revert my previous change, something strange is happening.
...
llvm-svn: 34626
2007-02-26 04:43:19 +00:00
Chris Lattner
50be7cd320
Rework GlobalValue::removeDeadConstantUsers to always remove dead constant
...
exprs hanging off a global, even if the global is not otherwise dead. This
requires some tricky iterator gymnastics.
This implements Transforms/GlobalOpt/constantexpr-dangle.ll by deleting a
constantexpr that made it appear that the address of the function was taken.
llvm-svn: 34608
2007-02-25 21:06:13 +00:00
Chris Lattner
2fbfbcd9cd
disable some noisy debug output
...
llvm-svn: 34606
2007-02-25 20:42:59 +00:00
Chris Lattner
5480ffb904
Fix Transforms/ConstProp/2007-02-23-sdiv.ll and PR1215
...
llvm-svn: 34548
2007-02-24 01:19:50 +00:00
Chris Lattner
0eb72353e4
Refactor the setName stuff, moving it down the inheritance hierarchy, to
...
solve a crash in -instcombine -debug that was hit while investigating PR1217
llvm-svn: 34544
2007-02-24 00:55:48 +00:00
Evan Cheng
0af52bec6b
This cast broke lots of tests.
...
llvm-svn: 34457
2007-02-20 21:30:56 +00:00
Chris Lattner
be8f4becf4
switch ConstantFP's from ValueMap to DenseMap, which is much faster to query
...
and is more memory efficient.
llvm-svn: 34446
2007-02-20 07:17:17 +00:00
Chris Lattner
37a49eb48d
cleanup ConstantInt to use a single DenseMap for uniquing instead of the
...
heavy-weight ValueMap class. This reduces mem usage bc reading kc++ by 29K,
even though it only creates 2955 constant ints!
llvm-svn: 34445
2007-02-20 06:39:57 +00:00
Chris Lattner
adb16a1a53
Make ConstantInt::getTrue/getFalse be llvm_shutdown safe.
...
llvm-svn: 34443
2007-02-20 06:11:36 +00:00
Chris Lattner
c8db23f8a7
Clean up the internals of the ConstantInt machinery
...
llvm-svn: 34441
2007-02-20 05:55:46 +00:00
Chris Lattner
26dc9c9dc8
simplify some code that was not llvm_shutdown safe
...
llvm-svn: 34440
2007-02-20 05:46:39 +00:00
Chris Lattner
502e4b271a
remove dead method
...
llvm-svn: 34436
2007-02-20 05:29:47 +00:00
Chris Lattner
f501d245c8
llvm-gcc issue fixed, revert reversal :)
...
llvm-svn: 34425
2007-02-19 20:01:23 +00:00
Chris Lattner
8f9dc788c1
remove warning
...
llvm-svn: 34424
2007-02-19 19:46:17 +00:00
Evan Cheng
936deee790
Temporarily reverting the patch. It's breaking llvm-gcc build.
...
llvm-svn: 34423
2007-02-19 19:23:41 +00:00
Reid Spencer
9ada0ff0ed
Add a FIXME for unwritten code.
...
llvm-svn: 34422
2007-02-19 19:00:29 +00:00
Chris Lattner
865b2f741a
remove dead methods
...
llvm-svn: 34419
2007-02-19 07:44:24 +00:00
Chris Lattner
dee1492159
temporarily revert Devang's most recent patch, which caused a large
...
compile-time regression in LLC.
llvm-svn: 34385
2007-02-17 23:14:24 +00:00
Devang Patel
953cadacbc
Use inverted map to speedup collectLastUses().
...
llvm-svn: 34364
2007-02-17 03:53:44 +00:00
Andrew Lenharth
d2c65176e6
fix build
...
llvm-svn: 34339
2007-02-16 02:25:55 +00:00
Chris Lattner
134ae17654
make mayWriteToMemory a non-virtual function
...
llvm-svn: 34334
2007-02-15 23:15:00 +00:00
Chris Lattner
9084bb5471
rewrite Value::takeName to take advantage of the new symtab stuff. This
...
causes it to require no allocations and no symtab lookups in the common
case. This speeds up instcombine 9.2% on 447.dealII.
llvm-svn: 34324
2007-02-15 20:01:43 +00:00
Chris Lattner
5d0b16f797
Implement Function::getIntrinsicID without it needing to call Value::getName,
...
which allocates a string. This speeds up instcombine on 447.dealII by 5%.
llvm-svn: 34318
2007-02-15 19:17:16 +00:00
Chris Lattner
fbd6928545
Add a new Value::getNameStr method, which is preferred over getName.
...
llvm-svn: 34310
2007-02-15 18:53:54 +00:00
Reid Spencer
e7ff3305d6
For PR1195:
...
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.
llvm-svn: 34300
2007-02-15 03:39:18 +00:00
Reid Spencer
a0a2689760
For PR1195:
...
Change a comment: Packed Type -> Vector Type
llvm-svn: 34299
2007-02-15 03:11:50 +00:00
Reid Spencer
55e4e98a2a
For PR1195:
...
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.
llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Chris Lattner
48b7ed420c
better support for i128.
...
llvm-svn: 34258
2007-02-13 23:57:55 +00:00
Chris Lattner
4534d3fc6e
Switch UnaryOperators to default to passing names up by const char* when possible.
...
This speeds up bcreading by 1.5%.
llvm-svn: 34233
2007-02-13 07:54:42 +00:00
Chris Lattner
cc543b031e
add a setName variant that takes a null-terminated string. This can be
...
used to avoid std::string allocations in common cases.
llvm-svn: 34232
2007-02-13 07:53:34 +00:00
Chris Lattner
326271ee46
eliminate instruction ctors that take vectors.
...
llvm-svn: 34228
2007-02-13 06:22:32 +00:00
Chris Lattner
bc384d8d50
Add invokeinst and callinst ctors that don't take vectors.
...
llvm-svn: 34214
2007-02-13 01:04:01 +00:00
Chris Lattner
94ce3e4550
remove some dead methods.
...
llvm-svn: 34213
2007-02-13 00:58:44 +00:00
Chris Lattner
a48bf1bdbf
Add new setName accessor which doesn't require creating a string.
...
llvm-svn: 34197
2007-02-12 18:52:59 +00:00
Chris Lattner
5a58a65c10
Switch ValueSymbolTable to use StringMap<Value*> instead of std::map<std::string, Value*>
...
as its main datastructure. There are many improvements yet to be made, but
this speeds up opt --std-compile-opts on 447.dealII by 7.3%.
llvm-svn: 34193
2007-02-12 05:18:08 +00:00
Chris Lattner
676ffe699d
fix uninitialized variable
...
llvm-svn: 34182
2007-02-11 19:12:18 +00:00
Chris Lattner
50ea7bc913
add an optimization for the case where the src has no name
...
llvm-svn: 34174
2007-02-11 01:04:09 +00:00
Chris Lattner
e8dd3c90f1
add a helper method: Value::takeName
...
llvm-svn: 34171
2007-02-11 00:37:27 +00:00
Reid Spencer
8594672a45
Assert that elements of packed are pointer/float/opaque.
...
llvm-svn: 34165
2007-02-10 22:02:45 +00:00
Reid Spencer
b8c5bbce4b
Allow PackedType to be constructed with an abstract type.
...
llvm-svn: 34152
2007-02-10 19:03:01 +00:00
Chris Lattner
a7ed569db1
convert some vectors to smallvector.
...
llvm-svn: 34145
2007-02-10 08:33:11 +00:00
Chris Lattner
8eb2002881
speed up the verifier 8.5% by using a smallvector instead of vector.
...
llvm-svn: 34144
2007-02-10 08:30:29 +00:00
Chris Lattner
a0792c722e
Change an std::set to a SmallPtrSet. This speeds up the verifier on
...
447.dealII from 1.27s to 0.86s.
llvm-svn: 34143
2007-02-10 08:19:44 +00:00
Chris Lattner
27cff151e2
Fix clients like this:
...
delete ParseBytecodeFile(InputFilename, 0, &ErrorMessage);
llvm_shutdown();
delete ParseBytecodeFile(InputFilename, 0, &ErrorMessage);
The primitive type objects failed to ressurect themselves after shutdown, leading
to crashes in clients that used them after llvm_shutdown().
This solution isn't wonderful, because we clearly have static ctors. However,
the code it replaces was just as bad, so it's not a regression.
llvm-svn: 34106
2007-02-09 22:24:04 +00:00
Jim Laskey
c27aed3dc0
Automatically generating intrinsic declarations from Dan Gohman. Modified
...
to construct FunctionType in separate function, and, have getDeclaration
return a Function instead of a Constant.
llvm-svn: 34008
2007-02-07 20:38:26 +00:00
Devang Patel
a667307d74
Do not drop transferred last uses on the floor.
...
Use handleLastUserOverflow().
llvm-svn: 34006
2007-02-07 19:37:53 +00:00
Chris Lattner
940f9c8549
constants can't be in the symtab anymore
...
llvm-svn: 33993
2007-02-07 06:28:48 +00:00
Chris Lattner
3cbaee07ce
update comment.
...
llvm-svn: 33992
2007-02-07 06:25:36 +00:00
Chris Lattner
22fc4be632
shrink vmcore by moving symbol table stripping support out of VMCore into
...
the one IPO pass that uses it.
llvm-svn: 33990
2007-02-07 06:22:45 +00:00
Chris Lattner
a1455127ae
eliminate ValueSymbolTable::rename, it has no advantage over using remove+insert.
...
Make insert/remove assert if used incorrectly instead of returning a bool.
llvm-svn: 33988
2007-02-07 06:13:49 +00:00
Chris Lattner
c46811575d
speed up conflict handling.
...
llvm-svn: 33985
2007-02-07 05:52:51 +00:00
Chris Lattner
bdde131dac
Eliminate the O(n) version of TypeSymbolTable::remove, it is dead. When
...
inserting a type into the type symbol table, only compute unique name if not
in symtab already.
llvm-svn: 33983
2007-02-07 05:35:58 +00:00
Chris Lattner
bf91625f67
TypeSymbolTable::rename is dead, remove it
...
llvm-svn: 33982
2007-02-07 05:29:34 +00:00
Chris Lattner
d69c837c73
Eliminate a bunch of work from ValueSymbolTable::insert for the common case
...
where a symbol name doesn't conflict. This speeds up bc reading 16% on 176.gcc!
llvm-svn: 33981
2007-02-07 05:22:49 +00:00
Jim Laskey
7d5ddeb668
Support var arg intrinsics.
...
llvm-svn: 33962
2007-02-06 18:02:54 +00:00
Chris Lattner
83e39edf72
Fix Transforms/ConstProp/2007-02-05-BitCast.ll
...
llvm-svn: 33948
2007-02-06 02:22:56 +00:00
Reid Spencer
6da19310e3
A value of 64 or fewer bits is valid if the ConstantInt has more then 64 bits.
...
llvm-svn: 33942
2007-02-05 23:47:56 +00:00
Reid Spencer
83803ddedb
For PR411:
...
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)
llvm-svn: 33922
2007-02-05 21:19:13 +00:00
Reid Spencer
6af21b3029
For PR411:
...
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.
llvm-svn: 33918
2007-02-05 20:47:22 +00:00
Devang Patel
a2287f3205
Fix PR1158
...
Do not insert Analysis pass, if it is already available.
llvm-svn: 33915
2007-02-05 19:34:17 +00:00
Reid Spencer
310b497b59
For PR1163:
...
Make the Module's dependent library use a std::vector instead of SetVector
adjust #includes in .cpp files because SetVector.h is no longer included.
llvm-svn: 33855
2007-02-04 00:40:42 +00:00
Reid Spencer
da848a64ce
Fix a comment that needed to change after SHIFT patch landed.
...
llvm-svn: 33781
2007-02-02 13:54:55 +00:00
Reid Spencer
591bfa1e0b
Changes to support making the shift instructions be true BinaryOperators.
...
This feature is needed in order to support shifts of more than 255 bits
on large integer types. This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
shl i32 %X, 1
instead of
shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.
llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Devang Patel
f178d112ce
cvs commit
...
llvm-svn: 33765
2007-02-01 22:08:25 +00:00
Chris Lattner
ca583c51b3
silence some warnings when assertions are disabled.
...
llvm-svn: 33747
2007-02-01 04:59:37 +00:00
Reid Spencer
a22881da40
Fix build breakage by using correct arguments to getIndexedType in the
...
GEP constructors.
llvm-svn: 33726
2007-01-31 22:30:26 +00:00
Chris Lattner
55e5440018
implement the new GEP instruction ctors.
...
llvm-svn: 33708
2007-01-31 19:47:18 +00:00
Chris Lattner
b5aa990588
Revise APIs for creating constantexpr GEPs to not require the use of vectors.
...
This allows us to eliminate many temporary vectors, and theirassociated malloc/free pairs.
llvm-svn: 33692
2007-01-31 04:40:28 +00:00
Reid Spencer
19af04a142
For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
...
confusion with external linkage types.
llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Devang Patel
61ccc1c4b0
- Undo previous check-in (i.e. Do not export TimingInfo class through
...
PassManagers.h).
- Add StopPassTimer() and StartPassTimer() to expose TimingInfo to
CallGraphPassManager
- Use these two APIs in CalLgraphPassManager to measure timings.
llvm-svn: 33638
2007-01-29 23:10:37 +00:00
Devang Patel
fa27881c1c
Move TimingInfo into PassManagers.h so that other libs can use it.
...
llvm-svn: 33626
2007-01-29 20:06:26 +00:00
Anton Korobeynikov
611d5e2eda
Propagate changes from my local tree. This patch includes:
...
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.
NOTEs: 1. Documentation will be updated soon.
2. llvm-upgrade should be improved to translate csret => sret.
Before this, there will be some unexpected test fails.
llvm-svn: 33597
2007-01-28 13:31:35 +00:00
Jim Laskey
64f4242072
Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
...
for debugging and exception handling.
llvm-svn: 33550
2007-01-26 21:22:28 +00:00
Reid Spencer
00a7dd7d6b
For PR761:
...
Remove the setEndianess and setPointerSize methods. These are now
handled via the setDataLayout method.
llvm-svn: 33527
2007-01-26 08:07:57 +00:00
Reid Spencer
e2ac333854
For PR645:
...
Implement new syntax for local and global symbols. Types and local
symbols use the % prefix. Global variables and functions use the @ prefix.
llvm-svn: 33523
2007-01-26 08:02:52 +00:00
Reid Spencer
cca21cf060
For PR645:
...
Remove the Function::renameLocalSymbols function as it is no longer
needed.
llvm-svn: 33522
2007-01-26 08:01:30 +00:00
Reid Spencer
93b5ba7cd2
IntegerType is a sized DerivedType too.
...
llvm-svn: 33521
2007-01-26 07:51:36 +00:00
Reid Spencer
641bcdce55
Clean up comments and assert messages that still refer to the old type names.
...
llvm-svn: 33520
2007-01-26 07:37:34 +00:00
Reid Spencer
25d0264daa
Fix an assertion message.
...
llvm-svn: 33519
2007-01-26 06:30:34 +00:00
Reid Spencer
82909e607c
Whoops, fix typo in last commit.
...
llvm-svn: 33417
2007-01-21 02:29:10 +00:00
Reid Spencer
e33c18f4d2
For PR970:
...
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!
llvm-svn: 33415
2007-01-21 00:29:26 +00:00
Chris Lattner
9df9e3e57b
Teach TargetData to handle 'preferred' alignment for each target, and use
...
these alignment amounts to align scalars when we can. Patch by Scott Michel!
llvm-svn: 33409
2007-01-20 22:35:55 +00:00
Reid Spencer
4bcddb2f04
Remove dead methods in the ValTypes.
...
llvm-svn: 33372
2007-01-19 21:25:12 +00:00
Reid Spencer
14b42c0040
For PR1043:
...
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*
This also fixes PR1120.
Patch by Sheng Zhou.
llvm-svn: 33370
2007-01-19 21:13:56 +00:00
Reid Spencer
b52af65aaa
Use a cheaper computation.
...
llvm-svn: 33336
2007-01-18 18:14:49 +00:00
Reid Spencer
80bf052680
Provide an isPowerOf2ByteWidth method for the IntegerType class. This will
...
mostly be used by back ends that wish to distinguish between integer types
that fit evenly within a natural integer type and those that don't.
llvm-svn: 33328
2007-01-18 02:59:54 +00:00
Devang Patel
cda3b4d76f
Update ModulePass::assignPassManager() to take into account Preferred
...
Pass Manager Type.
llvm-svn: 33308
2007-01-17 21:19:23 +00:00
Devang Patel
b40f9ee72e
s/PassDebugging_New/PassDebugging/g
...
llvm-svn: 33307
2007-01-17 20:33:36 +00:00
Devang Patel
866ecabe21
Update assignPassManager() signature to allow selection of preferred
...
pass manager type. This allows new FPPassManager to select Call Graph
Pass Manager (if available) as its parent.
llvm-svn: 33306
2007-01-17 20:30:17 +00:00
Reid Spencer
d98055f3fe
For PR1117:
...
Expose the previously hidden checkCast function as CastInst::castIsValid.
llvm-svn: 33282
2007-01-17 02:46:11 +00:00
Devang Patel
c65137140c
Pass manager may require certain analysis. In such cases, initially
...
pass manager is last user.
llvm-svn: 33273
2007-01-16 22:38:10 +00:00
Devang Patel
e3e4fcb70f
Undo last check-in.
...
Remove setupPassManager() and its use.
llvm-svn: 33270
2007-01-16 21:43:18 +00:00
Devang Patel
afc2e45d40
Setup pass manager before scheduling required analysis.
...
llvm-svn: 33262
2007-01-16 19:46:09 +00:00
Devang Patel
2d421d58d6
Code refactoring.
...
llvm-svn: 33245
2007-01-16 02:00:38 +00:00
Devang Patel
b61a40bc5a
Remove extra white spaces. Fix comments.
...
llvm-svn: 33244
2007-01-15 23:06:56 +00:00
Devang Patel
67c975490d
Do not record last users of Pass Manager.
...
llvm-svn: 33243
2007-01-15 20:31:54 +00:00
Chris Lattner
b0a126d212
make this more efficient in release builds (time and space)
...
llvm-svn: 33239
2007-01-15 18:28:18 +00:00
Chris Lattner
c5e1611848
rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
...
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.
This makes naming much more consistent. For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)
llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Chris Lattner
f1797fe8bf
teach VMCore to accept i1 add's and shifts
...
llvm-svn: 33223
2007-01-15 02:05:34 +00:00
Chris Lattner
9bda331dc3
don't discriminate against i1
...
llvm-svn: 33213
2007-01-15 00:45:50 +00:00
Reid Spencer
40be764463
Fix a FIXME. 1 bit integer types are now printed as i1 not bool.
...
llvm-svn: 33176
2007-01-13 01:09:33 +00:00
Reid Spencer
42cb213bc9
Make sure the IntegerValType has enough space for 2^23 bits.
...
llvm-svn: 33168
2007-01-13 00:12:29 +00:00
Jim Laskey
ee29cc6016
Allow isAllOnesValue testing on packed constants
...
llvm-svn: 33146
2007-01-12 22:39:14 +00:00
Devang Patel
347efe4ce7
s/addPassToManager/add/g
...
llvm-svn: 33138
2007-01-12 20:07:16 +00:00
Anton Korobeynikov
548b9af9c2
* PIC codegen for X86/Linux has been implemented
...
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)
llvm-svn: 33136
2007-01-12 19:20:47 +00:00
Devang Patel
9afb283500
Move PMTopLevelManager, PMDataManager and FPPassManger classes into
...
new PassManagers.h header.
This opens door for implementing CGPassManager in IPA library.
llvm-svn: 33135
2007-01-12 18:52:44 +00:00
Chris Lattner
cb66b7721a
Remove a bunch of duplicated code. Among other things, this fixes
...
constant folding of signed comparisons of bool.
llvm-svn: 33134
2007-01-12 18:42:52 +00:00
Devang Patel
dc1430cb98
Remove dead code.
...
llvm-svn: 33121
2007-01-12 17:23:48 +00:00
Reid Spencer
eeb33c0716
Always write 1 bit integers as i1 not "bool".
...
llvm-svn: 33115
2007-01-12 07:25:20 +00:00
Reid Spencer
373d2bccea
For PR1064:
...
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.
This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.
Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.
llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer
3d986f6487
Implement review feedback for the ConstantBool->ConstantInt merge. Chris
...
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.
llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Devang Patel
da5ae651e9
Start using PMStack. Now each pass is responsibe for assinging
...
a pass manager for itself.
There is some opportunity to remove some dead code from PassManager.cpp.
llvm-svn: 33087
2007-01-11 22:15:30 +00:00
Devang Patel
5f5c0486fb
Use getPassManagerType() instead of dynamic_cast.
...
llvm-svn: 33078
2007-01-11 19:59:06 +00:00
Reid Spencer
f3265181e2
Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
...
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng
23d24526b2
For PR1043:
...
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.
llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Reid Spencer
c511274dc1
Shut up a warning about signed/unsigned.
...
llvm-svn: 33071
2007-01-11 07:58:19 +00:00
Chris Lattner
6fee172493
simplify some logic further
...
llvm-svn: 33069
2007-01-11 04:30:21 +00:00
Chris Lattner
3147621368
Recommit my previous patch with a bugfix: printInfoComment works on both
...
local and global values.
llvm-svn: 33068
2007-01-11 03:54:27 +00:00
Devang Patel
e485c421c1
Add PassManagerType enum.
...
llvm-svn: 33065
2007-01-11 01:10:25 +00:00
Reid Spencer
12c2bdcc62
Implement better constant folding of unordered FCMP predicates.
...
llvm-svn: 33063
2007-01-11 00:25:45 +00:00
Devang Patel
a0b4424ed4
Robustify assingPassManager() for Module, Function and Basic Block
...
Passes.
Robustify PMStack.push()
Add dump() routine to print PMStack.
llvm-svn: 33062
2007-01-11 00:19:00 +00:00
Reid Spencer
d6ed2499db
Back out the last patch which is a nightly test killer. The assertion
...
in getLocalSlot fires on many, many values. It broke nearly all of
the dejagnu tests. Simple changes to the assertion did not fix the
problem.
llvm-svn: 33054
2007-01-10 09:18:16 +00:00
Chris Lattner
bf6aebe720
Last refactoring before PR645: split up getSlot into getLocalSlot and getGlobalSlot.
...
No functionality change.
llvm-svn: 33053
2007-01-10 07:01:46 +00:00
Chris Lattner
6ee5a4d0d2
eliminate some iterator gymnastics.
...
llvm-svn: 33052
2007-01-10 06:43:26 +00:00
Chris Lattner
af73545299
Inline insertValue into CreateModuleSlot/CreateFunctionSlot
...
llvm-svn: 33038
2007-01-09 08:04:59 +00:00
Chris Lattner
ef3e9a5ea1
Remove a bunch of complex logic that is completely dead: duplicates can
...
never be inserted!
llvm-svn: 33037
2007-01-09 07:58:11 +00:00
Chris Lattner
ee67a96b5d
Split CreateSlot into two versions, one for globals and one for function-local
...
values
llvm-svn: 33036
2007-01-09 07:55:49 +00:00
Chris Lattner
88c55c3483
Remove extraneous return value from insertValue and getOrCreateSlot. Since
...
getOrCreateSlot no longer gets the slot, rename it to CreateSlot.
llvm-svn: 33035
2007-01-09 07:46:21 +00:00
Reid Spencer
96ebce2eda
Parameter attributes are part of a FunctionType and deserve to be factored
...
into comparisons of two FunctionTypes. Make it so.
llvm-svn: 33020
2007-01-08 19:41:01 +00:00
Devang Patel
e0b89a869d
Add PMStack, a Pass Manager stack.
...
Eventually, Top level pass managers will use this to keep track of
active pass managers. Eass pass will also learn how to find appropriate
manager from these managers stack.
llvm-svn: 33018
2007-01-08 19:29:38 +00:00
Andrew Lenharth
31e7a82bea
And asm writing for packed struct initializers
...
llvm-svn: 33016
2007-01-08 18:21:30 +00:00
Chris Lattner
fed811a032
Change the interface to Module::getOrInsertFunction to be easier to use,
...
to resolve PR1088, and to help PR411.
llvm-svn: 32988
2007-01-07 08:09:25 +00:00
Reid Spencer
cdaf88ff9d
For PR411:
...
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.
llvm-svn: 32956
2007-01-06 07:24:44 +00:00
Devang Patel
c1627f6538
1) Remove old AnalysisResolver.
...
2) Rename AnalysisResolver_New as AnalysisResolver
llvm-svn: 32938
2007-01-05 22:47:07 +00:00
Devang Patel
c5a284c3c6
Remove PassManagerT.h
...
llvm-svn: 32928
2007-01-05 20:21:13 +00:00
Devang Patel
fcddd83bfc
Remove old pass manager.
...
llvm-svn: 32927
2007-01-05 20:16:23 +00:00
Reid Spencer
4f14887126
Change the syntax for parameter attributes:
...
1. The @ sign is no longer necessary.
2. We now support "function attributes" as parameter attribute 0.
3. Instead of locating the return type attributes after the type of a
function result, they are now located after the function header's
closing paranthesis and before any alignment or section options.
4. The way has been prepared for a new "noreturn" function attribute but
there is no support for recognizing it in the lexer nor doing anything
with it if it does get set.
5. The FunctionType::getParamAttrsText method now has support for
returning multiple attributes. This required a change in its interface.
I'm unhappy that this change leads to 6 new shift/reduce conflicts, but
in each case bison's decision to choose the shift is correct so there
shouldn't be any damage from these conflicts.
llvm-svn: 32904
2007-01-05 17:06:19 +00:00
Reid Spencer
4b18100144
Do not allow packed types for icmp and fcmp instructions.
...
llvm-svn: 32865
2007-01-04 05:22:18 +00:00
Chris Lattner
29a821859e
Now that setcondinst has been eliminated, we can mark Value::SubclassID
...
const and remove the ugly mutator methods.
llvm-svn: 32860
2007-01-04 02:15:37 +00:00
Chris Lattner
5eca81644b
fix typo
...
llvm-svn: 32859
2007-01-04 02:13:20 +00:00
Chris Lattner
793a771c59
fix some bugs handling vectors, avoid host-specific handling of undefined shift results.
...
llvm-svn: 32857
2007-01-04 01:56:39 +00:00
Chris Lattner
d9342d1db3
Add a new ConstantPacked::getAllOnesValue method
...
llvm-svn: 32856
2007-01-04 01:49:26 +00:00
Reid Spencer
45bed286fa
Fix a cut-and-paste bug for processing of InvokeInst parameter attributes.
...
The lookup of parameter attributes was offset by two because of the
additional operands in an invoke instruction.
llvm-svn: 32801
2006-12-31 22:17:01 +00:00
Reid Spencer
670dd05e78
Fix a bug in comparison of GEP indices.
...
llvm-svn: 32798
2006-12-31 21:43:30 +00:00
Reid Spencer
32825eb0bf
Fix a bug in getParamAttrs where an invalid value would be returned if the
...
index passed in was out of range for the number of parameter attributes set.
llvm-svn: 32794
2006-12-31 17:50:33 +00:00
Reid Spencer
0e961ea8f7
For PR950:
...
Change signed integer type names to unsigned equivalents.
llvm-svn: 32780
2006-12-31 05:26:44 +00:00
Reid Spencer
af0921c568
For PR950:
...
Implement signless integer types and FunctionType parameter attributes.
llvm-svn: 32779
2006-12-31 05:25:34 +00:00
Reid Spencer
ba137437bf
For PR950:
...
* Change integer type name from signed to signless
* Implement printing of FunctionType parameter attributes.
llvm-svn: 32778
2006-12-31 05:24:50 +00:00
Reid Spencer
38002bb037
For PR950:
...
Remove all grammar conflicts from assembly parsing. This change involves:
1. Making the "type" keyword not a primitive type (removes several
reduce/reduce conflicts)
2. Being more specific about which linkage types are allowed for functions
and global variables. In particular "appending" can no longer be
specified for a function. A differentiation was made between the various
internal and external linkage types.
3. Introduced the "define" keyword which is now required when defining a
function. This disambiguates several cases where a named function return
type could get confused with the definition of a new type. Using the
keyword eliminates all shift/reduce conflicts and the remaining
reduce/reduce conflicts.
These changes are necessary to implement the function parameter attributes
that will be introduced soon. Adding the function parameter attributes in
the presence of the shift/reduce and reduce/reduce conflicts led to severe
ambiguities that caused the parser to report syntax errors that needed to
be resolved. This patch resolves them.
llvm-svn: 32770
2006-12-29 20:29:48 +00:00
Reid Spencer
5c1e9c39ef
Cleanup ConstantFoldCompareInstruction:
...
1. Make the arguments const like the other ConstantFold* functions.
2. Clean up evaluateFCmpRelation so it makes sense for floating point.
3. Implement the use of evaluateFCmpRelation to fold floating point CEs
4. Shorten a variable name so more things fit on one line.
5. Fix various comments.
llvm-svn: 32759
2006-12-24 18:52:08 +00:00
Reid Spencer
8d3b67ce23
Fix some comments.
...
llvm-svn: 32758
2006-12-24 18:42:29 +00:00
Reid Spencer
13d15a94aa
Don't overload var names.
...
llvm-svn: 32752
2006-12-23 10:21:26 +00:00
Reid Spencer
4428c3483b
For PR950:
...
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.
llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Devang Patel
e01677db41
ModulePass and ImmutablePass. Force out of line virtual method.
...
llvm-svn: 32748
2006-12-22 22:49:00 +00:00
Devang Patel
b4701a315f
At the beginning of run, initialize analyis info availability for _ALL_
...
pass managers. Otherwise, stale available analysis info, from the managers not
yet run, may cause pass manager to take wrong turn.
This fixes CBE test failures reported by nightly tester.
llvm-svn: 32726
2006-12-21 00:16:50 +00:00
Chris Lattner
7329276511
Fix Regression/Verifier/invoke-1.ll
...
llvm-svn: 32722
2006-12-20 21:20:13 +00:00
Chris Lattner
e5e2285492
Revert the previous patch which was incorrect. This unbreaks eon, but rebreaks
...
invoke-1.ll
llvm-svn: 32718
2006-12-20 19:50:15 +00:00
Reid Spencer
812cc9c807
Now that ConstantInt::isValueValidForType can handle signed and unsigned
...
values regardless of the signedness of the constant's type, it is okay to
always make the AsmWriter.cpp print constant ints as signed values. The
AsmParser will automatically handle things like: uint -1 as a result.
llvm-svn: 32686
2006-12-19 21:16:35 +00:00
Devang Patel
06a6041a4a
Now, there is additional layer, referred in the comment,
...
in place to handle this correctly.
llvm-svn: 32684
2006-12-19 20:12:38 +00:00
Devang Patel
328930d725
s/BasicBlockPassManager/BBPassManager/g
...
s/ModulePassManager/MPPassManager/g
s/FunctionPassManagerImpl_New/FunctionPassManagerImpl/g
s/PassManagerImpl_New/PassManagerImpl/g
Introduce FPPassManager to manage function passes and
BBPassManagers.
Now FunctionPassManagerImpl is an implementation class
used by externally visible FunctionPassManager to manage
FPPassManagers.
Module pass manager (MPPassManager) now manages FPPassManagers
and ModulePasses.
llvm-svn: 32679
2006-12-19 19:46:59 +00:00
Reid Spencer
06d4d23dc0
Clean up ConstantFoldCastInstruction.
...
llvm-svn: 32672
2006-12-19 07:41:40 +00:00
Reid Spencer
77b7f03711
Rewrite ConstantFoldCastInstruction so that it doesn't use any of the
...
ConstRules. Remove the casting rules from ConstRules and subclasses. This
cleans up ConstantFolding significantly. Passes all tests.
llvm-svn: 32671
2006-12-19 03:15:47 +00:00
Reid Spencer
e9d6e54b36
Make ConstantInt not care about sign any more. To ensure the AsmParser can
...
still check the validity of signed values an overload to isValueValidForType
was added to allow passing in an int64_t to check.
llvm-svn: 32663
2006-12-19 01:28:19 +00:00