Chris Lattner
9408b1e8b9
The PhiNodes 2D vector is only used during PHI node placement. It doesn't
...
need to be an instance variable!
llvm-svn: 8860
2003-10-05 03:26:25 +00:00
Chris Lattner
417bc173ee
* Document instance vars better
...
* Fuse two parallel loops
* Use a more specific type for AllocaLookup
llvm-svn: 8859
2003-10-05 03:16:07 +00:00
Chris Lattner
c360f135be
Two small cleanups/speedups:
...
* Do not insert a new entry into NewPhiNodes during the rename pass if there are no PHIs in a block.
* Do not compute WriteSets in parallel
llvm-svn: 8858
2003-10-05 02:37:36 +00:00
Chris Lattner
c3d57b5923
* Minor cleanups
...
* Eliminate the KillList instance variable, instead, just delete loads and
stores as they are "renamed", and delete allocas when they are done
* Make the 'visited' set an instance variable to avoid passing it on the stack.
llvm-svn: 8857
2003-10-05 01:52:53 +00:00
Chris Lattner
b9cde76e60
Implement InstCombine/add.ll:test17 & 18
...
llvm-svn: 8817
2003-10-02 15:11:26 +00:00
Chris Lattner
e317856e0e
Use global *_iterator
...
llvm-svn: 8703
2003-09-24 22:07:33 +00:00
Chris Lattner
a940095ae2
Do not use BasicBlock::*_iterator, just use *_iterator itself.
...
Isn't updating copy and pasted code a joy
llvm-svn: 8702
2003-09-24 22:06:25 +00:00
Chris Lattner
295b907cee
Fix bug: IndVarsSimplify/2003-09-23-NotAtTop.ll
...
llvm-svn: 8689
2003-09-23 20:26:48 +00:00
Chris Lattner
50ac360a34
Fix bugs in the last change
...
llvm-svn: 8667
2003-09-22 23:30:59 +00:00
Chris Lattner
d6002b8e15
Fix bug: Inline/2003-09-22-PHINodesInNormalInvokeDest.ll
...
llvm-svn: 8666
2003-09-22 22:35:39 +00:00
Chris Lattner
0178d262e6
Fix bug: Inline/2003-09-22-PHINodesInExceptionDest.ll
...
... by making sure to update PHI nodes to take into consideration the
extra edges we get if we inline a call instruction through an invoke.
llvm-svn: 8664
2003-09-22 21:59:27 +00:00
Misha Brukman
e051f86a3d
Credits now go into the top-level CREDITS.TXT
...
llvm-svn: 8662
2003-09-22 21:57:56 +00:00
Misha Brukman
4ce9dae5b1
Credits are now in top-level CREDITS.TXT
...
llvm-svn: 8661
2003-09-22 21:57:15 +00:00
Chris Lattner
2caaaba3e9
Squelch warning
...
llvm-svn: 8659
2003-09-22 20:33:34 +00:00
Chris Lattner
c8dfbbbf25
Global variables with APPENDING linkage are very important to keep around!
...
llvm-svn: 8632
2003-09-20 19:00:50 +00:00
Chris Lattner
5dac64f629
Rename Function::getEntryNode -> getEntryBlock
...
llvm-svn: 8625
2003-09-20 14:39:18 +00:00
Chris Lattner
4413e4362c
Minor cleanups, no functional changes
...
Rename Function::getEntryNode -> getEntryBlock
llvm-svn: 8623
2003-09-20 14:36:23 +00:00
Chris Lattner
b6ac976247
Fix a really obvious huge gaping bug, add a comment
...
llvm-svn: 8620
2003-09-20 05:24:00 +00:00
Chris Lattner
0016085602
Expose the TCE pass
...
llvm-svn: 8619
2003-09-20 05:14:13 +00:00
Chris Lattner
2e9014cb1b
New transformation: tail recursion elimination
...
llvm-svn: 8618
2003-09-20 05:03:31 +00:00
Chris Lattner
2da29177ba
Implement InstCombine/and.ll:test(15|16)
...
llvm-svn: 8607
2003-09-19 19:05:02 +00:00
Chris Lattner
ba1cb38c06
pull a large nested conditional out into its own function
...
llvm-svn: 8605
2003-09-19 17:17:26 +00:00
Chris Lattner
dbba189f15
Implement InstCombine/add.ll:test(15|16)
...
llvm-svn: 8604
2003-09-19 15:35:42 +00:00
Chris Lattner
39f398b50d
Fix bug raising allocations whose call sites were invoke instructions.
...
Thanks to brg for tracking down the problem so precisely!
llvm-svn: 8568
2003-09-16 19:42:21 +00:00
Chris Lattner
ec6d7a6df3
This is effectively a complete rewrite of the globaldce algorithm, resulting
...
in it being both shorter and more effective. It no longer depends on the
callgraph, so one FIXME has been fixed.
Additionally, this pass was not able to delete recursive (but dead) functions
if they were pointed to by global variables which were also dead. In fact
this pass had a lot of problems deleting functions which were only pointed
to by dead globals and other stuff.
Fixing this means that the entire EH library should be stripped away now from
programs that don't use sjlj or exceptions.
llvm-svn: 8567
2003-09-16 19:27:31 +00:00
Chris Lattner
40b6621b50
Minor cleanups, give credit, remove code that should not be necessary, and
...
was a "major hack" :)
llvm-svn: 8524
2003-09-15 05:43:05 +00:00
Chris Lattner
6f99eb56c3
Initial checkin of the Setjmp/Longjmp lowering/transformation pass,
...
contributed by the masterful Bill Wendling!
llvm-svn: 8520
2003-09-15 04:56:27 +00:00
Chris Lattner
da3585335b
Ugh, a bug fix needed because of the bug in the CallGraph code
...
llvm-svn: 8519
2003-09-15 04:52:00 +00:00
Chris Lattner
5a6fa29eb3
Fix bug: PruneEH/2003-09-14-ExternalCall.llx
...
llvm-svn: 8516
2003-09-15 02:22:50 +00:00
Chris Lattner
7f89ea75e1
Fix bug: Inline/2003-09-14-InlineValue.ll
...
llvm-svn: 8514
2003-09-15 02:10:16 +00:00
Chris Lattner
099ec07a95
Make sure to cannonicalize loops before running indvar simplify
...
llvm-svn: 8502
2003-09-12 16:45:01 +00:00
Chris Lattner
7fdde92b1f
Do not return success after checking only the FIRST USE of a gep instruction.
...
Instead, check all uses.
This fixes bug: ScalarRepl/2003-09-12-IncorrectPromote.ll
This also fixes the miscompilation of Ptrdist/bc
llvm-svn: 8493
2003-09-12 16:02:12 +00:00
Chris Lattner
9a95f2a944
Minor optimization efficiency improvement:
...
- Run mem2reg promotion first
- Only rerun passes if the previous thing changed something
llvm-svn: 8490
2003-09-12 15:36:03 +00:00
Chris Lattner
cce81be1e1
Simplify code
...
Implement InstCombine/mul.ll:test9
llvm-svn: 8488
2003-09-11 22:24:54 +00:00
Misha Brukman
217ca0bcb9
Apostrophes are only used for possession and quoting.
...
llvm-svn: 8473
2003-09-11 16:58:31 +00:00
Chris Lattner
5d8a12e094
Integrate functionality of the mem2reg pass directly into this pass to make
...
the combination more effective
llvm-svn: 8471
2003-09-11 16:45:55 +00:00
Chris Lattner
bb9d03b9c0
Renamed DominatorTree::Node::getNode() -> getBlock()
...
llvm-svn: 8469
2003-09-11 16:26:13 +00:00
Misha Brukman
9b8d339f6e
Spell `definite' correctly.
...
llvm-svn: 8467
2003-09-11 15:32:37 +00:00
Misha Brukman
250f976eb3
Spell `definitely' correctly.
...
llvm-svn: 8466
2003-09-11 15:31:17 +00:00
Chris Lattner
2158052ac4
Unwind instructions are intrinsically alive, just like returns
...
llvm-svn: 8462
2003-09-10 20:38:14 +00:00
Chris Lattner
10a032abf1
Update for new UnifyFunction... API
...
Remove using decl
llvm-svn: 8458
2003-09-10 20:35:33 +00:00
Chris Lattner
3b30e93e27
Remove #include
...
llvm-svn: 8457
2003-09-10 20:35:21 +00:00
Chris Lattner
f941396cce
Expand the pass to unify all of the unwind blocks as well
...
llvm-svn: 8456
2003-09-10 20:34:51 +00:00
Chris Lattner
216c7b8aed
Fix spell-o's
...
llvm-svn: 8431
2003-09-10 05:29:43 +00:00
Chris Lattner
4e621cd861
Spelling fixes. I think that "cannonical" is ok, but "canonical" appears to
...
be the canonical form for the word
llvm-svn: 8430
2003-09-10 05:24:46 +00:00
Chris Lattner
36257f049e
Fix up file header
...
llvm-svn: 8428
2003-09-10 05:10:34 +00:00
Misha Brukman
4ace48e0ca
Spell `occurrence' correctly.
...
llvm-svn: 8425
2003-09-09 21:54:45 +00:00
Chris Lattner
04ecefe232
Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead
...
llvm-svn: 8411
2003-09-08 19:44:26 +00:00
Chris Lattner
caa12cfa75
Should invokify is always true
...
llvm-svn: 8409
2003-09-08 19:00:30 +00:00
Chris Lattner
9c58cf6d03
Add support for the unwind instruction
...
llvm-svn: 8408
2003-09-08 18:54:55 +00:00
Chris Lattner
01a8391236
Do not hoist volatile loads
...
llvm-svn: 8399
2003-09-08 18:17:14 +00:00
Brian Gaeke
6181cac0dc
Correct comments
...
Don't include InstLoops.h
Don't export factory functions for these passes
llvm-svn: 8373
2003-09-05 19:43:19 +00:00
Chris Lattner
f1f7f2c477
Prototype for creator function got moved
...
llvm-svn: 8315
2003-09-01 20:45:33 +00:00
Chris Lattner
ffc2d16f21
Final cleanup: remove dead code
...
llvm-svn: 8291
2003-09-01 18:01:36 +00:00
Chris Lattner
267f20475b
Not only is this a lot smaller, it actually works if there is already a
...
function with the right name in the module.
llvm-svn: 8290
2003-09-01 16:53:46 +00:00
Chris Lattner
5b8addab9b
Dead files
...
llvm-svn: 8289
2003-09-01 16:49:57 +00:00
Chris Lattner
d4a1af7d49
If "These should be used only by the auto-parallelization pass", we might as
...
well put them INTO the auto-par pass.
llvm-svn: 8288
2003-09-01 16:49:38 +00:00
Chris Lattner
685dc1ea98
Moved all of the cilkifier stuff into lib/Transforms/IPO, as it really is not
...
support stuff.
llvm-svn: 8287
2003-09-01 16:45:30 +00:00
Chris Lattner
6c6ba71cea
Minor cleanups
...
Do not #include Parallelize.h, it's just a subset of Cilkifier.h
llvm-svn: 8285
2003-09-01 16:42:16 +00:00
Chris Lattner
8ef1b88aef
Change the RaiseAllocations pass to be a Pass instead of a BasicBlock pass.
...
This makes it more efficient: it doesn't have to scan the whole program, so
it performs work proportional to the number of malloc/free calls in the
program, not the size of the program.
llvm-svn: 8280
2003-09-01 03:14:56 +00:00
Chris Lattner
1c884e18e1
Fix bug: TailDuplicate/2003-08-31-UnreachableBlocks.ll
...
llvm-svn: 8276
2003-08-31 21:17:44 +00:00
Chris Lattner
d075cc282b
Heavily refactor code:
...
* Separate the policy decisions into a derived class [InlineSimple]
* Move the inlining mechanics into a base class [Inliner]
* Change the inliner to be an SCCPass, making it more structured and
eventually pipelinable with other SCC passes
llvm-svn: 8257
2003-08-31 19:10:30 +00:00
Chris Lattner
75444c751f
Add accessor function
...
llvm-svn: 8253
2003-08-31 16:30:07 +00:00
Chris Lattner
0a3f8d5dcd
Initial checkin of the -prune-eh pass, a very simple exception handling removal pass
...
llvm-svn: 8250
2003-08-31 02:47:32 +00:00
Chris Lattner
c817458b66
ScalarRepl does not modify the CFG. Say so!
...
llvm-svn: 8243
2003-08-31 00:45:13 +00:00
Chris Lattner
2887328770
Use new interface, simplifies code
...
llvm-svn: 8242
2003-08-31 00:22:27 +00:00
Chris Lattner
25bc3f86de
Use the new interface, simplifies code
...
NOTE that these two files are _BUGGY_ and need to be fixed, just not by me :)
llvm-svn: 8241
2003-08-31 00:21:59 +00:00
Chris Lattner
ea27751e4b
Use the new interface, simplifies code
...
Delete a bunch of commented out code
llvm-svn: 8240
2003-08-31 00:21:05 +00:00
Chris Lattner
8e6ac1bf10
Use the new interface, simplifies code
...
llvm-svn: 8239
2003-08-31 00:20:36 +00:00
Chris Lattner
66cc0141b0
Fix bug where we considered function types equivalent even if they had differing numbers of arguments
...
llvm-svn: 8178
2003-08-28 16:42:50 +00:00
Chris Lattner
df741d62de
Fix bug: SCCP/2003-08-26-InvokeHandling.ll
...
llvm-svn: 8152
2003-08-27 01:08:35 +00:00
Chris Lattner
be8d6816d0
Remove special casing
...
llvm-svn: 8144
2003-08-25 22:34:15 +00:00
Chris Lattner
4f05103ad2
Fix bug: Linker/2003-08-23-GlobalVarLinking.ll
...
llvm-svn: 8130
2003-08-24 19:30:20 +00:00
Chris Lattner
3ba0f88a0a
Implement: Linker/2003-08-24-InheritPtrSize.ll
...
llvm-svn: 8129
2003-08-24 19:26:42 +00:00
Chris Lattner
3f5823f131
Implement SimplifyCFG/InvokeEliminate.ll
...
llvm-svn: 8126
2003-08-24 18:36:16 +00:00
Chris Lattner
0f98032fd8
rethrow is really the language independent primitive here. "throw" can be written
...
in terms of it and llvm.exc.setcurrent.
Rework the intrinsics.
llvm-svn: 8111
2003-08-24 12:24:11 +00:00
Chris Lattner
d367d0553e
Inline invoke instructions as well as call instructions
...
llvm-svn: 8107
2003-08-24 06:59:28 +00:00
Chris Lattner
0cc265e6bf
*** Implement inlining of Invoke instructions!
...
llvm-svn: 8106
2003-08-24 06:59:16 +00:00
Chris Lattner
9c5bfd0f80
Big diff for a small change: delete inlined functions if all callees have
...
inlined the function.
Implements: Inline/inline_dce.ll
llvm-svn: 8101
2003-08-24 05:03:14 +00:00
Chris Lattner
fc3fe5cd75
Implement: Inline/cfg_preserve_test.ll
...
llvm-svn: 8099
2003-08-24 04:06:56 +00:00
Chris Lattner
c54d608377
Implement SimplifyCFG/2003-08-17-FoldSwitch.ll:test5
...
llvm-svn: 8093
2003-08-23 23:18:19 +00:00
Chris Lattner
f1b1c5ec2f
Fix bug: LowerSwitch/2003-08-23-EmptySwitch.ll
...
llvm-svn: 8087
2003-08-23 22:54:34 +00:00
Chris Lattner
02da0ef418
Do not consider any types that exist in the global symbol table!
...
llvm-svn: 8084
2003-08-23 21:32:24 +00:00
Chris Lattner
f38c0483ba
Fix bug: Linker/2003-08-23-RecursiveOpaqueTypeResolve.ll
...
llvm-svn: 8083
2003-08-23 21:25:54 +00:00
Chris Lattner
31de50ab44
Implement Linker/2003-08-23-GlobalVarLinking.ll, which should fix 176.gcc
...
llvm-svn: 8080
2003-08-23 20:31:10 +00:00
Chris Lattner
bb4dd7ed34
Fix bug: TailDup/2003-08-23-InvalidatedPointers.ll
...
llvm-svn: 8078
2003-08-23 20:08:30 +00:00
Chris Lattner
6fc0ee9901
Fix bug: FunctionResolve/2003-08-23-ArgumentWarning.ll
...
llvm-svn: 8076
2003-08-23 20:03:05 +00:00
Chris Lattner
954a6095d7
Fix typeo
...
llvm-svn: 8059
2003-08-22 20:16:48 +00:00
Chris Lattner
1a8a45977a
The process of linking types can cause their addresses to become invalid. For this reason, we must use TypeHandles!
...
llvm-svn: 8057
2003-08-22 19:12:55 +00:00
Chris Lattner
f872d41f55
Implement Linker/2003-08-20-OpaqueTypeResolve.ll
...
Hopefully this will fix the 176.gcc spec test as well.
llvm-svn: 8051
2003-08-22 06:07:12 +00:00
Misha Brukman
be372b91e1
The word `dependent' has no `a'.
...
llvm-svn: 8030
2003-08-21 22:14:26 +00:00
Chris Lattner
015d98e940
Unless we CANNOT merge the arguments, do so
...
llvm-svn: 7999
2003-08-20 23:50:38 +00:00
Chris Lattner
a34c477b05
Fix grammar, add comment
...
llvm-svn: 7967
2003-08-18 22:54:06 +00:00
Misha Brukman
7eb05a170a
Spell `necessary' correctly.
...
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Chris Lattner
821deeeffa
Implement folding of switch instructions.
...
Implements SimplifyCFG/2003-08-17-FoldSwitch.ll
llvm-svn: 7923
2003-08-17 20:21:14 +00:00
Chris Lattner
031340a551
Fix bug: SimplifyCFG/2003-08-17-BranchFoldOrdering.ll
...
llvm-svn: 7921
2003-08-17 19:41:53 +00:00
Chris Lattner
4b7e3364c7
The fixme is irrelevant: if that happens, the LLVM bytecode is malformed.
...
This fixes testcase: SimplifyCFG/2003-08-17-BranchFold.ll
llvm-svn: 7919
2003-08-17 19:34:55 +00:00
Brian Gaeke
8c14ba96ca
Factory methods for function passes now return type FunctionPass *.
...
llvm-svn: 7839
2003-08-14 06:09:32 +00:00
Chris Lattner
cbf0839a03
Fix FIXME by removing FIXME
...
llvm-svn: 7832
2003-08-13 22:15:04 +00:00
Chris Lattner
3ac7c26a1c
Implement instcombine optimizations:
...
(A <setcc1> B) logicalop (A <setcc2> B) -> (A <setcc3> B) or true or false
Where setcc[123] is one of the 6 setcc instructions, and logicalop is one of: And, Or, Xor
llvm-svn: 7828
2003-08-13 20:16:26 +00:00
Chris Lattner
b8b97505ba
Generalize some of the add tests to allow for reassociation to take place
...
llvm-svn: 7825
2003-08-13 19:01:45 +00:00
Brian Gaeke
89207943a1
Factory methods for FunctionPasses now return type FunctionPass *.
...
llvm-svn: 7823
2003-08-13 18:18:15 +00:00
Chris Lattner
8ac196dd3b
Assign arguments different ranks so they get grouped together
...
llvm-svn: 7813
2003-08-13 16:16:26 +00:00
John Criswell
35364c8408
Removing the pool allocator from the main CVS tree.
...
Use the poolalloc module in CVS from now on.
llvm-svn: 7810
2003-08-13 15:36:15 +00:00
Chris Lattner
d07283a2ad
Implement InstCombine/2003-08-12-AllocaNonNull.ll
...
llvm-svn: 7807
2003-08-13 05:38:46 +00:00
Chris Lattner
c992add9fe
Do not cannonicalize (X != 0) into (cast X to bool)
...
llvm-svn: 7806
2003-08-13 05:33:12 +00:00
Chris Lattner
ede3fe05c5
Change cannonicalization rules: add X,X is represented as multiplies, multiplies
...
of a power of two are represented as a shift.
llvm-svn: 7803
2003-08-13 04:18:28 +00:00
Brian Gaeke
709a16a0bc
Give std::map<BasicBlock *, BasicBlock *> the short name BBMap, because
...
it's used 7 different times.
Rename `getBackEdges' to `findAndInstrumentBackEdges', for clarity.
Remove some excess whitespace and commented-out code.
Use shorter forms of CallInst ctors.
Do not make `reopt_threshold' visible to the LLVM program, and do not
pass it to the call to `reoptimizerInitialize'. Don't pass the
GlobalVariable representing it to any of our helper methods.
`reopt_threshold' is an internal parameter of the reoptimizer, which
InstLoops does not need to know about.
llvm-svn: 7794
2003-08-12 22:00:24 +00:00
Chris Lattner
deaa0dd71a
Allow pulling logical operations through shifts.
...
This implements InstCombine/shift.ll:test14*
llvm-svn: 7793
2003-08-12 21:53:41 +00:00
Chris Lattner
98b3ecddec
Fix bug: Reassociate/2003-08-12-InfiniteLoop.ll
...
llvm-svn: 7792
2003-08-12 21:45:24 +00:00
Chris Lattner
58c7eb60ec
Assign finer grained ranks, make sure to reassociate top-level after reassociating bottom level
...
llvm-svn: 7787
2003-08-12 20:14:27 +00:00
Chris Lattner
01d5639515
Simplify code
...
llvm-svn: 7783
2003-08-12 19:17:27 +00:00
Chris Lattner
812aab7727
Implement testcases InstCombine/or.ll:test16/test17
...
llvm-svn: 7782
2003-08-12 19:11:07 +00:00
Sumant Kowshik
46d9b22e90
Bug fix: Some nodes pointed to by globals may not be marked incomplete and need to be tracked to find pool arguments
...
llvm-svn: 7763
2003-08-12 00:45:13 +00:00
Chris Lattner
603e0076c0
Fix handling of 'free' if it has absolutely no prototype
...
llvm-svn: 7721
2003-08-11 15:05:08 +00:00
John Criswell
449670a8f7
Fixed a segfault in gccld.
...
The original code does not work because the value from WorkList.end() is
invalidated once WorkList.erase() is called. To ensure proper functionality,
we must ensure that WorkList.erase() is always called before WorkList.end().
llvm-svn: 7673
2003-08-07 14:43:13 +00:00
Sumant Kowshik
0b83080595
Added code for pool allocating only the pool-allocatable data structures in the presence of collapsed nodes + a couple of bug fixes
...
llvm-svn: 7662
2003-08-07 05:29:28 +00:00
Chris Lattner
c592c9f8a3
Remove unnecessary use of NonCopyable
...
llvm-svn: 7641
2003-08-06 17:16:24 +00:00
Tanya Lattner
dc3c9a8545
Fixed minor bug in SafeToHoist and made some changes suggested by Chris.
...
llvm-svn: 7614
2003-08-05 20:39:02 +00:00
Tanya Lattner
57c03df032
Fixed LICM bug that hoists trapping instructions that are not guaranteed to execute.
...
llvm-svn: 7612
2003-08-05 18:45:46 +00:00
Chris Lattner
adc5a89a3b
Minor changes:
...
* Expand most tabs into spaces
* Move #define DEBUG_TYPE to top of file to avoid warning
llvm-svn: 7611
2003-08-05 18:44:12 +00:00
Sumant Kowshik
0383a65103
Major bug fixes including a memory leak and tracking some exceptional conditions. Also added support for including global and indirect call information in the DS graphs used by the pool allocation
...
llvm-svn: 7605
2003-08-05 17:01:54 +00:00
Chris Lattner
edc8c54e16
Fix bug: SimplifyCFG/2003-08-05-InvokeCrash.ll
...
Fix bug: SimplifyCFG/2003-08-05-MishandleInvoke.ll
llvm-svn: 7599
2003-08-05 16:27:44 +00:00
Chris Lattner
8abcd56c74
DEBUG got moved to Support/Debug.h
...
llvm-svn: 7492
2003-08-01 22:15:03 +00:00
Chris Lattner
ab780dfab5
Instcombine: (A >> c1) << c2 for signed integers
...
llvm-svn: 7295
2003-07-24 18:38:56 +00:00
Chris Lattner
3204d4ed4e
Reorganization of code, no functional changes.
...
Now it shoudl be a bit more efficient
llvm-svn: 7292
2003-07-24 17:52:58 +00:00
Chris Lattner
dfae8be3c9
Allow folding several instructions into casts, which can simplify a lot
...
of codes. For example,
short kernel (short t1) {
t1 >>= 8; t1 <<= 8;
return t1;
}
became:
short %kernel(short %t1.1) {
%tmp.3 = shr short %t1.1, ubyte 8 ; <short> [#uses=1]
%tmp.5 = cast short %tmp.3 to int ; <int> [#uses=1]
%tmp.7 = shl int %tmp.5, ubyte 8 ; <int> [#uses=1]
%tmp.8 = cast int %tmp.7 to short ; <short> [#uses=1]
ret short %tmp.8
}
before, now it becomes:
short %kernel(short %t1.1) {
%tmp.3 = shr short %t1.1, ubyte 8 ; <short> [#uses=1]
%tmp.8 = shl short %tmp.3, ubyte 8 ; <short> [#uses=1]
ret short %tmp.8
}
which will become:
short %kernel(short %t1.1) {
%tmp.3 = and short %t1.1, 0xFF00
ret short %tmp.3
}
This implements cast-set.ll:test4 and test5
llvm-svn: 7290
2003-07-24 17:35:25 +00:00
Chris Lattner
727c03a665
Minor cleanups
...
llvm-svn: 7289
2003-07-24 17:31:56 +00:00
Chris Lattner
e9340228c9
Fix bug: FunctionResolve/2003-07-23-CPR-Reference.ll
...
This fixes a long time annoyance which caused prototypes for bzero, bcopy,
bcmp, fputs, and fputs_unlocked to never get deleted. Grr.
llvm-svn: 7285
2003-07-23 22:03:18 +00:00
Chris Lattner
bfb1d03159
Add comments
...
llvm-svn: 7283
2003-07-23 21:41:57 +00:00
Chris Lattner
9763859e8d
Remove explicit check for: not (not X) = X, it is already handled because xor is commutative
...
- InstCombine: (X & C1) ^ C2 --> (X & C1) | C2 iff (C1&C2) == 0
- InstCombine: (X | C1) ^ C2 --> (X | C1) & ~C2 iff (C1&C2) == C2
llvm-svn: 7282
2003-07-23 21:37:07 +00:00
Chris Lattner
33217db4d9
InstCombine: (X ^ C1) & C2 --> (X & C2) iff (C1&C2) == 0
...
llvm-svn: 7272
2003-07-23 19:36:21 +00:00
Chris Lattner
16464b36ff
- InstCombine: (X | C1) & C2 --> X & C2 iff C1 & C1 == 0
...
- InstCombine: (X | C) & C --> C
- InstCombine: (X | C1) & C2 --> (X | (C1&C2)) & C2
llvm-svn: 7269
2003-07-23 19:25:52 +00:00
Chris Lattner
8f0d15601a
IC: (X & C1) | C2 --> (X | C2) & (C1|C2)
...
IC: (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2)
We are now guaranteed that all 'or's will be inside of 'and's, and all 'and's
will be inside of 'xor's, if the second operands are constants.
llvm-svn: 7264
2003-07-23 18:29:44 +00:00
Chris Lattner
49b47ae565
IC: (X ^ C1) & C2 --> (X & C2) ^ (C1&C2)
...
Minor code cleanup
llvm-svn: 7262
2003-07-23 17:57:01 +00:00
Chris Lattner
cfbce7c880
InstCombine: (X ^ 4) == 8 --> X == 12
...
llvm-svn: 7260
2003-07-23 17:26:36 +00:00
Chris Lattner
d492a0b7b4
IC: (X & 5) == 13 --> false
...
IC: (X | 8) == 4 --> false
llvm-svn: 7257
2003-07-23 17:02:11 +00:00
Chris Lattner
6077c3195f
Simplify code by using ConstantInt::getRawValue instead of checking to see
...
whether the constant is signed or unsigned, then casting
llvm-svn: 7252
2003-07-23 15:22:26 +00:00
Chris Lattner
d78ebd0c6b
Fix bug: TailDup/2003-07-22-InfiniteLoop.ll
...
llvm-svn: 7243
2003-07-23 03:32:41 +00:00
Chris Lattner
bdb0ce0605
- InstCombine (cast (xor A, B) to bool) ==> (setne A, B)
...
- InstCombine (cast (and X, (1 << size(X)-1)) to bool) ==> x < 0
llvm-svn: 7241
2003-07-22 21:46:59 +00:00
John Criswell
d6dcbc6ce8
Added code that checks to see if a global variable is external before replacing
...
a load of the global variable with the variable's constant value.
llvm-svn: 7216
2003-07-21 19:42:57 +00:00
Anand Shukla
1db75a0f7c
Added check for inlinable function
...
llvm-svn: 7206
2003-07-18 20:55:26 +00:00
Anand Shukla
89233e1c9a
A pass to combine multiple backedges that go to same target
...
llvm-svn: 7201
2003-07-18 16:08:32 +00:00
John Criswell
0643ceafcf
Dinakar and I fixed a bug where we were trying to get the initializer of
...
an external constant. Since external constants don't have initializers, we
were failing on an assert() call in llvm/GlobalVariable.h.
llvm-svn: 7193
2003-07-17 19:06:55 +00:00
Vikram S. Adve
ac83df769b
Trace loads and stores as they happen (stores were being
...
remembered in valuesStoredInFunction, but never traced at function return,
and that's too late to be finding the error anyway).
Stores trace both the value and the address being stored to,
but after some experience I think only values should be traced.
The pointer hash table just fills up far too quickly if every
store address were traced.
llvm-svn: 7169
2003-07-11 21:57:43 +00:00
Anand Shukla
b3d794a2c9
Added functionality to instrmentation pass
...
llvm-svn: 7161
2003-07-10 21:55:57 +00:00
John Criswell
3ef61afb76
Merged in autoconf branch. This provides configuration via the autoconf
...
system.
llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner
6e69c28229
Eliminate using declarations, adjust for new DSGraph API
...
llvm-svn: 6992
2003-06-30 03:14:44 +00:00
Chris Lattner
fbfcf01b98
Allow the inlining limit to be controlled from the command line!
...
llvm-svn: 6929
2003-06-28 15:57:04 +00:00
Chris Lattner
eaae578820
Add support to globaldce for deleting dead function prototypes
...
llvm-svn: 6918
2003-06-26 05:41:18 +00:00