llvm-6502/lib/Transforms/Utils
Chris Lattner bfd3e52701 Do not compute the predecessor list for a block unless we need it.
This speeds up simplifycfg on this program, from 44.87s to 0.29s (with
a profiled build):

 #define CL0(a) case a: goto c;
 #define CL1(a) CL0(a##0) CL0(a##1) CL0(a##2) CL0(a##3) CL0(a##4) CL0(a##5) \
 CL0(a##6) CL0(a##7) CL0(a##8) CL0(a##9)
 #define CL2(a) CL1(a##0) CL1(a##1) CL1(a##2) CL1(a##3) CL1(a##4) CL1(a##5) \
 CL1(a##6) CL1(a##7) CL1(a##8) CL1(a##9)
 #define CL3(a) CL2(a##0) CL2(a##1) CL2(a##2) CL2(a##3) CL2(a##4) CL2(a##5) \
 CL2(a##6) CL2(a##7) CL2(a##8) CL2(a##9)
 #define CL4(a) CL3(a##0) CL3(a##1) CL3(a##2) CL3(a##3) CL3(a##4) CL3(a##5) \
 CL3(a##6) CL3(a##7) CL3(a##8) CL3(a##9)

 void f();

 void a() {
     int b;
  c: switch (b) {
         CL4(1)
     }
 }

This testcase is contrived to expose N^2 behavior, but this patch should speedup
simplifycfg on any programs that use large switch statements.  This testcase
comes from GCC PR17895.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17389 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 06:53:58 +00:00
..
BasicBlockUtils.cpp Fix #includes of i*.h => Instructions.h as per PR403. 2004-07-29 17:30:56 +00:00
BreakCriticalEdges.cpp Convert code to compile with vc7.1. 2004-09-15 17:06:42 +00:00
CloneFunction.cpp Fix #includes of i*.h => Instructions.h as per PR403. 2004-07-29 17:30:56 +00:00
CloneModule.cpp Convert to SymbolTable's new iteration interface. 2004-05-25 08:53:40 +00:00
CloneTrace.cpp Convert code to compile with vc7.1. 2004-09-15 17:06:42 +00:00
CodeExtractor.cpp Convert code to compile with vc7.1. 2004-09-15 17:06:42 +00:00
DemoteRegToStack.cpp Fix PR310 and TailDup/2004-04-01-DemoteRegToStack.llx 2004-04-01 20:28:45 +00:00
InlineFunction.cpp Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll 2004-10-17 23:21:07 +00:00
Local.cpp Enhance hasConstantValue to ignore undef values in phi nodes. This allows it 2004-10-17 21:23:26 +00:00
LoopSimplify.cpp hasConstantValue will soon return instructions that don't dominate the PHI node, 2004-10-17 21:22:38 +00:00
LowerAllocations.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
LowerInvoke.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
LowerSelect.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
LowerSwitch.cpp Convert code to compile with vc7.1. 2004-09-15 17:06:42 +00:00
Makefile Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
Mem2Reg.cpp Prototype these functions more accurately 2004-09-20 04:43:15 +00:00
PromoteMemoryToRegister.cpp Correction to allow compilation with Visual C++. 2004-10-18 14:38:48 +00:00
SimplifyCFG.cpp Do not compute the predecessor list for a block unless we need it. 2004-11-01 06:53:58 +00:00
UnifyFunctionExitNodes.cpp Add support for unreachable 2004-10-16 18:21:33 +00:00
ValueMapper.cpp Add support for UndefValue 2004-10-16 18:10:31 +00:00
ValueMapper.h Move RemapInstruction() to ValueMapper, so that it can be shared with 2004-05-19 09:08:12 +00:00