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

912 Commits

Author SHA1 Message Date
Chris Lattner
1b70ed5140 rewrite RecursivelyDeleteTriviallyDeadInstructions to use a more efficient
formulation that doesn't require set lookups or scanning a set.

llvm-svn: 60203
2008-11-28 01:20:46 +00:00
Chris Lattner
b9af105cff remove some weirdness that came from the LSR code that has
nothing to do with dead instruction elimination.  No tests in
dejagnu depend on this, so I don't know what it was needed for.

llvm-svn: 60202
2008-11-28 00:58:15 +00:00
Chris Lattner
4486266c9d delete ErasePossiblyDeadInstructionTree, replacing uses of it with
RecursivelyDeleteTriviallyDeadInstructions.

llvm-svn: 60196
2008-11-27 23:25:44 +00:00
Chris Lattner
53ebef9cbb enhance RecursivelyDeleteTriviallyDeadInstructions to make
PHIs dead if they are single-value.

llvm-svn: 60194
2008-11-27 23:18:11 +00:00
Chris Lattner
8b382de4e0 Enhance RecursivelyDeleteTriviallyDeadInstructions to optionally
return a list of deleted instructions.

llvm-svn: 60193
2008-11-27 23:14:34 +00:00
Chris Lattner
b374a0158a remove doConstantPropagation and dceInstruction, they are just
wrappers around the interesting code and use an obscure iterator
abstraction that dates back many many years.

Move EraseDeadInstructions to Transforms/Utils and name it
RecursivelyDeleteTriviallyDeadInstructions.

llvm-svn: 60191
2008-11-27 22:57:53 +00:00
Chris Lattner
2959f6224e switch InstCombine::visitLoadInst to use
FindAvailableLoadedValue

llvm-svn: 60169
2008-11-27 08:56:30 +00:00
Chris Lattner
0bd942ecb5 enhance FindAvailableLoadedValue to make use of AliasAnalysis
if it has it.

llvm-svn: 60167
2008-11-27 08:18:12 +00:00
Chris Lattner
577096bcaa move FindAvailableLoadedValue from JumpThreading to Transforms/Utils.
llvm-svn: 60166
2008-11-27 08:10:05 +00:00
Chris Lattner
cab07ddaeb simplify this code a bit.
llvm-svn: 60164
2008-11-27 07:54:38 +00:00
Chris Lattner
bb86dff3fe move MergeBasicBlockIntoOnlyPred to Transforms/Utils.
llvm-svn: 60162
2008-11-27 07:43:12 +00:00
Chris Lattner
08bdf9dfab reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count.

llvm-svn: 59823
2008-11-21 16:42:48 +00:00
Bill Wendling
4c5afef830 Revert r59802. It was breaking the build of llvm-gcc:
g++ -m32 -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wmissing-format-attribute -fno-common -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"i386-apple-darwin9.5.0\" -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include  -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS   -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include ../../llvm-gcc.src/gcc/llvm-types.cpp -o llvm-types.o
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemCpy(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemMove(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemSet(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i64' is not a member of 'llvm::Intrinsic'
make[3]: *** [llvm-convert.o] Error 1
make[3]: *** Waiting for unfinished jobs....
rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

llvm-svn: 59809
2008-11-21 09:09:41 +00:00
Sanjiv Gupta
89a7e67578 Make mem[cpy,move,set] intrinsics overloaded.
llvm-svn: 59802
2008-11-21 07:49:09 +00:00
Devang Patel
0c43c5a17f Don't forget arguments!
llvm-svn: 59745
2008-11-20 19:50:17 +00:00
Oscar Fuentes
212b29b9d9 CMake: Removed source file.
llvm-svn: 59662
2008-11-19 19:32:19 +00:00
Devang Patel
e5a07d989e Do not use separate utility to walk all instructions and remove dead dbg intrinsics. Let instcombiner do this job.
llvm-svn: 59659
2008-11-19 19:01:37 +00:00
Devang Patel
d8981479c2 Initialize MallocFunc and FreeFunc properly.
llvm-svn: 59538
2008-11-18 18:43:07 +00:00
Devang Patel
6c2dd85bf3 Let AnalyzeAlloca() remove debug intrinsics.
llvm-svn: 59454
2008-11-17 18:37:53 +00:00
Oscar Fuentes
444fd3cc2d CMake: Remove removed source file.
llvm-svn: 59098
2008-11-12 00:14:12 +00:00
Devang Patel
0a73799659 Remove
llvm-svn: 59093
2008-11-11 23:58:15 +00:00
Devang Patel
0616706919 Undo previous check-in.
llvm-svn: 59092
2008-11-11 23:57:33 +00:00
Oscar Fuentes
ac819d0394 CMake: Updated list of source files for lib/Transforms/Utils.
llvm-svn: 59077
2008-11-11 19:51:36 +00:00
Devang Patel
c9fdfd2f0b Add utility pass to remove dbg info.
llvm-svn: 59068
2008-11-11 19:33:39 +00:00
Cedric Venet
49a701ae17 Update CMakeLists.txt
llvm-svn: 59039
2008-11-11 09:55:48 +00:00
Devang Patel
ec4ae29ae4 Add utility routines to remove dead debug info.
llvm-svn: 59011
2008-11-11 00:53:02 +00:00
Daniel Dunbar
ce947e0039 Rework r58829, allowing removal of dbg info intrinsics during alloca
promotion.
 - Eliminate uses after free and simplify tests.

Devang: Please check that this is still doing what you intended.
llvm-svn: 58887
2008-11-08 04:12:17 +00:00
Bill Wendling
a5eb92b137 BCUI + 1 doesn't work. Use next instead.
llvm-svn: 58830
2008-11-07 01:59:41 +00:00
Devang Patel
0958cd6437 Handle (delete) dbg intrinsics while promoting alloca.
llvm-svn: 58826
2008-11-07 01:30:07 +00:00
Devang Patel
cea9dfa11f InstructionNamer preserves everything.
llvm-svn: 58787
2008-11-06 01:00:16 +00:00
Devang Patel
bc6ef4c191 Check Attribute::NoInline.
llvm-svn: 58742
2008-11-05 01:37:05 +00:00
Devang Patel
40cfcf7ce2 Fix unused variable warnings.
llvm-svn: 58651
2008-11-03 23:14:09 +00:00
Daniel Dunbar
8abdac1eb4 Fix warning.
llvm-svn: 58486
2008-10-31 01:50:01 +00:00
Daniel Dunbar
097da598fb Add InlineCost class for represent the estimated cost of inlining a
function.
 - This explicitly models the costs for functions which should
   "always" or "never" be inlined. This fixes bugs where such costs
   were not previously respected.

llvm-svn: 58450
2008-10-30 19:26:59 +00:00
Chris Lattner
4af91a146a Fix PR2967 by not deleting volatile load/stores that occur before unreachable.
I don't really see this as being needed, but there is little harm from doing
it.

llvm-svn: 58385
2008-10-29 17:46:26 +00:00
Daniel Dunbar
e2fe2de3f4 Assorted comment/naming fixes, 80-col violations, and reindentation.
- No functionality change.

llvm-svn: 58352
2008-10-28 23:24:26 +00:00
Torok Edwin
0c0acebd09 export an ID for the instructionNamer, allowing analysis/transformation passes
that need it to require it by ID.

llvm-svn: 58238
2008-10-27 10:16:27 +00:00
Chris Lattner
17afc211e7 Rewrite all the 'PromoteLocallyUsedAlloca[s]' logic. With the power of
LargeBlockInfo, we can now dramatically simplify their implementation
and speed them up at the same time.  Now the code has time proportional
to the number of uses of the alloca, not the size of the block.

This also eliminates code that tried to batch up different allocas which
are used in the same blocks, and eliminates the 'retry list' logic which
was baroque and no unneccesary.  In addition to being a speedup for crazy
cases, this is also a nice cleanup:

PromoteMemoryToRegister.cpp |  270 +++++++++++++++-----------------------------
 1 file changed, 96 insertions(+), 174 deletions(-)

llvm-svn: 58229
2008-10-27 07:05:53 +00:00
Chris Lattner
39c853cf16 Add a new LargeBlockInfo helper, which is just a wrapper around
a trivial dense map.  Use this in RewriteSingleStoreAlloca to
avoid aggressively rescanning blocks over and over again.  This
fixes PR2925, speeding up mem2reg on the testcase in that bug
from 4.56s to 0.02s in a debug build on my machine.

llvm-svn: 58227
2008-10-27 06:05:26 +00:00
Daniel Dunbar
5447f9679d Change create*Pass factory functions to return Pass* instead of
LoopPass*.
 - Although less precise, this means they can be used in clients
   without RTTI (who would otherwise need to include LoopPass.h, which
   eventually includes things using dynamic_cast). This was the
   simplest solution that presented itself, but I am happy to use a
   better one if available.

llvm-svn: 58010
2008-10-22 23:32:42 +00:00
Nick Lewycky
843c7dfe05 Don't drop alignment on globals when cloning.
llvm-svn: 57320
2008-10-09 06:27:14 +00:00
Duncan Sands
8f296a3788 Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.

llvm-svn: 57291
2008-10-08 07:23:46 +00:00
Andrew Lenharth
c83731e00a Correctly set attributes when removing args during cloning. Fixes PR2765
llvm-svn: 57254
2008-10-07 18:08:38 +00:00
Devang Patel
55401473f9 Nick Lewycky's patch.
While hosting instruction check PHI node.

llvm-svn: 57025
2008-10-03 18:57:37 +00:00
Owen Anderson
e98ca283b0 SplitBlock should only attempt to update LoopInfo if it is actually being used.
llvm-svn: 56994
2008-10-03 06:55:35 +00:00
Duncan Sands
651eeb4be2 Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization
passes.

llvm-svn: 56782
2008-09-29 11:25:42 +00:00
Devang Patel
47a504c87c Implement function notes as function attributes.
llvm-svn: 56716
2008-09-26 23:51:19 +00:00
Devang Patel
64dd7a2e89 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56622
2008-09-25 21:00:45 +00:00
Devang Patel
25ecdc49d9 Put FN_NOTE_AlwaysInline and others in FnAttr namespace.
llvm-svn: 56527
2008-09-24 00:06:15 +00:00
Devang Patel
b39defd763 Move FN_NOTE_AlwaysInline and other out of ParamAttrs namespace.
Do not check isDeclaration() in hasNote(). It is clients' responsibility.

llvm-svn: 56524
2008-09-23 23:52:03 +00:00