Commit Graph

604 Commits

Author SHA1 Message Date
Reid Spencer
7b06bd532d Replace CastInst::createInferredCast calls with more accurate cast
creation calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32521 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 00:50:17 +00:00
Reid Spencer
d977d8651a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32514 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:36:14 +00:00
Reid Spencer
4da49122f3 Change inferred getCast into specific getCast. Passes all tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32469 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 05:05:00 +00:00
Bill Wendling
f5da13367f What should be the last unnecessary <iostream>s in the library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32333 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 22:21:48 +00:00
Bill Wendling
832171cb97 Removing even more <iostream> includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32320 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 20:04:42 +00:00
Bill Wendling
e81561909d Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:30:32 +00:00
Chris Lattner
ac0b6ae358 Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 17:46:33 +00:00
Chris Lattner
d0a6a7a030 make it clear that this is always a zext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32044 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-30 17:35:08 +00:00
Chris Lattner
6e8fbad675 One more bugfix, 3 cases of making casts explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32043 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-30 17:32:29 +00:00
Chris Lattner
9a989f0f97 Fix a bug in globalopt due to the recent cast patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32042 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-30 17:26:08 +00:00
Reid Spencer
3da59db637 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 01:05:10 +00:00
Bill Wendling
0a81aac4b4 Replace #include <iostream> with llvm_* streams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31924 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-26 10:02:32 +00:00
Chris Lattner
08ff1480ff second patch to fix PR992/993.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31610 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 23:36:08 +00:00
Chris Lattner
a9d709d51a Minimal patch to fix PR992/PR993
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31608 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 23:17:45 +00:00
Reid Spencer
3ed469ccd7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 20:25:50 +00:00
Chris Lattner
25de4e5c21 Fix GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll and McGill/chomp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31352 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-01 18:03:33 +00:00
Reid Spencer
1628cec4d7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-26 06:15:43 +00:00
Chris Lattner
9dcbf0dedc llvm-extract should remove module-level asm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31086 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 21:35:41 +00:00
Reid Spencer
b83eb6447b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 07:07:24 +00:00
Evan Cheng
99435d32b3 Revert previous patch. Still breaking things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30698 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-03 07:26:07 +00:00
Chris Lattner
596721f0d7 Fix debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30680 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-30 23:32:50 +00:00
Chris Lattner
8639503abe Implement SRA of heap allocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30679 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-30 23:32:09 +00:00
Chris Lattner
cff1673182 Add some ifdef'd out debug info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30676 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-30 19:40:30 +00:00
Chris Lattner
47811b76ca Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30665 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:35:22 +00:00
Owen Anderson
3295471846 Another attempt at making ArgPromotion smarter. This patch no longer breaks Burg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30657 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:02:22 +00:00
Chris Lattner
4af90abc13 Implement a trivial optzn: of vastart is never called in a function that takes
... args, remove the '...'.

This is Transforms/DeadArgElim/dead_vaargs.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30459 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-18 07:02:31 +00:00
Chris Lattner
94876527af revert previous two patches. They cause miscompilation of MultiSource/Applications/Burg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30397 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-15 17:24:45 +00:00
Owen Anderson
46f022a7f1 Revert my previous work on ArgumentPromotion. Further investigation has revealed these
changes to be incorrect.  They just weren't showing up in any of our current testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30385 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-15 05:22:51 +00:00
Anton Korobeynikov
b74ed07bfd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30374 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 18:23:27 +00:00
Devang Patel
56eac5f6f7 Initialize DontInternalize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30281 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-13 01:02:26 +00:00
Chris Lattner
7b166d9969 Make inlining costs more accurate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30231 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-09 20:40:44 +00:00
Owen Anderson
b833e5ac3f Make ArgumentPromotion handle recursive functions that pass pointers in their recursive calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30057 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-02 21:19:44 +00:00
Chris Lattner
7f8897f22e eliminate RegisterOpt. It does the same thing as RegisterPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 22:42:52 +00:00
Devang Patel
d828a4b285 Make it fit into 80 cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29223 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-20 18:03:39 +00:00
Devang Patel
753d94a1c8 Add new constructor to accept vector of exported names while creating
InternalizePass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29222 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-20 17:48:05 +00:00
Chris Lattner
d85340f4ec Change the callgraph representation to store the callsite along with the
target CG node.  This allows the inliner to properly update the callgraph
when using the pruning inliner.  The pruning inliner may not copy over all
call sites from a callee to a caller, so the edges corresponding to those
call sites should not be copied over either.

This fixes PR827 and Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29120 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-12 18:29:36 +00:00
Chris Lattner
7cd580f0b7 Fix PR820 and Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29071 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-07 21:37:01 +00:00
Chris Lattner
92044ce4e9 Fix Transforms/DeadArgElim/2006-06-27-struct-ret.ll. -deadargelim should not
remove the struct return argument of a csret function, even if it is obviously
dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28943 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-27 21:05:04 +00:00
Evan Cheng
fb9d0dce97 Add missing casts. This fixed some regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28834 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-16 18:37:15 +00:00
Evan Cheng
21abac2757 More libcall transformations:
printf("%s\n", str) -> puts(str)
printf("%c", c) -> putchar(c)
Also fixed fprintf(file, "%c", c) -> fputc(c, file)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28815 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-16 08:36:35 +00:00
Evan Cheng
952895243e Simplify fprintf(file, "%s", str) to fputs(str, file).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28814 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-16 04:52:30 +00:00
Chris Lattner
2144c25364 Remove some dead variables.
Fix a nasty bug in the memcmp optimizer where we used the wrong variable!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28269 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 23:35:26 +00:00
Andrew Lenharth
61e99c9db8 linear -> constant time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27652 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-13 13:43:31 +00:00
Andrew Lenharth
3433141a3e Add a simple pass to make sure that all (non-library) calls to malloc and free
are visible to analysis as intrinsics.  That is, make sure someone doesn't pass
free around by address in some struct (as happens in say 176.gcc).

This doesn't get rid of any indirect calls, just ensure calls to free and malloc
are always direct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27560 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-10 19:26:09 +00:00
Jim Laskey
4ca9757a39 Strip changes to llvm.dbg intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26993 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-23 18:11:33 +00:00
Chris Lattner
b2f6c0075c Teach the strip pass to strip type names in addition to value names. This
is fallout from the type/value split in the symtab long long ago :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26785 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15 19:22:41 +00:00
Jim Laskey
f4321a3a43 Handle the removal of the debug chain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 13:07:37 +00:00
Chris Lattner
e2b59d2760 fix a pasto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26627 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 06:09:41 +00:00
Jim Laskey
e8c3e3b51c Switch to using a numeric id for anchors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26598 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-07 20:53:47 +00:00
Chris Lattner
e1c173bc77 Fix ConstantMerge/2006-03-07-DontMergeDiffSections.ll, a problem Jim
hypotheticalized about, where we would incorrectly merge two globals in
different sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26597 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-07 17:56:59 +00:00