llvm-6502/lib
Andrew Trick b1b97833ae Preserve branch profile metadata during switch formation.
Patch by Michael Ilseman!
This fixes SimplifyCFGOpt::FoldValueComparisonIntoPredecessors to preserve metata when folding conditional branches into switches.

void foo(int x) {
  if (x == 0)
    bar(1);
  else if (__builtin_expect(x == 10, 1))
    bar(2);
  else if (x == 20)
    bar(3);
}

CFG:

B0
|  \
|   X0
B10
|  \
|   X10
B20
|  \
E   X20

Merge B0-B10:
w(B0-X0) = w(B0-X0)*sum-weights(B10) = w(B0-X0) * (w(B10-X10) + w(B10-B20))
w(B0-X10) = w(B0-B10) * w(B10-X10)
w(B0-B20) = w(B0-B10) * w(B10-B20)

B0 __
| \  \
| X10 X0
B20
|  \
E  X20

Merge B0-B20:
w(B0-X0) = w(B0-X0) * sum-weights(B20) = w(B0-X0) * (w(B20-E) + w(B20-X20))
w(B0-X10) = w(B0-X10) * sum-weights(B20) = ...
w(B0-X20) = w(B0-B20) * w(B20-X20)
w(B0-E) = w(B0-B20) * w(B20-E)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162868 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 21:46:38 +00:00
..
Analysis Make MemoryBuiltins aware of TargetLibraryInfo. 2012-08-29 15:32:21 +00:00
Archive Remove references to compression in llvm-ar. It has been a long time since we 2012-08-10 01:57:52 +00:00
AsmParser Change the linker_private_weak_def_auto' linkage to linkonce_odr_auto_hide' to 2012-08-17 18:33:14 +00:00
Bitcode Change the linker_private_weak_def_auto' linkage to linkonce_odr_auto_hide' to 2012-08-17 18:33:14 +00:00
CodeGen Rename hasVolatileMemoryRef() to hasOrderedMemoryRef(). 2012-08-29 21:19:21 +00:00
DebugInfo Fix compile error when building with C++11 - clang thinks that PRIx64 is a user-defined suffix or something 2012-08-27 22:53:35 +00:00
ExecutionEngine Fix comment for function RuntimeDyldImpl.resolveRelocation() 2012-08-27 15:34:01 +00:00
Linker Move the "findUsedStructTypes" functionality outside of the Module class. 2012-08-03 00:30:35 +00:00
MC Add virtual keywords for methods that override the base class. 2012-08-29 05:48:09 +00:00
Object Reverting r 160419. 2012-07-19 21:43:55 +00:00
Support Add the Freescale vendor to Triple. 2012-08-28 02:10:30 +00:00
TableGen Tristate mayLoad, mayStore, and hasSideEffects. 2012-08-23 19:34:46 +00:00
Target Rename hasVolatileMemoryRef() to hasOrderedMemoryRef(). 2012-08-29 21:19:21 +00:00
Transforms Preserve branch profile metadata during switch formation. 2012-08-29 21:46:38 +00:00
VMCore Make atomic load and store of pointers work. Tighten verification of atomic operations 2012-08-17 23:24:29 +00:00
CMakeLists.txt
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile