1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

1731 Commits

Author SHA1 Message Date
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
Reid Spencer
f810a0cfab Remove a useless statement.
llvm-svn: 32660
2006-12-18 23:40:19 +00:00
Reid Spencer
24a09586a9 For PR1042:
Fix a thinko. We want to check the second case if the first cast *didn't*
trigger.

llvm-svn: 32657
2006-12-18 21:56:29 +00:00
Reid Spencer
97af158c16 Remove the createInferredCast methods now that their last uses have been
removed. All casting is now explicit and not inferred by VMCore.

llvm-svn: 32655
2006-12-18 08:52:59 +00:00
Reid Spencer
6769fa4ba2 Remove the two-argument (inferred cast) form of ConstantExpr::getCast now
that its last uses have been removed.

llvm-svn: 32653
2006-12-18 08:18:46 +00:00
Reid Spencer
1f5e1ff1a2 Revert last patch. ConstantInt isn't quite ready for signlessness.
llvm-svn: 32650
2006-12-18 04:22:56 +00:00
Reid Spencer
9ac4a6b7d0 Remove the last use of getUnsignedVersion and getSignedVersion from VMCore.
ConstantInt doesn't care about the sign of the type it represents. It only
cares about the bitwidth so there is no need to make the sign of the type
match the SExt or ZExt constant expression.

llvm-svn: 32646
2006-12-18 01:11:03 +00:00
Chris Lattner
f511077490 Fix PR1042, by tightening up the subtle rules with invoke value use.
llvm-svn: 32624
2006-12-16 02:25:35 +00:00
Devang Patel
d29f6ec89c Add getNumContainedPasses() and getContainedPass() inteface and use
it instead of passVectorBegin/End().

llvm-svn: 32620
2006-12-16 00:56:26 +00:00
Devang Patel
fb82dcf9ee Cosmetic changes, based on Chris's review.
llvm-svn: 32618
2006-12-15 22:57:49 +00:00
Jeff Cohen
95adeca578 Partial unbreak of VC++ (stream stuff has no easy fix).
llvm-svn: 32614
2006-12-15 21:47:01 +00:00
Devang Patel
a37c63bcd5 Mark dump* routines const routines.
llvm-svn: 32610
2006-12-15 20:13:01 +00:00
Devang Patel
f2b927a162 Move PMTopLevelManager and TImingInfo into anon namespace.
llvm-svn: 32606
2006-12-15 19:39:30 +00:00
Devang Patel
d3ea9ae6e9 s/ForcedLastUses/TransferLastUses/g
Register pass has the its last user, otherwise sometimes no one will claim
LastUse.

Handle transferred last uses from child pass manager.

llvm-svn: 32589
2006-12-15 00:08:26 +00:00
Chris Lattner
8213655f44 random minor typographical changes
llvm-svn: 32579
2006-12-14 18:22:14 +00:00
Devang Patel
6a85af195a Add -time-passes support.
llvm-svn: 32574
2006-12-14 00:59:42 +00:00
Devang Patel
76ecbc449f Add debug-pass=Details support to print Required and Preserved Set info.
llvm-svn: 32573
2006-12-14 00:25:06 +00:00
Devang Patel
740b960858 Add " Made Modification " messages in debug-pass=Executions output.
llvm-svn: 32572
2006-12-14 00:08:04 +00:00
Devang Patel
b726becbcd Add debug-pass=Executions support in new pass manager.
llvm-svn: 32571
2006-12-13 23:50:44 +00:00
Devang Patel
5a200bf480 Add -pass-debug=Arguments support in new manager.
llvm-svn: 32567
2006-12-13 22:10:00 +00:00
Chris Lattner
e8d97c0b07 fit in 80 cols
llvm-svn: 32563
2006-12-13 21:56:10 +00:00
Devang Patel
58ac5db67f Using PDL as a prefix for PassDebugLevel enums is not a good idea.
Fix it.

llvm-svn: 32562
2006-12-13 21:13:31 +00:00
Devang Patel
7208b2e3e6 Move enum PassDebugLevel from PassManagerT.h to Pass.h.
Use PDL as the prefix for these enums.
Define and use PassDebugging_New in new PassManager.

llvm-svn: 32554
2006-12-13 20:03:48 +00:00
Jim Laskey
ccb6b45e70 Update version in safe guards.
llvm-svn: 32546
2006-12-13 17:49:24 +00:00
Chris Lattner
1228f12fb4 only check non-external functions
llvm-svn: 32530
2006-12-13 04:45:46 +00:00
Chris Lattner
be3585daa3 Reject attempts to define intrinsics. This fixes PR1047 and
Regression/Verifier/2006-12-12-IntrinsicDefine.ll

llvm-svn: 32529
2006-12-13 04:30:37 +00:00
Devang Patel
3c8836df17 Add #ifdef switch toggle between old and new pass manager. However,
continue to use old pass manager at the moment. To use new manager
remove #define USE_OLD_PASSMANAGER 1 from Pass.h

llvm-svn: 32525
2006-12-13 02:36:01 +00:00
Devang Patel
ad1c3bba52 FunctionPassManager does not support runOnModule().
llvm-svn: 32519
2006-12-13 00:34:32 +00:00
Devang Patel
ae0e0cdff7 Implement PassManager_New destructors.
llvm-svn: 32517
2006-12-13 00:09:23 +00:00
Devang Patel
da35cdf10e Remove unused constructor.
llvm-svn: 32516
2006-12-12 23:51:31 +00:00
Reid Spencer
0e981c9088 Replace inferred getCast(V,Ty) calls with more strict variants.
Rename getZeroExtend and getSignExtend to getZExt and getSExt to match
the the casting mnemonics in the rest of LLVM.

llvm-svn: 32514
2006-12-12 23:36:14 +00:00
Devang Patel
ae9da674a1 Add routines to dump pass manager queue.
llvm-svn: 32513
2006-12-12 23:34:33 +00:00
Devang Patel
b26731c9cd FunctionPassManager()
Set AnalysisResolver_New and add FPM to PassManagers list.

llvm-svn: 32512
2006-12-12 23:27:37 +00:00
Devang Patel
e08024130b Do not runOnFunction on external functions.
llvm-svn: 32510
2006-12-12 23:15:28 +00:00
Devang Patel
09032bc2b0 Initialize AnalysisImpls for each pass before executing the pass.
llvm-svn: 32509
2006-12-12 23:13:09 +00:00
Devang Patel
e969385cb9 collectRequiredAnalysisPasses().
Include RequiredTrainsitiveSet also.

llvm-svn: 32508
2006-12-12 23:09:32 +00:00
Devang Patel
8a5442e16d removeNotPreservedAnalysis().
Do not remove ImmutablePass from the list.

llvm-svn: 32507
2006-12-12 23:07:44 +00:00
Devang Patel
94bb02ef16 Initialize activeManager.
llvm-svn: 32506
2006-12-12 22:57:43 +00:00
Devang Patel
a756f126ea Remove unused constructor.
llvm-svn: 32505
2006-12-12 22:56:36 +00:00
Devang Patel
ea7846dd99 Maintain ImmutablePasses list at top level only. Do not make them
directly available to individual managers.

llvm-svn: 32504
2006-12-12 22:53:40 +00:00
Devang Patel
4d694e6674 findAnalysisPass().
First search all available passes before searching ImmutablePasses.

llvm-svn: 32503
2006-12-12 22:50:05 +00:00
Devang Patel
921f11b896 Fix thinko.
While searching for a analysis in a pass manager, do not search it into
pass manager's manager.

llvm-svn: 32501
2006-12-12 22:47:13 +00:00
Devang Patel
a3a8aeb459 o s/OtherPassManagers/IndirectPassManagers
o Make IndirectPassManagers vector of PMDataManager *
o Move PMTopLevelManager implementation below all class declarations.

llvm-svn: 32499
2006-12-12 22:35:25 +00:00
Devang Patel
bda67816fd Initialize AnalysisImpls for ImmutablePass.
llvm-svn: 32498
2006-12-12 22:21:37 +00:00
Devang Patel
f2e0fe66cd Set top level manager.
llvm-svn: 32496
2006-12-12 22:02:16 +00:00
Reid Spencer
e9161a2f5e Don't create usless casts for same-bith-width floating point casts.
llvm-svn: 32475
2006-12-12 05:38:50 +00:00
Reid Spencer
3fbfed6e2c Implement getIntegerCast and getFPCast for ConstantExpr. These are similar
to the createIntegerCast and createFPCast for CastInst instructions.

llvm-svn: 32457
2006-12-12 00:51:07 +00:00
Reid Spencer
a82b285a69 Implement createIntegerCast and createFPCast factory methods for handling
integer and floating point cast creation. createIntegerCast generates
ZExt/SExt, BitCast or Trunc. createFPCast generates FPExt, Bitcast, or
FPTrunc.

llvm-svn: 32456
2006-12-12 00:49:44 +00:00
Reid Spencer
f48e2567ae Fix constant folding of FP->int due to cut & paste error in last commit.
llvm-svn: 32447
2006-12-11 21:27:28 +00:00
Chris Lattner
f512c0d8e5 Implement correct constant folding of bitcast. This implements
Transforms/ConstProp/bitcast.ll and fixes
SingleSource/Regression/C/2003-10-12-GlobalVarInitializers

llvm-svn: 32438
2006-12-11 18:30:27 +00:00
Chris Lattner
6ea5a77a93 fix typo
llvm-svn: 32428
2006-12-11 02:16:58 +00:00
Chris Lattner
6df6fa3694 fix PR1039 by making timing info be destroyed by llvm_shutdown, not by
static dtors.

llvm-svn: 32411
2006-12-10 07:40:46 +00:00
Devang Patel
1dab3b3558 Analysis resolver now manages AnalysisImpls for the given patch.
llvm-svn: 32389
2006-12-09 01:11:34 +00:00
Devang Patel
a330306e9b Top level pass manager keeps track of other managers, so this can be
removed now.

llvm-svn: 32388
2006-12-09 00:09:12 +00:00
Devang Patel
73cf028f5f Use analysis resolver to find the info.
llvm-svn: 32387
2006-12-09 00:07:38 +00:00
Devang Patel
385edd79c5 Do not drop ImmutablePasses on the floor.
llvm-svn: 32386
2006-12-08 23:57:43 +00:00
Devang Patel
4e6c9b0ad9 Set AnalysisResolver for the passes when they are inserted into
pass manager queuer.

llvm-svn: 32385
2006-12-08 23:53:00 +00:00
Devang Patel
6f0bb6fbed Add AnalysisResolver_New. It is a replacement for existing
AnalysisResolver.

llvm-svn: 32383
2006-12-08 23:28:54 +00:00
Devang Patel
17fec0924c Keep track of other pass managers, that are not directly managed by
top level manager. Use this info to findAnalysisPass.

llvm-svn: 32382
2006-12-08 23:11:43 +00:00
Devang Patel
1342f262e3 Implement top level FunctionPassManager::run(Function &F)
llvm-svn: 32381
2006-12-08 22:57:48 +00:00
Devang Patel
ddcef36da4 Do not keep yet another list of pass managers in PassManagerImpl_New.
Use one provided by toplevel manager.

llvm-svn: 32380
2006-12-08 22:47:25 +00:00
Devang Patel
f0c7476178 Remove unused schedulePass() parameter.
llvm-svn: 32379
2006-12-08 22:34:02 +00:00
Devang Patel
8ff822772f Remove unused getAnalysisPass and getAnalysisPassFromManager
llvm-svn: 32378
2006-12-08 22:32:32 +00:00
Devang Patel
a4ef9062bf Implement PMTopLevel::findAnalysisPass() and
PMDataManager::findAnalysisPass()

llvm-svn: 32377
2006-12-08 22:30:11 +00:00
Devang Patel
7f1091cb14 During runOnModule() do initialization and finalization.
llvm-svn: 32371
2006-12-08 19:04:09 +00:00
Devang Patel
ebab6b3112 Reuse code. Directly use runOnFunction().
llvm-svn: 32370
2006-12-08 19:03:05 +00:00
Devang Patel
4833df8e9e Implement FunctionPassManager_New::FunctionPassManager_New(ModuleProvider *P)
llvm-svn: 32368
2006-12-08 18:57:16 +00:00
Andrew Lenharth
d115fe7ce3 Packed Structures
llvm-svn: 32361
2006-12-08 18:06:16 +00:00
Devang Patel
94eedf9be1 BasicBlockPassManager_New::runOnFunction()
Do initialization and finalization.

llvm-svn: 32346
2006-12-08 01:38:28 +00:00
Devang Patel
0fc48cda15 doInitialization and doFinalization for BasicBlockPassManager_New
llvm-svn: 32345
2006-12-08 00:59:05 +00:00
Devang Patel
67bb3725d4 Reimplement removeDeadPasses().
llvm-svn: 32344
2006-12-08 00:37:52 +00:00
Devang Patel
3364b5821e set Last User.
llvm-svn: 32342
2006-12-07 23:55:10 +00:00
Bill Wendling
fe0af72bc4 Don't use <sstream> in Streams.h but <iosfwd> instead.
llvm-svn: 32340
2006-12-07 23:41:45 +00:00
Devang Patel
df9f0e26f9 Maintain level(or depth) of pass manager in pass manager food chain.
llvm-svn: 32339
2006-12-07 23:24:58 +00:00
Devang Patel
19a733b718 New method, PMDataManager::collectRequiredAnalysisPasses()
llvm-svn: 32338
2006-12-07 23:05:44 +00:00
Devang Patel
b361bb840c When new pass manager is created, initialize available analysis info
of existing manager at the same level. Otherwise, such info may be
considered as available, which not true.

llvm-svn: 32334
2006-12-07 22:34:21 +00:00
Devang Patel
967a319698 PMDataManager does not maintain LastUser info.
llvm-svn: 32332
2006-12-07 22:17:09 +00:00
Devang Patel
9be7d811ae Make current pass info available _after_ removing info that is not
preserved.

llvm-svn: 32329
2006-12-07 22:09:36 +00:00
Devang Patel
145469fbf2 Add TODOs
llvm-svn: 32328
2006-12-07 21:58:50 +00:00
Devang Patel
a15af91097 Fix thinko.
llvm-svn: 32327
2006-12-07 21:44:12 +00:00
Devang Patel
b945504462 Top level manages schedule the pass immediately at the time of insertion.
llvm-svn: 32326
2006-12-07 21:32:57 +00:00
Devang Patel
ff5d922b04 Now FunctionPassManagerImpl_New and PassManagerImpl_New derives from
PMTopLevelManager.

llvm-svn: 32325
2006-12-07 21:27:23 +00:00
Devang Patel
81b62a7e2c Reimplement schedulePass interface. Move it into PMTopLevelManager.
llvm-svn: 32324
2006-12-07 21:10:57 +00:00
Devang Patel
b2ce1fc089 While initializing AvailableAnalysis info, make ImmutablePasses available
immediately.

llvm-svn: 32323
2006-12-07 21:02:08 +00:00
Devang Patel
adf0a3a147 Add ImmutablePass into the list of info managed by top level pass
manager.

llvm-svn: 32322
2006-12-07 20:51:18 +00:00
Bill Wendling
23b8b13c9d Removing even more <iostream> includes.
llvm-svn: 32320
2006-12-07 20:04:42 +00:00
Devang Patel
0117a3e391 If pass reserves all analysis info then each info is not separately
included in PreservedSet. So check getPreservesAll() first.

llvm-svn: 32319
2006-12-07 20:03:49 +00:00
Devang Patel
318adc0e9d Pass Managers themselves do not invalidate any analysis info.
llvm-svn: 32318
2006-12-07 19:57:52 +00:00
Devang Patel
8c988e1dc2 Add a handle to the top level pass manager in PMDataManager.
llvm-svn: 32317
2006-12-07 19:54:15 +00:00
Devang Patel
e6f5ded0ef Cosmetic markers to divide code in separate chunks.
llvm-svn: 32316
2006-12-07 19:39:39 +00:00
Devang Patel
89a14dfcd0 s/noteDownAvailableAnalysis/recordAvailableAnalysis
While recording available analysis, include interfaces implemented.

llvm-svn: 32315
2006-12-07 19:33:53 +00:00
Devang Patel
e4c87643a5 Add PMTopLevelManager. It is not used yet.
llvm-svn: 32314
2006-12-07 19:21:29 +00:00
Devang Patel
7e140ec79c RequiredAnalysis support is buggy and not used at the moment so remove
the code. Add TODO note.

llvm-svn: 32313
2006-12-07 18:47:25 +00:00
Devang Patel
b43799cea4 s/clearAnalysis/initializeAnalysisInfo/g
llvm-svn: 32312
2006-12-07 18:41:09 +00:00
Devang Patel
364530904f s/CommonPassManagerImpl/PMDataManager/g
llvm-svn: 32311
2006-12-07 18:36:24 +00:00
Devang Patel
580df8ade2 Add overview of pass manager.
llvm-svn: 32309
2006-12-07 18:23:30 +00:00
Reid Spencer
076e7af638 Provide a getOpcode() method on CmpInst to ensure the opcode is returned
as the right type. Use this to shorten some code.

llvm-svn: 32300
2006-12-07 04:18:31 +00:00
Bill Wendling
a3246c4272 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Reid Spencer
19cb81393d For PR950:
Remove the getMaxValue and getMinValue functions from ConstantIntegral.
They don't make sense for a signless type. Also, for isMaxValue and
isMinValue, have the caller provided the signedness rather than obtaining
it from the constant's type.

llvm-svn: 32287
2006-12-06 20:30:17 +00:00
Chris Lattner
f92de9a3d2 Remove the dead CachedWriter class.
llvm-svn: 32271
2006-12-06 06:40:49 +00:00
Chris Lattner
a428b29cdb printName is almost always true. In the cases that mattered where it was false,
it was effectively set to true by this:

-  if ((PrintName || isa<GlobalValue>(V)) && V->hasName())
+  if (V->hasName())

Delete printname entirely.

llvm-svn: 32265
2006-12-06 06:24:27 +00:00
Chris Lattner
3d1758e08c Remove the 'printname' argument to WriteAsOperand. It is always true, and
passing false would make the asmprinter fail anyway.

llvm-svn: 32264
2006-12-06 06:16:21 +00:00
Chris Lattner
c73d71336d The hasSlot methods are gone.
Remove the 'PrintName' argument to WriteAsOperand, as it is always true.
Only call getOrCreateSlot on things that are valid.

llvm-svn: 32263
2006-12-06 06:15:43 +00:00
Chris Lattner
cc4a08f45b remove unused api, simplify some code
llvm-svn: 32260
2006-12-06 05:55:41 +00:00
Chris Lattner
04357677e5 remove more code that was only used by the bc writer
llvm-svn: 32259
2006-12-06 05:50:41 +00:00
Chris Lattner
9a36bc328e remove dead code left over from when this functionality was shared with the
bcwriter.

llvm-svn: 32258
2006-12-06 05:42:32 +00:00
Chris Lattner
7ee127edad rename createSlot -> getOrCreateSlot.
llvm-svn: 32256
2006-12-06 05:27:40 +00:00
Chris Lattner
8f97b3e24b clean up some sloppy and inconsistent spacing
llvm-svn: 32255
2006-12-06 05:12:21 +00:00
Chris Lattner
74b8045bc5 wrap long lines
llvm-svn: 32254
2006-12-06 04:41:52 +00:00
Reid Spencer
2a2cc7fc14 Fix constant folding to deal with external weak global values.
llvm-svn: 32247
2006-12-06 00:25:09 +00:00
Chris Lattner
a6cad8869f Fix Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll, fixing an out-of-
stack-space issue in the ppc bootstrap.

llvm-svn: 32244
2006-12-05 23:43:59 +00:00
Reid Spencer
c87c3e5a70 Bail on the getInferredCast idea. Remove the function and convert
remaining uses to more specific casts.

llvm-svn: 32231
2006-12-05 19:14:13 +00:00
Reid Spencer
28a5079f58 Can't make these fail now with just BitCast. Previous failures must have
been in conjunction with something else. By right, they should just be
BitCasts.

llvm-svn: 32219
2006-12-05 07:18:07 +00:00
Reid Spencer
679821dd29 Remove the last inferred casts from VMCore.
llvm-svn: 32213
2006-12-05 03:30:09 +00:00
Reid Spencer
4f42ccea23 Implement createPointerCast.
llvm-svn: 32212
2006-12-05 03:28:26 +00:00
Reid Spencer
c5727bf642 Implement getPointerCast.
llvm-svn: 32211
2006-12-05 03:25:26 +00:00
Reid Spencer
10b94bb9f5 Separate getCompare from get and getCompareTy from getTy.
llvm-svn: 32200
2006-12-04 21:35:24 +00:00
Reid Spencer
2d2a26767e Implement new cast creation functions for both instructions and constant
expressions. These will get used to reduce clutter as we replace various
calls to createInferredCast and getCast.

llvm-svn: 32191
2006-12-04 20:17:56 +00:00
Reid Spencer
94096ebd7c Reduce the size of the ExprMapKeyType class.
llvm-svn: 32186
2006-12-04 18:38:05 +00:00
Reid Spencer
e6770851c0 For PR950: Fix constant expressions to properly support ICmp and FCmp type expressions.
llvm-svn: 32170
2006-12-04 05:19:50 +00:00
Reid Spencer
2580dd751f For PR950: Implement a stub for folding ICmp and FCmp instructions
llvm-svn: 32169
2006-12-04 05:19:34 +00:00
Reid Spencer
ca27d66971 For PR950: Implement ICmp/FCmp predicate printing for constant expressions
llvm-svn: 32168
2006-12-04 05:19:18 +00:00
Reid Spencer
0668975146 Change inferred casts to explicit casts.
llvm-svn: 32165
2006-12-04 02:46:44 +00:00
Reid Spencer
4cb4234c17 Take a baby step towards getting rid of inferred casts. Provide methods on
CastInst and ConstantExpr that allow the signedness to be explicitly passed
in and reliance on signedness removed from getCastOpcode. These are
temporary measures useful during the conversion of inferred casts.

llvm-svn: 32164
2006-12-04 02:43:42 +00:00
Reid Spencer
470e894f5c Remove dead code.
llvm-svn: 32157
2006-12-03 16:21:33 +00:00
Reid Spencer
f78fe29ca8 Shorten the FCmp predicate mnemonics.
llvm-svn: 32150
2006-12-03 06:35:48 +00:00
Reid Spencer
904e41f87e Allow the ICmp and FCmp instructions to be written by the AsmWriter
llvm-svn: 32148
2006-12-03 06:27:29 +00:00
Reid Spencer
a468638458 Implement creation of ICmp and FCmp constant expressions.
llvm-svn: 32147
2006-12-03 05:48:19 +00:00
Jeff Cohen
f99052befb Unbreak VC++ build.
llvm-svn: 32113
2006-12-02 02:22:01 +00:00
Chris Lattner
7a39941897 Switch analysis groups to be unregistered when llvm_shutdown is called.
llvm-svn: 32110
2006-12-01 23:46:50 +00:00
Chris Lattner
1b0e89e022 Start moving pass registration over to using the ManagedStatic mechanism.
This fixes issues where passes get unregistered before llvm_shutdown is
called, and is generally cleaner and simpler.  Analysis groups up next.

llvm-svn: 32108
2006-12-01 23:27:45 +00:00
Chris Lattner
a2bd5d4aaa move 'cfgonly' pass tracking into PassInfo, instead of handling it with
yet-another global data structure.

llvm-svn: 32102
2006-12-01 22:21:11 +00:00
Chris Lattner
64b24381a8 These should be rewritten to fold without using the 'Rules' mechanism, but
until this happens at least make sext from bool and sitofp from bool do the
right thing.

llvm-svn: 32087
2006-12-01 19:50:54 +00:00
Chris Lattner
7e0d6868fd this logic is broken for trunc to bool, replace the folding logic for trunc
completely, as it is trivial.  We should probably do this for the rest of the
cast operations.  This fixes ConstProp/2006-12-01-TruncBoolBug.ll.

llvm-svn: 32081
2006-12-01 19:22:41 +00:00
Chris Lattner
497c976859 add a new ConstantIntegral::get method. Simplify the implementation of
ConstantInt::get

llvm-svn: 32080
2006-12-01 19:20:02 +00:00
Chris Lattner
c65612e859 Fix a typo introduced by the cast patch that horribly broke a lot of vector
code.  Testcase here: Transforms/ConstProp/2006-11-30-vector-cast.ll

llvm-svn: 32062
2006-12-01 05:55:25 +00:00
Reid Spencer
a1613b631b Don't fold "ptrtoint GV to bool" since this should be doing a truncate not
a comparison against zero. Instead fold setne(GV,null) and seteq(GV,null)
to ConstantBool::True or ConstantBool::False, respectively.

llvm-svn: 32060
2006-12-01 03:56:30 +00:00
Anton Korobeynikov
f627d28d9c Introducing external weak linkage. Darwin codegen should be added later.
llvm-svn: 32052
2006-12-01 00:25:12 +00:00
Bill Wendling
aa02717a76 Changed to using LLVM streams.
llvm-svn: 31955
2006-11-28 02:09:03 +00:00
Reid Spencer
992d9788b3 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Reid Spencer
6e34ef887b For PR950:
First in a series of patches to convert SetCondInst into ICmpInst and
FCmpInst using only two opcodes and having the instructions contain their
predicate value. Nothing uses these classes yet. More patches to follow.

llvm-svn: 31867
2006-11-20 01:22:35 +00:00
Bill Wendling
1838be30c7 Removed iostream #includes. Replaced std::cerr with DOUT.
llvm-svn: 31814
2006-11-17 08:03:48 +00:00
Devang Patel
6060a1e3dc Add run(Function &F) support in FunctionPassManager_New
llvm-svn: 31756
2006-11-15 19:39:54 +00:00
Devang Patel
c252225cec Tidy up marking of last analysis user pass.
llvm-svn: 31746
2006-11-15 01:48:14 +00:00
Devang Patel
343e099f5d Add doInitialization and doFinalization support in FunctionManager_New.
llvm-svn: 31745
2006-11-15 01:27:05 +00:00
Devang Patel
55ee589fb9 Do not derive CommonPassManagerImpl from Pass.
Now BasicBlockPassManager_New is a FunctionPass,
FunctionPassManager_New is a ModulePass

llvm-svn: 31744
2006-11-15 01:11:27 +00:00
Devang Patel
4f5849544b Copy initializeAnalysisImpl() implementation from PassManagerT.
Update LastUser to recursively walk required transitive set.

llvm-svn: 31741
2006-11-14 21:49:36 +00:00
Devang Patel
bb3da3a9a1 Implement removeDeadPasses().
llvm-svn: 31722
2006-11-14 03:05:08 +00:00
Devang Patel
816f60d7e9 Keep track of Last user of analysis phase.
llvm-svn: 31721
2006-11-14 02:54:23 +00:00
Devang Patel
2b9bd4aa34 Use std::map to map AnalysisID and Pass.
llvm-svn: 31720
2006-11-14 01:59:59 +00:00
Devang Patel
bcc72c8a5a Manage analysis passes during run.
llvm-svn: 31716
2006-11-14 01:23:29 +00:00
Devang Patel
fa6da87694 Update comments.
llvm-svn: 31713
2006-11-14 00:03:04 +00:00
Devang Patel
5297c37d63 Update PassManagerImpl_New::analysisCurrentlyAvailable to check all
managed passmanagers.

llvm-svn: 31710
2006-11-13 22:53:19 +00:00
Devang Patel
84dd1c2764 Check currently available anlysis in active managers.
llvm-svn: 31709
2006-11-13 22:40:09 +00:00
Devang Patel
27cf4a91e7 Implement schedulePasses().
llvm-svn: 31671
2006-11-11 02:22:31 +00:00
Devang Patel
b324dacabf Implement PassManagerImpl_New::add().
Just add pass into the pass manager queue without processing analysis.

llvm-svn: 31670
2006-11-11 02:06:21 +00:00
Devang Patel
f00e57a19c While adding pass into the manager, process Analysis only if it is
required to do so.

llvm-svn: 31669
2006-11-11 02:04:19 +00:00
Devang Patel
0eb0bad5e8 Remove dead code.
llvm-svn: 31668
2006-11-11 01:56:39 +00:00
Devang Patel
71420afe60 Code refactoring. Move common code into CommonPassManagerImpl :)
llvm-svn: 31667
2006-11-11 01:51:02 +00:00
Devang Patel
785d727d1c Move CommonPassManagerImpl from PassManager.h to PassManager.cpp
llvm-svn: 31666
2006-11-11 01:31:05 +00:00
Devang Patel
9e926cd9f8 Remove analysis that is not preserved by the pass from AvailableAnalysis.
llvm-svn: 31665
2006-11-11 01:24:55 +00:00
Devang Patel
124cfa3f26 Keep track if analysis made available by the pass.
llvm-svn: 31664
2006-11-11 01:10:19 +00:00
Devang Patel
1bff0f0174 Keep track of analysis required by the passes. Force use of new pass
manager if a pass does not preserve analysis that is used by other
passes.

llvm-svn: 31659
2006-11-11 00:42:16 +00:00
Devang Patel
a9504181aa s/PassManagerAnalysisHelper/CommonPassManagerImpl
Inherit CommonPassManagerImpl from Pass.

llvm-svn: 31642
2006-11-10 21:33:13 +00:00
Jim Laskey
28fec74f1b Remove redundant <cmath>.
llvm-svn: 31561
2006-11-08 19:16:44 +00:00
Devang Patel
0aa28c8146 Split FunctionPassManager_New into FunctionPassManager_New and FunctionPassManagerImpl_New.
FunctionPassManagerImpl_New implements the pass manager.
FunctionPassManager_New is the public interface.

llvm-svn: 31547
2006-11-08 10:44:40 +00:00
Devang Patel
12982590fa Split PassManager_New into PassManager_New and PassManagerImpl_New.
PassManagerImpl_New implements the pass manager.
PassManager_New is the public interface.

llvm-svn: 31546
2006-11-08 10:29:57 +00:00
Devang Patel
03dc236bdd Move BasicBlockPassManager_New, FunctionPassManager_New and
ModulePassManager_New class declarations from PassManager.h
to PassManager.cpp

llvm-svn: 31545
2006-11-08 10:05:38 +00:00
Reid Spencer
da1f5b882a For PR950:
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.

llvm-svn: 31542
2006-11-08 06:47:33 +00:00
Devang Patel
432399869d Beautify.
llvm-svn: 31533
2006-11-08 01:31:28 +00:00
Devang Patel
47de6ddc07 Update new pass managers to use PassManagerAnalysisHelper API.
llvm-svn: 31526
2006-11-07 22:56:50 +00:00
Devang Patel
fece2777c4 Introduce PassManagerAnalysisHelper.
llvm-svn: 31522
2006-11-07 22:35:17 +00:00
Devang Patel
6d4ef98c03 Add PassManager_New.
llvm-svn: 31521
2006-11-07 22:23:34 +00:00
Devang Patel
cacc940858 Add ModulePassManager_New.
llvm-svn: 31517
2006-11-07 22:03:15 +00:00
Devang Patel
9a2c6538dd Add FunctionPassManager_New.
llvm-svn: 31515
2006-11-07 21:49:50 +00:00
Devang Patel
b7d2cd5ec2 Add BasicBlockPassManager_New.
llvm-svn: 31513
2006-11-07 21:31:57 +00:00
Reid Spencer
4bafa71dc1 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.

llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Reid Spencer
c3ef589d23 Remove unused variable.
llvm-svn: 31376
2006-11-02 08:23:44 +00:00
Reid Spencer
7af6c17de0 Remove unused variables.
llvm-svn: 31375
2006-11-02 08:18:15 +00:00
Reid Spencer
1abf69e923 For PR950:
Replace the REM instruction with UREM, SREM and FREM.

llvm-svn: 31369
2006-11-02 01:53:59 +00:00
Devang Patel
2015279c13 Update comment. Valid option is -debug-pass=Structures.
llvm-svn: 31297
2006-10-30 19:25:54 +00:00
Reid Spencer
dd294b507f Make the Value and Type methods print a newline so it prints nicely in gdb
llvm-svn: 31221
2006-10-27 18:58:54 +00:00
Evan Cheng
a42e1492fd Speed up isCString()
llvm-svn: 31206
2006-10-26 21:48:03 +00:00
Evan Cheng
9d0bfecda6 Add isCString() - returns true if a ConstantArray is a CString.
llvm-svn: 31201
2006-10-26 19:15:05 +00:00
Chris Lattner
53cc483549 Fix Transforms/InstCombine/2006-10-26-VectorReassoc.ll
llvm-svn: 31200
2006-10-26 18:27:26 +00:00
Chris Lattner
257998ec14 Add isFPOrFPVector() method, which indicates if a type is either FP or a
vector of FP types.

llvm-svn: 31198
2006-10-26 18:22:45 +00:00
Reid Spencer
6833ffe8b8 For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.

llvm-svn: 31195
2006-10-26 06:15:43 +00:00
Reid Spencer
917bba3135 Make the makefile tell us when Intrinsics.gen is being updated.
llvm-svn: 31191
2006-10-26 01:42:23 +00:00
Chris Lattner
9e59066602 Change keyword to datalayout
llvm-svn: 31107
2006-10-22 06:06:56 +00:00
Reid Spencer
d414793dbc For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Chris Lattner
5b4ca99562 add a method to determine whether evaluation of a constant can trap.
llvm-svn: 31059
2006-10-20 00:27:06 +00:00
Owen Anderson
12374f766b Add support for the new "target data" information in .ll files. This provides
a better encoding of the targets data layout, rather than trying to guess it
from the endianness and pointersize like before.

llvm-svn: 31030
2006-10-18 02:21:12 +00:00
Chris Lattner
5a4d067b26 label* is not a valid type, add an assertion.
llvm-svn: 30968
2006-10-15 23:21:12 +00:00
Chris Lattner
5cd4ac0a79 Fix another dtor issue. The function local statics in this function were
being destroyed at inconvenient times.  Switch to using non-local ManagedStatic
objects, which actually also speeds up ConstRules::get.

llvm-svn: 30931
2006-10-13 17:22:21 +00:00
Chris Lattner
14ad447136 Add insertelement/extractelement helper ctors.
llvm-svn: 30750
2006-10-05 06:24:58 +00:00
Chris Lattner
f943ae3b8a getFilename/getDirectory shouldn't abort if the global has no init. This
can happen on bugpoint reduced testcases f.e..

llvm-svn: 30729
2006-10-04 23:06:26 +00:00
Chris Lattner
78e10ebf8a Add a version of the globalvariable ctor that inserts at a specific location.
llvm-svn: 30677
2006-09-30 21:31:26 +00:00
Chris Lattner
5706d03998 Minor cleanups
llvm-svn: 30668
2006-09-28 23:45:00 +00:00
Chris Lattner
220e198fbe Now that ConstantBool::True/False are gone, we can modify Type.cpp to
eliminate its static dtors, without having code that depends on order of
initialization.  Eliminate static ctors/dtors from Type.cpp.

llvm-svn: 30667
2006-09-28 23:38:07 +00:00
Chris Lattner
155e6b8403 Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().

llvm-svn: 30666
2006-09-28 23:36:21 +00:00
Chris Lattner
c00ee152c9 Eliminate ConstantBool::True and ConstantBool::False. Instead, provideConstantBool::getTrue() and ConstantBool::getFalse().
llvm-svn: 30664
2006-09-28 23:34:49 +00:00
Chris Lattner
3b8cae29c7 simplify code
llvm-svn: 30655
2006-09-28 22:50:29 +00:00
Chris Lattner
4c15e307ef remove reference to dead method
llvm-svn: 30641
2006-09-28 00:38:19 +00:00
Chris Lattner
5271c8739a Use the new ManagedStatic class to explicitly manage static variables, eliminating static ctors/dtors
llvm-svn: 30639
2006-09-28 00:35:06 +00:00
Chris Lattner
bf0b610dfa add method, correct comment
llvm-svn: 30584
2006-09-23 04:03:45 +00:00
Devang Patel
b34118f8bd remove extra white spaces.
llvm-svn: 30576
2006-09-22 01:07:57 +00:00
Devang Patel
8248ba3afc Use iterative algorith to assign DFS number. This reduces
call stack depth.

llvm-svn: 30575
2006-09-22 01:05:33 +00:00
Anton Korobeynikov
59ef7e94eb Adding codegeneration for StdCall & FastCall calling conventions
llvm-svn: 30549
2006-09-20 22:03:51 +00:00
Chris Lattner
be102d68c2 add a helper method
llvm-svn: 30452
2006-09-18 04:54:57 +00:00
Anton Korobeynikov
7c2118575c Added some eye-candy for Subtarget type checking
Added X86 StdCall & FastCall calling conventions. Codegen will follow.

llvm-svn: 30446
2006-09-17 20:25:45 +00:00
Chris Lattner
547b62a967 Add ShiftInst::isLogical/ArithmeticShift methods.
llvm-svn: 30445
2006-09-17 19:29:56 +00:00
Chris Lattner
8aa718b0ed Add new SetCondInst::isRelational/isEquality methods. Rename
Instruction::isRelational to Instruction::isComparison.

llvm-svn: 30444
2006-09-17 19:14:47 +00:00
Devang Patel
0d540a2f9a Undo previous check-in.
Reintroduce recursive assignDFSNumber().

llvm-svn: 30380
2006-09-14 21:43:24 +00:00
Anton Korobeynikov
6e19f80688 Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.

llvm-svn: 30374
2006-09-14 18:23:27 +00:00
Devang Patel
2983c628cd Avoid recursion in assignDFSNumber(). Move def from ET-Forest.h
to Dominators.h

llvm-svn: 30309
2006-09-14 01:27:42 +00:00
Chris Lattner
47f39eb3db Add new option to leave asm names alone
llvm-svn: 30149
2006-09-07 18:20:41 +00:00
Chris Lattner
50f76d4c5d Add explicit doInitialization/doFinalization methods instead of making
the FunctionPassManager redo this for each function.

llvm-svn: 30079
2006-09-04 04:07:39 +00:00
Chris Lattner
9c13e636d4 Count the time for a pass to ReleaseMemory against that pass. Not doing this
was under accounting for the time that livevariables cost

llvm-svn: 30060
2006-09-02 23:09:24 +00:00
Reid Spencer
2567610703 For PR387:
Close out this long standing bug by removing the remaining overloaded
virtual functions in LLVM. The -Woverloaded-virtual option is now turned on.

llvm-svn: 29934
2006-08-28 01:02:49 +00:00
Chris Lattner
6474b3fe80 Silence -Woverloaded-virtual warnings.
llvm-svn: 29929
2006-08-28 00:09:00 +00:00
Chris Lattner
a39dcb5377 eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner
f530302eda Eliminate RegisterAnalysis. RegisterPass now does all that is necessary.
llvm-svn: 29921
2006-08-27 22:30:17 +00:00
Chris Lattner
216059ff5a We no longer care whether something is an opt vs analysis pass, only whether
something is a pass vs an analysis group now.  Simplify interfaces.

llvm-svn: 29920
2006-08-27 22:21:55 +00:00
Chris Lattner
33bd5dcfb7 s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
llvm-svn: 29911
2006-08-27 12:54:02 +00:00
Chris Lattner
0ad370eeb7 Fix PR885
llvm-svn: 29794
2006-08-21 17:20:01 +00:00
Chris Lattner
58aeae17a7 Add dominates/properlyDominates queries to IDom.
llvm-svn: 29456
2006-08-01 22:24:47 +00:00
Chris Lattner
92a0b69813 Add some advice
llvm-svn: 29324
2006-07-27 04:24:14 +00:00
Reid Spencer
10b9edbb69 For PR780:
1. Move IncludeFile.h to System library
2. Move IncludeFile.cpp to System library
3. #1 and #2 required to prevent cyclic library dependencies for libSystem
4. Convert all existing uses of Support/IncludeFile.h to System/IncludeFile.h
5. Add IncludeFile support to various lib/System classes.
6. Add new lib/System classes to LinkAllVMCore.h
All this in an attempt to pull in lib/System to what's required for VMCore

llvm-svn: 29287
2006-07-26 16:18:00 +00:00
Jim Laskey
7b3f038890 No Need to live in the past.
llvm-svn: 29282
2006-07-26 09:59:01 +00:00
Jim Laskey
d7e656f90b Moving this function to a permanent home to prevent a dependency cycle created
by the inline heuristic.  Was preventing llvm-gcc4 from building.

llvm-svn: 29278
2006-07-25 23:22:00 +00:00
Chris Lattner
d516a3d01a Fix a race condition in the makefile andrew reported
llvm-svn: 29227
2006-07-20 19:08:27 +00:00
Chris Lattner
ee79f01695 Fix PR835 so that touching tblgen in a way that doesn't affect intrinsic
generation does not rebuild files that just use intrinsic info.

llvm-svn: 29217
2006-07-20 16:44:21 +00:00
Jim Laskey
acca26e969 Reduce the size of Constants.o by 25% by generalizing specific instantiations of
std::map.

llvm-svn: 29163
2006-07-17 17:38:29 +00:00
Chris Lattner
e1a75ed7be Add a new helper, simplify ConstantExpr::getWithOperandReplaced at Gabor's
request :)

llvm-svn: 29148
2006-07-14 22:20:01 +00:00