Brian Gaeke [Mon, 3 May 2004 23:51:50 +0000 (23:51 +0000)]
Add initial implementation of basic block tracing runtime
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13339
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Mon, 3 May 2004 23:49:17 +0000 (23:49 +0000)]
Add basic block tracing functions as exported symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13338
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Mon, 3 May 2004 23:49:16 +0000 (23:49 +0000)]
Add basic block tracing information as a type of "profiling" information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13337
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Mon, 3 May 2004 22:06:33 +0000 (22:06 +0000)]
In InsertProfilingInitCall(), make it legal to pass in a null array, in
which case you'll get a null array and zero passed to the profiling function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13336
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Mon, 3 May 2004 22:06:32 +0000 (22:06 +0000)]
Add initial implementation of basic-block tracing instrumentation pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13335
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 2 May 2004 16:06:40 +0000 (16:06 +0000)]
Initialize member out of paranoia
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13319
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 2 May 2004 16:06:18 +0000 (16:06 +0000)]
Fix a problem with double freeing memory. For some reason, CallGraph is not
acting like a normal pass. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13318
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 2 May 2004 07:31:34 +0000 (07:31 +0000)]
Plug a minor memory leak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13317
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 2 May 2004 05:19:36 +0000 (05:19 +0000)]
Do not clone arbitrary condition instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13316
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 2 May 2004 05:02:03 +0000 (05:02 +0000)]
Do not infinitely "unroll" single BB loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13315
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 2 May 2004 04:19:15 +0000 (04:19 +0000)]
Add some stuff to the release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13314
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Sun, 2 May 2004 01:04:52 +0000 (01:04 +0000)]
Chris told me to take these assertions out a few days ago, but I forgot to
check this in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13313
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 2 May 2004 01:00:44 +0000 (01:00 +0000)]
Dont' merge terminators that are needed to select PHI node values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13312
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 23:35:43 +0000 (23:35 +0000)]
Implement SimplifyCFG/branch-cond-merge.ll
Turning "if (A < B && B < C)" into "if (A < B & B < C)"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13311
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 23:35:21 +0000 (23:35 +0000)]
New testcase:
Turn "if (A < B && B < C)" into "if (A < B & B < C)"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13310
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 23:27:23 +0000 (23:27 +0000)]
Make sure to reprocess instructions used by deleted instructions to avoid
missing opportunities for combination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13309
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 23:19:52 +0000 (23:19 +0000)]
Make sure the instruction combiner doesn't lose track of instructions
when replacing them, missing the opportunity to do simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13308
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 22:41:51 +0000 (22:41 +0000)]
Fix my missing parens
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13307
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 22:36:37 +0000 (22:36 +0000)]
Implement SimplifyCFG/branch-cond-prop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13306
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 22:36:24 +0000 (22:36 +0000)]
New testcase for case that simplifycfg should catch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13305
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 21:29:16 +0000 (21:29 +0000)]
Remove unused #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13304
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 21:27:53 +0000 (21:27 +0000)]
Iterate over the Machine CFG that Brian added instead of the LLVM CFG.
Look at all of the pretty minuses. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13303
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 21:24:39 +0000 (21:24 +0000)]
Operate on the Machine CFG instead of on the LLVM CFG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13302
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 21:24:24 +0000 (21:24 +0000)]
Stop LiveVariables from using BasicBlocks as part of the mapping, instead
use MachineBasicBlocks. To do this, we traverse the Machine CFG instead of
the LLVM CFG, which is also *MUCH* more efficient by having fewer levels of
indirections and mappings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13301
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 21:23:35 +0000 (21:23 +0000)]
Stop LiveVariables from using BasicBlocks as part of the mapping, instead
use MachineBasicBlocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13300
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 21:05:34 +0000 (21:05 +0000)]
Move the GraphTraits for MachineBasicBlocks to the MachineBasicBlock file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13299
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 11:40:07 +0000 (11:40 +0000)]
Add comment about optimizations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13298
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 1 May 2004 11:17:13 +0000 (11:17 +0000)]
Add a constructor that got lost
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13297
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Sat, 1 May 2004 06:42:15 +0000 (06:42 +0000)]
Generalize the strlen size_t hack, for the benefit of the other external
functions with wrappers that either take or return size_ts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13296
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 30 Apr 2004 22:17:12 +0000 (22:17 +0000)]
Fix broken link, again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13295
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Fri, 30 Apr 2004 20:48:37 +0000 (20:48 +0000)]
Sorry, now friend class name should be right!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13294
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Fri, 30 Apr 2004 20:47:59 +0000 (20:47 +0000)]
Fixed friend class name for ModuloScheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13293
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Fri, 30 Apr 2004 20:46:40 +0000 (20:46 +0000)]
Fixed friend class name for ModuloSched
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13292
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Fri, 30 Apr 2004 20:40:38 +0000 (20:40 +0000)]
Removing MachineResource class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13291
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 30 Apr 2004 14:13:16 +0000 (14:13 +0000)]
Fix a broken link
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13290
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 30 Apr 2004 04:37:52 +0000 (04:37 +0000)]
Fix a major pessimization in the instcombiner. If an allocation instruction
is only used by a cast, and the casted type is the same size as the original
allocation, it would eliminate the cast by folding it into the allocation.
Unfortunately, it was placing the new allocation instruction right before
the cast, which could pull (for example) alloca instructions into the body
of a function. This turns statically allocatable allocas into expensive
dynamically allocated allocas, which is bad bad bad.
This fixes the problem by placing the new allocation instruction at the same
place the old one was, duh. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13289
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Thu, 29 Apr 2004 17:43:55 +0000 (17:43 +0000)]
Add machine-CFG graph traits specializations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13288
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 29 Apr 2004 04:05:30 +0000 (04:05 +0000)]
Wrapped code and comments at 80 cols; doxygenified some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13264
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 29 Apr 2004 04:04:47 +0000 (04:04 +0000)]
Reorder #includes as per style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13263
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Wed, 28 Apr 2004 19:36:08 +0000 (19:36 +0000)]
Added `zeroinitializer' keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13253
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Wed, 28 Apr 2004 19:24:28 +0000 (19:24 +0000)]
class AssemblyWriter:
* Make contained ostream pointer, not reference
* Allow setting of that ostream via setStream()
class CachedWriter:
* setStream() in turn calls setStream() on the AssemblyWriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13247
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Wed, 28 Apr 2004 19:22:58 +0000 (19:22 +0000)]
* Make contained ostream not public.
* Remove various print methods that called the Value* method, just have one that
all subclasses of Value will use anyway.
* Remove template for printing constant references
* Add methods to print char* and strings
* setStream now sets the stream on the contained AssemblyWriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13246
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Wed, 28 Apr 2004 18:52:43 +0000 (18:52 +0000)]
Send text and numbers directly to CachedWriter's contained ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13243
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Wed, 28 Apr 2004 15:32:09 +0000 (15:32 +0000)]
Squelch compile-time warning (profile build).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13228
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Wed, 28 Apr 2004 15:31:21 +0000 (15:31 +0000)]
* Add ability to print out type as symbolic
* Add Module accessor to AssemblyWriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13227
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Wed, 28 Apr 2004 15:30:33 +0000 (15:30 +0000)]
* Add ability to get and set the output stream
* New feature: outputting a Type* as symbolic, controlled via the stream
similarly to sending std::hex to change number format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13226
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Wed, 28 Apr 2004 04:46:35 +0000 (04:46 +0000)]
Add pred./succ. list size methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13214
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Wed, 28 Apr 2004 04:45:55 +0000 (04:45 +0000)]
Make RequiresFPRegKill() take a MachineBasicBlock arg.
In InsertFPRegKills(), just check the MachineBasicBlock for successors
instead of its corresponding BasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13213
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Wed, 28 Apr 2004 04:34:16 +0000 (04:34 +0000)]
In InsertFPRegKills(), use the machine-CFG itself rather than the
LLVM CFG when trying to find the successors of BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13212
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Wed, 28 Apr 2004 04:19:37 +0000 (04:19 +0000)]
Update the machine-CFG edges whenever we see a branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13211
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Wed, 28 Apr 2004 04:15:06 +0000 (04:15 +0000)]
Move private methods to end of class decl at Chris's request
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13210
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Wed, 28 Apr 2004 03:59:48 +0000 (03:59 +0000)]
Fix thinkos that Chris caught for me.
Make pred mutators private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13209
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Wed, 28 Apr 2004 02:16:33 +0000 (02:16 +0000)]
Add machine-code CFG support: MachineBasicBlocks may now have their own
predecessors and successors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13208
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Tue, 27 Apr 2004 22:04:03 +0000 (22:04 +0000)]
Integrate the rest of my random sparcv9 scribblings into this file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13204
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 27 Apr 2004 18:24:38 +0000 (18:24 +0000)]
Fix warning building in optimized mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13190
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 27 Apr 2004 18:21:56 +0000 (18:21 +0000)]
Fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13189
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 27 Apr 2004 15:13:33 +0000 (15:13 +0000)]
Changes to fix up the inst_iterator to pass to boost iterator checks. This
patch was graciously contributed by Vladimir Prus.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13185
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Mon, 26 Apr 2004 16:27:53 +0000 (16:27 +0000)]
Because I like being able to instantiate the cfgprinter from external projects,
this header file is born.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13176
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Mon, 26 Apr 2004 16:27:08 +0000 (16:27 +0000)]
Add functions that return instances of these printer passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13175
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Mon, 26 Apr 2004 16:26:21 +0000 (16:26 +0000)]
Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13174
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 26 Apr 2004 14:44:08 +0000 (14:44 +0000)]
If an object is not in the scalar map then it must be a global from another
graph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13173
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 26 Apr 2004 14:01:59 +0000 (14:01 +0000)]
Instcombine X/-1 --> 0-X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13172
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 26 Apr 2004 14:01:47 +0000 (14:01 +0000)]
Add a new testcase for X/-1, fix bug that prevented tests from running right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13171
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Sun, 25 Apr 2004 07:04:49 +0000 (07:04 +0000)]
Fix file header comments and include guards -- many files have been moved or
renamed since they were last spiffed up, or they just never had proper comments
in the first place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13148
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Sun, 25 Apr 2004 06:32:28 +0000 (06:32 +0000)]
Add a getRegisterInfo() accessor just like on the X86 target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13147
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Sun, 25 Apr 2004 06:32:16 +0000 (06:32 +0000)]
Regularize file header comment and include guard.
Include SparcV9RegisterInfo.h.
Add a getRegisterInfo() accessor and SparcV9RegisterInfo instance, just like
on the X86 target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13146
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Sun, 25 Apr 2004 06:32:05 +0000 (06:32 +0000)]
Add MRegisterInfo subclass for the SparcV9 target (containing only stub
functions for now). This automatically turns on the printing of machine
registers using their own real names, instead of goofy things like %mreg(42),
and allows us to migrate code incrementally to the new interface as we see fit.
The register file description it uses is hand-written, so that the register
numbers will match the ones that the SparcV9 target already uses.
Perhaps someday we'll tablegen it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13145
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Sat, 24 Apr 2004 00:10:56 +0000 (00:10 +0000)]
Standardize header comments of top-level Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13143
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Fri, 23 Apr 2004 23:54:34 +0000 (23:54 +0000)]
Aggregating function arguments is now an option. Default is `no', as before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13142
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Fri, 23 Apr 2004 23:54:17 +0000 (23:54 +0000)]
* Allow aggregating extracted function arguments (controlled by flag)
* Commandline option (for now) controls that flag that is passed in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13141
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 21:45:02 +0000 (21:45 +0000)]
Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13136
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 23 Apr 2004 21:29:48 +0000 (21:29 +0000)]
Move the scev expansion code into this pass, where it belongs. There is
still room for cleanup, but at least the code modification is out of the
analysis now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13135
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 23 Apr 2004 21:29:03 +0000 (21:29 +0000)]
Eliminate all of the SCEV Expansion code which is really part of the
IndVars pass, not part of SCEV *analysis*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13134
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 23 Apr 2004 21:28:25 +0000 (21:28 +0000)]
Remove the SCEV::expandCodeFor method, add a new SCEVVisitor class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13133
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 23 Apr 2004 20:36:51 +0000 (20:36 +0000)]
Teach bugpoint to be a little bit smarter and avoid repeating work
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13132
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 18:17:03 +0000 (18:17 +0000)]
Merged this file into the SparcV9 target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13128
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 18:15:48 +0000 (18:15 +0000)]
Merge TargetRegInfo.h into SparcV9RegInfo.h, which is its only subclass.
This prepares us to be able to de-virtualize and de-abstract it, and
take the register allocator bits out and move them into the register allocator
proper...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13127
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 18:15:47 +0000 (18:15 +0000)]
Include SparcV9RegInfo.h instead of TargetRegInfo.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13126
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 18:15:46 +0000 (18:15 +0000)]
Include SparcV9RegInfo.h instead of TargetRegInfo.h. This serves as a bit of
documentation that this module needs to be made independent of the
register file description of the current target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13125
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 18:10:38 +0000 (18:10 +0000)]
Get rid of the old byte-at-a-time emission code used when the Sparc JIT was
being tested on X86, as per Chris's request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13124
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 18:05:28 +0000 (18:05 +0000)]
Go back to the interpreter main loop after performing intrinsic lowering,
because 1) the first instruction might not be a call site, and
2) CS and SF.Caller were not getting set to point to the new call site
anyway (resulting in a crash on e.g. call %llvm.memset).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13122
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 17:38:17 +0000 (17:38 +0000)]
mmap of a zero length file returns null on some platforms, so hack around it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13121
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 17:11:16 +0000 (17:11 +0000)]
Use emitWordAt() to emit forward-branch fixups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13120
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 17:11:15 +0000 (17:11 +0000)]
Emit SPARC machine code a word at a time instead of a byte at a time.
Use emitWordAt() to emit forward-branch fixups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13119
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 17:11:14 +0000 (17:11 +0000)]
Implement emitWordAt() for the JIT emitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13118
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 17:11:13 +0000 (17:11 +0000)]
Implement emitWordAt() for the debug emitter and the file printer emitter. (I
am not so sure about the file printer emitter, but the debug emitter change
should be harmless.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13117
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gaeke [Fri, 23 Apr 2004 17:11:12 +0000 (17:11 +0000)]
Add emitWordAt() - a quick and dirty interface that the machine-dependent
emitters can use to emit "relocations".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13116
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 22 Apr 2004 23:07:39 +0000 (23:07 +0000)]
Add command-line option to select whether to isolate or delete function from
module. Default is `isolate' as before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13113
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 22 Apr 2004 23:00:51 +0000 (23:00 +0000)]
Clarify the logic: the flag is renamed to `deleteFn' to signify it will delete
the function instead of isolating it. This also means the condition is reversed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13112
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 22 Apr 2004 22:52:22 +0000 (22:52 +0000)]
Add a flag to choose between isolating a function or deleting the function from
the Module. The default behavior keeps functionality as before: the chosen
function is the one that remains.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13111
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 22 Apr 2004 22:51:37 +0000 (22:51 +0000)]
Add a boolean flag to delete this function from module, leaving the rest behind.
Useful in manual debugging when bugpoint isn't quite up to snuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13110
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Thu, 22 Apr 2004 20:02:09 +0000 (20:02 +0000)]
Add a space before result for readability on the command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13109
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 22 Apr 2004 15:12:36 +0000 (15:12 +0000)]
Disable a previous patch that was causing indvars to loop infinitely :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13108
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 22 Apr 2004 15:00:36 +0000 (15:00 +0000)]
Add an ugly cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13107
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 22 Apr 2004 14:59:40 +0000 (14:59 +0000)]
Fix an extremely serious thinko I made in revision 1.60 of this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13106
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 22 Apr 2004 14:56:51 +0000 (14:56 +0000)]
Add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13105
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 21 Apr 2004 23:36:08 +0000 (23:36 +0000)]
Implement a todo, rewriting all possible scev expressions inside of the
loop. This eliminates the extra add from the previous case, but it's
not clear that this will be a performance win overall. Tommorows test
results will tell. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13103
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 21 Apr 2004 22:29:37 +0000 (22:29 +0000)]
This code really wants to iterate over the OPERANDS of an instruction, not
over its USES. If it's dead it doesn't have any uses! :)
Thanks to the fabulous and mysterious Bill Wendling for pointing this out. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13102
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 21 Apr 2004 22:22:01 +0000 (22:22 +0000)]
Implement a fixme. The helps loops that have induction variables of different
types in them. Instead of creating an induction variable for all types, it
creates a single induction variable and casts to the other sizes. This generates
this code:
no_exit: ; preds = %entry, %no_exit
%indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=4]
*** %j.0.0 = cast uint %indvar to short ; <short> [#uses=1]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%tmp.7 = getelementptr short* %P, uint %indvar ; <short*> [#uses=1]
store short %j.0.0, short* %tmp.7
%inc.0 = add int %indvar, 1 ; <int> [#uses=2]
%tmp.2 = setlt int %inc.0, %N ; <bool> [#uses=1]
%indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
br bool %tmp.2, label %no_exit, label %loopexit
instead of:
no_exit: ; preds = %entry, %no_exit
%indvar = phi ushort [ %indvar.next, %no_exit ], [ 0, %entry ] ; <ushort> [#uses=2]
*** %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=3]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%indvar = cast ushort %indvar to short ; <short> [#uses=1]
%tmp.7 = getelementptr short* %P, uint %indvar ; <short*> [#uses=1]
store short %indvar, short* %tmp.7
%inc.0 = add int %indvar, 1 ; <int> [#uses=2]
%tmp.2 = setlt int %inc.0, %N ; <bool> [#uses=1]
%indvar.next = add uint %indvar, 1
*** %indvar.next = add ushort %indvar, 1
br bool %tmp.2, label %no_exit, label %loopexit
This is an improvement in register pressure, but probably doesn't happen that
often.
The more important fix will be to get rid of the redundant add.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13101
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 21 Apr 2004 20:44:33 +0000 (20:44 +0000)]
Fix an incredibly nasty iterator invalidation problem. I am too spoiled by ilists :)
Eventually it would be nice if CallGraph maintained an ilist of CallGraphNode's instead
of a vector of pointers to them, but today is not that day.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13100
91177308-0d34-0410-b5e6-
96231b3b80d8