Fork of llvm with experimental commits and workarounds for RPCS3
Go to file
Chandler Carruth 462bb16130 Fix an overflow bug in MachineBranchProbabilityInfo. This pass relied on
the sum of the edge weights not overflowing uint32, and crashed when
they did. This is generally safe as BranchProbabilityInfo tries to
provide this guarantee. However, the CFG can get modified during codegen
in a way that grows the *sum* of the edge weights. This doesn't seem
unreasonable (imagine just adding more blocks all with the default
weight of 16), but it is hard to come up with a case that actually
triggers 32-bit overflow. Fortuately, the single-source GCC build is
good at this. The solution isn't very pretty, but its no worse than the
previous code. We're already summing all of the edge weights on each
query, we can sum them, check for an overflow, compute a scale, and sum
them again.

I've included a *greatly* reduced test case out of the GCC source that
triggers it. It's a pretty lame test, as it clearly is just barely
triggering the overflow. I'd like to have something that is much more
definitive, but I don't understand the fundamental pattern that triggers
an explosion in the edge weight sums.

The buggy code is duplicated within this file. I'll colapse them into
a single implementation in a subsequent commit.

llvm-svn: 144526
2011-11-14 08:50:16 +00:00
autoconf Add an option '--enable-libcpp' that will have the compiler pass on 2011-11-11 22:51:42 +00:00
bindings Minor fixes in Makefiles for the OCaml bindings: 2011-11-09 12:00:39 +00:00
cmake Fix CRT selection logic when using CMake NMake generator. 2011-11-06 23:37:22 +00:00
docs LLVMBuild: Add explicit information on whether targets define an assembly printer, assembly parser, or disassembler. 2011-11-11 00:23:56 +00:00
examples build: Add initial cut at LLVMBuild.txt files. 2011-11-03 18:53:17 +00:00
include Fix an overflow bug in MachineBranchProbabilityInfo. This pass relied on 2011-11-14 08:50:16 +00:00
lib Fix an overflow bug in MachineBranchProbabilityInfo. This pass relied on 2011-11-14 08:50:16 +00:00
projects build: Add initial cut at LLVMBuild.txt files. 2011-11-03 18:53:17 +00:00
runtime PathProfiling.c: Get rid of using "inline". We may expect compiler shall optimize out "static" scope w/o "inline". 2011-11-08 12:03:14 +00:00
test Fix an overflow bug in MachineBranchProbabilityInfo. This pass relied on 2011-11-14 08:50:16 +00:00
tools llvm-config-2: Detect when we are running out of a BuildTools development tree, so that we can always provide library/include information for the real build directory. 2011-11-11 22:59:47 +00:00
unittests unittests/MultiJITTest.cpp: Tweak how to check symbol value for Win32 --enable-shared. 2011-11-09 08:30:43 +00:00
utils LLVMBuild: Add info for gtest. 2011-11-12 02:11:04 +00:00
.gitignore git: Add tools/lldb to the ignore list. 2011-11-10 22:55:50 +00:00
CMakeLists.txt Revert r144300 "llvm-config: Replace with C++ version (was llvm-config-2).", 2011-11-10 19:59:35 +00:00
configure Add an option '--enable-libcpp' that will have the compiler pass on 2011-11-11 22:51:42 +00:00
CREDITS.TXT CREDITS.TXT: Add a line. (test commit) 2011-10-29 23:42:14 +00:00
LICENSE.TXT Happy new year. 2011-06-12 15:26:54 +00:00
llvm.spec.in
LLVMBuild.txt build: Add initial cut at LLVMBuild.txt files. 2011-11-03 18:53:17 +00:00
Makefile build/Make: Define a TARGET_NATIVE_ARCH variable to be a bit more precise than 2011-11-12 00:18:02 +00:00
Makefile.common
Makefile.config.in build/Make: Define a TARGET_NATIVE_ARCH variable to be a bit more precise than 2011-11-12 00:18:02 +00:00
Makefile.rules build/Make: Define a TARGET_NATIVE_ARCH variable to be a bit more precise than 2011-11-12 00:18:02 +00:00
README.txt test commit undo 2011-11-10 20:39:51 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.

If you're writing a package for LLVM, see docs/Packaging.html for our
suggestions.