Fork of llvm with experimental commits and workarounds for RPCS3
Go to file
Guozhi Wei 14476b73f7 [InstCombine] Resubmit the combine of A->B->A BitCast and fix for pr27996
The original patch of the A->B->A BitCast optimization was reverted by r274094 because it may cause infinite loop inside compiler https://llvm.org/bugs/show_bug.cgi?id=27996.

The problem is with following code

xB = load (type B); 
xA = load (type A); 
+yA = (A)xB; B -> A
+zAn = PHI[yA, xA]; PHI 
+zBn = (B)zAn; // A -> B
store zAn;
store zBn;

optimizeBitCastFromPhi generates

+zBn = (B)zAn; // A -> B

and expects it will be combined with the following store instruction to another

store zAn 

Unfortunately before combineStoreToValueType is called on the store instruction, optimizeBitCastFromPhi is called on the new BitCast again, and this pattern repeats indefinitely.

optimizeBitCastFromPhi only generates BitCast for load/store instructions, only the BitCast before store can cause the reexecution of optimizeBitCastFromPhi, and BitCast before store can easily be handled by InstCombineLoadStoreAlloca.cpp. So the solution to the problem is if all users of a CI are store instructions, we should not do optimizeBitCastFromPhi on it. Then optimizeBitCastFromPhi will not be called on the new BitCast instructions.

Differential Revision: https://reviews.llvm.org/D23896

llvm-svn: 285116
2016-10-25 20:43:42 +00:00
bindings [Go bindings] Update for r284678 API changes. 2016-10-20 09:14:39 +00:00
cmake cmake: Make /usr/share/cmake installable with LLVM_DISTRIBUTION_COMPONENTS 2016-10-24 21:40:15 +00:00
docs [llvm-cov] Add support for loading coverage from multiple objects 2016-10-25 17:40:55 +00:00
examples [BuildingAJIT] Use the remote target triple to construct the TargetMachine in 2016-10-19 22:41:03 +00:00
include [APFloat] Make APFloat an interface class to the internal IEEEFloat. NFC. 2016-10-25 19:55:59 +00:00
lib [InstCombine] Resubmit the combine of A->B->A BitCast and fix for pr27996 2016-10-25 20:43:42 +00:00
projects [CMake] Correct configuration order of the sub-projects based on ther dependancies 2016-10-09 20:38:29 +00:00
resources
runtimes [CMake] Make the runtimes directory work with bootstrap builds 2016-10-19 21:50:25 +00:00
test [InstCombine] Resubmit the combine of A->B->A BitCast and fix for pr27996 2016-10-25 20:43:42 +00:00
tools [llvm-cov] Don't use colored output until we know it's supported 2016-10-25 19:52:57 +00:00
unittests [unittests] STLExtrasTest: Remove an MSVC 2013 workaround, NFCI. 2016-10-25 18:11:17 +00:00
utils Revert 285087. 2016-10-25 17:46:29 +00:00
.arcconfig project_id is from another era in phabricator land and does not provide any value. 2016-09-27 15:47:29 +00:00
.clang-format
.clang-tidy .clang-tidy: correct style name is 'camelBack' not 'lowerCase'. 2016-09-13 19:04:26 +00:00
.gitignore gitignore: ignore VS Code editor files 2016-09-02 22:54:26 +00:00
CMakeLists.txt cmake: Rename installhdrs to install-llvm-headers and fix the dependencies 2016-10-24 21:58:58 +00:00
CODE_OWNERS.TXT Take ownership of libLTO as discussed on llvm-dev. 2016-09-15 17:42:39 +00:00
configure
CREDITS.TXT Shamelessly add myself to CREDITS.TXT 2016-08-04 16:28:22 +00:00
LICENSE.TXT Remove autoconf references from LICENSE.TXT 2016-08-12 20:11:03 +00:00
llvm.spec.in
LLVMBuild.txt
pzero-fp-xored.ll [PPC] Generate positive FP zero using xor insn instead of loading from constant area 2016-10-24 17:31:09 +00:00
README.txt Revert rL277454 2016-08-02 13:26:07 +00:00
RELEASE_TESTERS.TXT

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

This directory and its subdirectories contain source code for LLVM,
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 documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.