llvm-6502/lib
Chandler Carruth ca323cf916 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/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208856 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 09:56:28 +00:00
..
Analysis Teach the constant folder to look through bitcast constant expressions 2014-05-15 09:56:28 +00:00
AsmParser Revert "[ms-cxxabi] Add a new calling convention that swaps 'this' and 'sret'" 2014-05-09 22:56:42 +00:00
Bitcode IR: Don't allow non-default visibility on local linkage 2014-05-07 22:57:20 +00:00
CodeGen Fix typos 2014-05-15 01:52:21 +00:00
DebugInfo [DWARF parser] Cleanup code in DWARFDebugLine. 2014-04-30 00:09:19 +00:00
ExecutionEngine [RuntimeDyld] Fix handling of i386 PC-rel external relocations. This fixes 2014-05-13 22:09:07 +00:00
IR Split GlobalValue into GlobalValue and GlobalObject. 2014-05-13 18:45:48 +00:00
IRReader [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-15 06:32:26 +00:00
LineEditor [CMake] Use LINK_LIBS instead of target_link_libraries(). 2014-02-26 06:41:29 +00:00
Linker Split GlobalValue into GlobalValue and GlobalObject. 2014-05-13 18:45:48 +00:00
LTO Move EmitDwarfAdvanceLineAddr and EmitDwarfAdvanceFrameAddr to the obj streamer. 2014-05-12 14:43:25 +00:00
MC Fix typos 2014-05-15 01:52:21 +00:00
Object Teach llvm-nm to know about fat archives (aka MachOUniversal files 2014-05-14 21:18:50 +00:00
Option Protect the ArgList dtor 2014-04-20 23:59:00 +00:00
ProfileData Fixing a cast-qual warning. getBufferStart() and getBufferEnd() both return a const char *, so casting to non-const was triggering a warning (even though the assignment and usage was always const anyway). 2014-05-01 17:16:24 +00:00
Support MemoryBuffer: don't force mmap when stat fails 2014-05-09 08:57:32 +00:00
TableGen Use a vector of unique_ptrs to fix a memory leak introduced in r208179. 2014-05-08 09:29:28 +00:00
Target [mips][mips64r6] Test that branch likelies are not accepted on MIPS64r6. 2014-05-15 09:47:43 +00:00
Transforms Reverting r208848, reason: build failure: sanitizer-x86_64-linux-bootstrap/builds/3399 2014-05-15 08:22:55 +00:00
CMakeLists.txt ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00
LLVMBuild.txt ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00
Makefile ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00