1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/test/Transforms/ConstProp
Chandler Carruth 0d35e1f8fc Teach the constant folder to look through bitcast constant expressions
much more effectively when trying to constant fold a load of a constant.
Previously, we only handled bitcasts by trying to find a totally generic
byte representation of the constant and use that. Now, we look through
the bitcast to see what constant we might fold the load into, and then
try to form a constant expression cast of the found value that would be
equivalent to loading the value.

You might wonder why on earth this actually matters. Well, turns out
that the Itanium ABI causes us to create a single array for a vtable
where the first elements are virtual base offsets, followed by the
virtual function pointers. Because the array is homogenous the element
type is consistently i8* and we inttoptr the virtual base offsets into
the initial elements.

Then constructors bitcast these pointers to i64 pointers prior to
loading them. Boom, no more constant folding of virtual base offsets.
This is the first fix to LLVM to address the *insane* performance Eric
Niebler discovered with Clang on his range comprehensions[1]. There is
more to come though, this doesn't *really* fix the problem fully.

[1]: http://ericniebler.com/2014/04/27/range-comprehensions/

llvm-svn: 208856
2014-05-15 09:56:28 +00:00
..
2002-05-03-DivideByZeroException.ll
2002-05-03-NotOperator.ll Fix the remaining TCL-style quotes found in the testsuite. This is 2012-07-02 19:09:46 +00:00
2002-09-03-SetCC-Bools.ll
2003-05-12-DivideError.ll
2005-01-28-SetCCGEP.ll Fix the remaining TCL-style quotes found in the testsuite. This is 2012-07-02 19:09:46 +00:00
2006-11-30-vector-cast.ll Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
2006-12-01-bool-casts.ll Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
2006-12-01-TruncBoolBug.ll Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
2007-02-05-BitCast.ll
2007-02-23-sdiv.ll Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
2007-11-23-cttz.ll ConstantFolding: Add a missing folding that leads to a miscompile. 2013-01-24 16:28:28 +00:00
2008-07-07-VectorCompare.ll
2009-06-20-constexpr-zero-lhs.ll
2009-09-01-GEP-Crash.ll
basictest.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
bitcast.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
bswap.ll Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change. 2013-07-14 01:50:49 +00:00
calls.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
constant-expr.ll
div-zero.ll Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
extractvalue.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
float-to-ptr-cast.ll
insertvalue.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
loads.ll Teach the constant folder to look through bitcast constant expressions 2014-05-15 09:56:28 +00:00
logicaltest.ll
overflow-ops.ll Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
phi.ll
remtest.ll