<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 19, 2014, at 3:46 PM, Balaram Makam <<a href="mailto:bmakam@codeaurora.org" class="">bmakam@codeaurora.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Hi Manman,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I have a patch with a potential fix to the problem, but I cannot reproduce the original failure with the preprocessed source files you provided.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div>Hi Balaram,</div><div><br class=""></div><div>You need to build a lto selfhost to reproduce.</div><div><br class=""></div><div><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">1> make a release+assert build with your patch (install the compiler to a directory clang-install for example).<br class=""></blockquote></blockquote></blockquote></blockquote><div><br class=""></div>create directory clang-build and clang-install under llvm</div><div>under clang-build, do:<br class="">  ./llvm/configure --enable-assertions --enable-optimized --disable-bindings --enable-targets=x86,x86_64 --enable-libcpp --prefix=Users/manmanren/llvm/clang-install</div><div>  make -j 12 VERBOSE=1 CLANG_REPOSITORY_STRING=clang-stage1-configure-RA_build SVN_REVISION=222059<br class="">  make install-clang -j 4</div><div><br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">2> use clang-install binary and library to build the same repo with lto.<br class=""></blockquote></blockquote></blockquote></blockquote><br class="">create directory selfhost, under selfhost, do:<br class=""><div>../llvm/configure --disable-assertions --with-extra-options="-flto -gline-tables-only” --enable-optimized --disable-bindings --enable-targets=x86,x86_64 --enable-libcpp CC=/Users/manmanren/llvm/clang-install/bin/clang CXX=/Users/manmanren/gmail/clang-install/llvm/clang++</div></div><div><br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">   make -j 4 VERBOSE=1 CLANG_REPOSITORY_STRING=clang-Rlto_master_build SVN_REVISION=222059 DYLD_LIBRARY_PATH=/Users/manmanren/llvm_gmail/clang-install/lib/</blockquote></blockquote></blockquote></blockquote><div><br class=""></div><div>The whole process takes a few hours to run.You can also commit the patch if you are confident enough and then watch the bot (phase 2 lto).</div><div><br class=""></div><div>Manman</div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Could you please test this patch (attached) and let me know if it works?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Thanks,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Balaram</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">-----Original Message-----</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">From: Chad Rosier [</span><a href="mailto:mcrosier@codeaurora.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">mailto:mcrosier@codeaurora.org</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">]<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Sent: Tuesday, November 18, 2014 9:09 PM</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">To: Manman Ren</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Cc:<span class="Apple-converted-space"> </span></span><a href="mailto:mcrosier@codeaurora.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">mcrosier@codeaurora.org</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">;<span class="Apple-converted-space"> </span></span><a href="mailto:llvm-commits@cs.uiuc.edu" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">llvm-commits@cs.uiuc.edu</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">; Balaram Makam; James Molloy</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Subject: Re: [llvm] r222039 - Reapply r221924: "[GVN] Perform Scalar PRE on gep indices that feed loads before</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Thanks, Manman.  Balaram or another one of our team members will investigate.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Chad</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="">Hi Chad,<br class=""><br class="">I reverted the commit in r222287.<br class=""><br class="">The lto self host of r222239 without this commit succeeded.<br class="">And I have finished the lto self host of r222239 including this<span class="Apple-converted-space"> </span><br class="">commit, it failed. If you need any more files, let me know.<br class=""><br class="">Thanks,<br class="">Manman<br class=""><br class="">clang(59539,0x7fff7c035300) malloc: *** error for object 0x7fa438648450:<br class="">pointer being freed was not allocated<br class="">*** set a breakpoint in malloc_error_break to debug<br class=""> COMPILE:   clang_darwin/cc_kext/x86_64:<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/fixxfti.c<br class=""> COMPILE:   clang_darwin/cc_kext/x86_64:<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/x86_64/f<br class="">loatdidf.c /Users/manmanren/gmail/selfhost/Release/bin/clang -fPIC<span class="Apple-converted-space"> </span><br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/lib<br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/include -arch<span class="Apple-converted-space"> </span><br class="">x86_64 -fvisibility=hidden -DVISIBILITY_HIDDEN -mkernel -DKERNEL_USE<span class="Apple-converted-space"> </span><br class="">-Wall -Werror -O3 -fomit-frame-pointer -mmacosx-version-min=10.4<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-c -o<br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/fixxfti.o<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/fixxfti.c<br class=""> COMPILE:   clang_darwin/cc_kext/x86_64:<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/x86_64/f<br class="">loatdisf.c /Users/manmanren/gmail/selfhost/Release/bin/clang -fPIC<span class="Apple-converted-space"> </span><br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/lib<br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/include -arch<span class="Apple-converted-space"> </span><br class="">x86_64 -fvisibility=hidden -DVISIBILITY_HIDDEN -mkernel -DKERNEL_USE<span class="Apple-converted-space"> </span><br class="">-Wall -Werror -O3 -fomit-frame-pointer -mmacosx-version-min=10.4<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-c -o<br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins__x86_64/floatdisf.o<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/x86_64/f<br class="">loatdisf.c /Users/manmanren/gmail/selfhost/Release/bin/clang -fPIC<span class="Apple-converted-space"> </span><br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/lib<br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/include -arch<span class="Apple-converted-space"> </span><br class="">x86_64 -fvisibility=hidden -DVISIBILITY_HIDDEN -mkernel -DKERNEL_USE<span class="Apple-converted-space"> </span><br class="">-Wall -Werror -O3 -fomit-frame-pointer -mmacosx-version-min=10.4<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-c -o<br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins__x86_64/floatdidf.o<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/x86_64/f<br class="">loatdidf.c<br class="">clang(59547,0x7fff7c035300) malloc: *** error for object 0x7f9410f1c0d0:<br class="">pointer being freed was not allocated<br class="">*** set a breakpoint in malloc_error_break to debug<br class="">0  clang                    0x000000010c15d259<br class="">llvm::sys::PrintStackTrace(__sFILE*) + 57<br class="">1  clang                    0x000000010c15ddab SignalHandler(int) + 347<br class="">2  libsystem_platform.dylib 0x00007fff980faf1a _sigtramp + 26<br class="">3  libsystem_platform.dylib 0xffffffffffffffff _sigtramp + 1743802623<br class="">4  libsystem_c.dylib        0x00007fff982ccb73 abort + 129<br class="">5  libsystem_malloc.dylib   0x00007fff98e7b937 nano_size + 0<br class="">6  clang                    0x000000010b7b77b9 (anonymous<br class="">namespace)::X86TTI::getIntImmCost(llvm::APInt const&, llvm::Type*)<span class="Apple-converted-space"> </span><br class="">const +<br class="">601<br class="">7  clang                    0x000000010b7b6cd8 non-virtual thunk to<br class="">(anonymous namespace)::X86TTI::getIntImmCost(unsigned int, unsigned<span class="Apple-converted-space"> </span><br class="">int, llvm::APInt const&, llvm::Type*) const + 216<br class="">8  clang                    0x000000010bb73333 (anonymous<br class="">namespace)::ConstantHoisting::collectConstantCandidates(llvm::DenseMap<br class=""><llvm::ConstantInt*, unsigned int,<span class="Apple-converted-space"> </span><br class="">llvm::DenseMapInfo<llvm::ConstantInt*> >&, llvm::Instruction*,<span class="Apple-converted-space"> </span><br class="">unsigned int, llvm::ConstantInt*) + 211<br class=""> COMPILE:   clang_darwin/cc_kext/x86_64:<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/x86_64/floatdixf.c<br class="">9  clang                    0x000000010bb6ecf4 (anonymous<br class="">namespace)::ConstantHoisting::runOnFunction(llvm::Function&) + 516<br class=""> COMPILE:   clang_darwin/cc_kext/x86_64:<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/floattid<br class="">f.c /Users/manmanren/gmail/selfhost/Release/bin/clang -fPIC<span class="Apple-converted-space"> </span><br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/lib<br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/include -arch<span class="Apple-converted-space"> </span><br class="">x86_64 -fvisibility=hidden -DVISIBILITY_HIDDEN -mkernel -DKERNEL_USE<span class="Apple-converted-space"> </span><br class="">-Wall -Werror -O3 -fomit-frame-pointer -mmacosx-version-min=10.4<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-c -o<br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins__x86_64/floatdixf.o<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/x86_64/floatdixf.c<br class="">10 clang                    0x000000010c0e3a25<br class="">llvm::FPPassManager::runOnFunction(llvm::Function&) + 549<br class="">11 clang                    0x000000010c0e3c9b<br class="">llvm::FPPassManager::runOnModule(llvm::Module&) + 43<br class="">12 clang                    0x000000010c0e412a<br class="">llvm::legacy::PassManagerImpl::run(llvm::Module&) + 922<br class="">13 clang                    0x000000010a445430<br class="">clang::EmitBackendOutput(clang::DiagnosticsEngine&,<span class="Apple-converted-space"> </span><br class="">clang::CodeGenOptions const&, clang::TargetOptions const&,<span class="Apple-converted-space"> </span><br class="">clang::LangOptions const&, llvm::StringRef, llvm::Module*,<span class="Apple-converted-space"> </span><br class="">clang::BackendAction, llvm::raw_ostream*)<br class="">+ 12208<br class="">0  clang                    0x00000001059d5259<br class="">llvm::sys::PrintStackTrace(__sFILE*) + 57<br class="">14 clang                    0x000000010a5cda44<br class="">clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) +<span class="Apple-converted-space"> </span><br class="">516 /Users/manmanren/gmail/selfhost/Release/bin/clang -fPIC<span class="Apple-converted-space"> </span><br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/lib<br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/include -arch<span class="Apple-converted-space"> </span><br class="">x86_64 -fvisibility=hidden -DVISIBILITY_HIDDEN -mkernel -DKERNEL_USE<span class="Apple-converted-space"> </span><br class="">-Wall -Werror -O3 -fomit-frame-pointer -mmacosx-version-min=10.4<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-c -o<br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/floattidf.o<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/floattidf.c<br class="">1  clang                    0x00000001059d5dab SignalHandler(int) + 347<br class="">2  libsystem_platform.dylib 0x00007fff980faf1a _sigtramp + 26<br class="">3  libsystem_platform.dylib 0xffffffffffffffff _sigtramp + 1743802623<br class="">15 clang                    0x000000010a6864c5 4  libsystem_c.dylib<br class="">0x00007fff982ccb73 clang::ParseAST(clang::Sema&, bool, bool)abort +<span class="Apple-converted-space"> </span><br class="">661 +<br class="">129<br class=""><br class="">5  libsystem_malloc.dylib   0x00007fff98e7b937 nano_size + 0<br class="">16 clang                    0x000000010a1f2b7e<br class="">clang::FrontendAction::Execute() + 62<br class="">6  clang                    0x000000010502f7b9 (anonymous<br class="">namespace)::X86TTI::getIntImmCost(llvm::APInt const&, llvm::Type*)<span class="Apple-converted-space"> </span><br class="">const +<br class="">601<br class="">17 clang                    0x000000010a1ba8d3<br class="">clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 915<br class="">7  clang                    0x000000010502ecd8 non-virtual thunk to<br class="">(anonymous namespace)::X86TTI::getIntImmCost(unsigned int, unsigned<span class="Apple-converted-space"> </span><br class="">int, llvm::APInt const&, llvm::Type*) const + 216<br class="">18 clang                    0x000000010a16a3fa<br class="">clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2890<br class="">8  clang                    0x00000001053eb333 (anonymous<br class="">namespace)::ConstantHoisting::collectConstantCandidates(llvm::DenseMap<br class=""><llvm::ConstantInt*, unsigned int,<span class="Apple-converted-space"> </span><br class="">llvm::DenseMapInfo<llvm::ConstantInt*> >&, llvm::Instruction*,<span class="Apple-converted-space"> </span><br class="">unsigned int, llvm::ConstantInt*) + 211<br class="">19 clang                    0x000000010a16000c<br class="">cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 1836<br class="">9  clang                    0x00000001053e6cf4 (anonymous<br class="">namespace)::ConstantHoisting::runOnFunction(llvm::Function&) + 516<br class="">20 clang                    0x000000010a168b21 main + 13745<br class="">21 libdyld.dylib            0x00007fff8b4215c9 start + 1<br class="">22 libdyld.dylib            0x0000000000000045 start + 1958603389<br class="">10 clang                    0x000000010595ba25<br class="">llvm::FPPassManager::runOnFunction(llvm::Function&) + 549 Stack dump:<br class="">0.<span class="Apple-tab-span" style="white-space: pre;">       </span>Program arguments: /Users/manmanren/gmail/selfhost/Release/bin/clang<br class="">-cc1 -triple x86_64-apple-macosx10.4.0 -emit-obj -disable-free<span class="Apple-converted-space"> </span><br class="">-disable-llvm-verifier -main-file-name fixunsxfti.c -static-define<span class="Apple-converted-space"> </span><br class="">-mrelocation-model static -mthread-model posix -masm-verbose<span class="Apple-converted-space"> </span><br class="">-fforbid-guard-variables -target-cpu core2 -disable-red-zone<span class="Apple-converted-space"> </span><br class="">-no-implicit-float -target-linker-version 242 -dwarf-column-info<span class="Apple-converted-space"> </span><br class="">-coverage-file<span class="Apple-converted-space"> </span><br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/fixunsxfti.o<br class="">-resource-dir<br class="">/Users/manmanren/gmail/selfhost/Release/bin/../lib/clang/3.6.0<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-D VISIBILITY_HIDDEN -D KERNEL_USE -I<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib -I<span class="Apple-converted-space"> </span><br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/include -O3 -Wall<span class="Apple-converted-space"> </span><br class="">-Werror -fdebug-compilation-dir<span class="Apple-converted-space"> </span><br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt<br class="">-ferror-limit 19 -fmessage-length 164 -fvisibility hidden<span class="Apple-converted-space"> </span><br class="">-ffreestanding -mstackrealign -fno-builtin -fblocks<span class="Apple-converted-space"> </span><br class="">-fblocks-runtime-optional -fno-rtti -fno-use-cxa-atexit<span class="Apple-converted-space"> </span><br class="">-fobjc-runtime=macosx-10.4.0 -fobjc-dispatch-method=non-legacy<span class="Apple-converted-space"> </span><br class="">-fencode-extended-block-signature<br class="">-fmax-type-align=16 -fno-common -fdiagnostics-show-option<span class="Apple-converted-space"> </span><br class="">-fcolor-diagnostics -vectorize-loops -vectorize-slp -o<span class="Apple-converted-space"> </span><br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/fixunsxfti.o<br class="">-x c<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/fixunsxfti.c<br class="">1.<span class="Apple-tab-span" style="white-space: pre;">    </span><eof> parser at end of file<br class="">2.<span class="Apple-tab-span" style="white-space: pre;">  </span>Code generation<br class="">3.<span class="Apple-tab-span" style="white-space: pre;">    </span>Running pass 'Function Pass Manager' on module<br class="">'/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/fixunsxfti.c'.<br class="">4.<span class="Apple-tab-span" style="white-space: pre;">   </span>Running pass 'Constant Hoisting' on function '@__fixunsxfti'<br class="">11 clang                    0x000000010595bc9b<br class="">llvm::FPPassManager::runOnModule(llvm::Module&) + 43<br class="">12 clang                    0x000000010595c12a<br class="">llvm::legacy::PassManagerImpl::run(llvm::Module&) + 922<br class="">13 clang                    0x0000000103cbd430<br class="">clang::EmitBackendOutput(clang::DiagnosticsEngine&,<span class="Apple-converted-space"> </span><br class="">clang::CodeGenOptions const&, clang::TargetOptions const&,<span class="Apple-converted-space"> </span><br class="">clang::LangOptions const&, llvm::StringRef, llvm::Module*,<span class="Apple-converted-space"> </span><br class="">clang::BackendAction, llvm::raw_ostream*)<br class="">+ 12208<br class="">14 clang                    0x0000000103e45a44<br class="">clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 516<br class="">15 clang                    0x0000000103efe4c5<br class="">clang::ParseAST(clang::Sema&, bool, bool) + 661<br class="">16 clang                    0x0000000103a6ab7e<br class="">clang::FrontendAction::Execute() + 62<br class="">17 clang                    0x0000000103a328d3<br class="">clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 915<br class="">18 clang                    0x00000001039e23fa<br class="">clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2890<br class="">19 clang                    0x00000001039d800c<br class="">cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 1836<br class="">20 clang                    0x00000001039e0b21 main + 13745<br class="">21 libdyld.dylib            0x00007fff8b4215c9 start + 1<br class="">22 libdyld.dylib            0x0000000000000045 start + 1958603389<br class="">Stack dump:<br class="">0.<span class="Apple-tab-span" style="white-space: pre;">   </span>Program arguments: /Users/manmanren/gmail/selfhost/Release/bin/clang<br class="">-cc1 -triple x86_64-apple-macosx10.4.0 -emit-obj -disable-free<span class="Apple-converted-space"> </span><br class="">-disable-llvm-verifier -main-file-name fixxfti.c -static-define<span class="Apple-converted-space"> </span><br class="">-mrelocation-model static -mthread-model posix -masm-verbose<span class="Apple-converted-space"> </span><br class="">-fforbid-guard-variables -target-cpu core2 -disable-red-zone<span class="Apple-converted-space"> </span><br class="">-no-implicit-float -target-linker-version 242 -dwarf-column-info<span class="Apple-converted-space"> </span><br class="">-coverage-file<span class="Apple-converted-space"> </span><br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/fixxfti.o<br class="">-resource-dir<br class="">/Users/manmanren/gmail/selfhost/Release/bin/../lib/clang/3.6.0<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-D VISIBILITY_HIDDEN -D KERNEL_USE -I<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib -I<span class="Apple-converted-space"> </span><br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/include -O3 -Wall<span class="Apple-converted-space"> </span><br class="">-Werror -fdebug-compilation-dir<span class="Apple-converted-space"> </span><br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt<br class="">-ferror-limit 19 -fmessage-length 164 -fvisibility hidden<span class="Apple-converted-space"> </span><br class="">-ffreestanding -mstackrealign -fno-builtin -fblocks<span class="Apple-converted-space"> </span><br class="">-fblocks-runtime-optional -fno-rtti -fno-use-cxa-atexit<span class="Apple-converted-space"> </span><br class="">-fobjc-runtime=macosx-10.4.0 -fobjc-dispatch-method=non-legacy<span class="Apple-converted-space"> </span><br class="">-fencode-extended-block-signature<br class="">-fmax-type-align=16 -fno-common -fdiagnostics-show-option<span class="Apple-converted-space"> </span><br class="">-fcolor-diagnostics -vectorize-loops -vectorize-slp -o<span class="Apple-converted-space"> </span><br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/fixxfti.o<br class="">-x c<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/fixxfti.c<br class="">1.<span class="Apple-tab-span" style="white-space: pre;">        </span><eof> parser at end of file<br class="">2.<span class="Apple-tab-span" style="white-space: pre;">  </span>Code generation<br class="">3.<span class="Apple-tab-span" style="white-space: pre;">    </span>Running pass 'Function Pass Manager' on module<br class="">'/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/fixxfti.c'.<br class="">4.<span class="Apple-tab-span" style="white-space: pre;">      </span>Running pass 'Constant Hoisting' on function '@__fixxfti'<br class=""> COMPILE:   clang_darwin/cc_kext/x86_64:<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/floattis<br class="">f.c /Users/manmanren/gmail/selfhost/Release/bin/clang -fPIC<span class="Apple-converted-space"> </span><br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/lib<br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/include -arch<span class="Apple-converted-space"> </span><br class="">x86_64 -fvisibility=hidden -DVISIBILITY_HIDDEN -mkernel -DKERNEL_USE<span class="Apple-converted-space"> </span><br class="">-Wall -Werror -O3 -fomit-frame-pointer -mmacosx-version-min=10.4<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-c -o<br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/floattisf.o<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/floattis<br class="">f.c<br class=""><br class=""> COMPILE:   clang_darwin/cc_kext/x86_64:<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/powidf2.<br class="">c /Users/manmanren/gmail/selfhost/Release/bin/clang -fPIC<span class="Apple-converted-space"> </span><br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/lib<br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/include -arch<span class="Apple-converted-space"> </span><br class="">x86_64 -fvisibility=hidden -DVISIBILITY_HIDDEN -mkernel -DKERNEL_USE<span class="Apple-converted-space"> </span><br class="">-Wall -Werror -O3 -fomit-frame-pointer -mmacosx-version-min=10.4<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-c -o<br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/popcountti2.o<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/popcount<br class="">ti2.c /Users/manmanren/gmail/selfhost/Release/bin/clang -fPIC<span class="Apple-converted-space"> </span><br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/lib<br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/include -arch<span class="Apple-converted-space"> </span><br class="">x86_64 -fvisibility=hidden -DVISIBILITY_HIDDEN -mkernel -DKERNEL_USE<span class="Apple-converted-space"> </span><br class="">-Wall -Werror -O3 -fomit-frame-pointer -mmacosx-version-min=10.4<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-c -o<br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/powidf2.o<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/powidf2.<br class="">c<br class="">clang: error: unable to execute command: Abort trap: 6<br class="">clang: error: clang frontend command failed due to signal (use -v to<span class="Apple-converted-space"> </span><br class="">see<br class="">invocation)<br class="">clang version 3.6.0 (clang-Rlto_master_build 222059) (llvm/trunk<span class="Apple-converted-space"> </span><br class="">222239)<br class="">Target: x86_64-apple-darwin14.0.0<br class="">Thread model: posix<br class="">clang: note: diagnostic msg: PLEASE submit a bug report to<span class="Apple-converted-space"> </span><br class=""><a href="http://llvm.org/bugs/" class="">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed<span class="Apple-converted-space"> </span><br class="">source, and associated run script.<br class=""> COMPILE:   clang_darwin/cc_kext/x86_64:<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/powisf2.<br class="">c /Users/manmanren/gmail/selfhost/Release/bin/clang -fPIC<span class="Apple-converted-space"> </span><br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/lib<br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/include -arch<span class="Apple-converted-space"> </span><br class="">x86_64 -fvisibility=hidden -DVISIBILITY_HIDDEN -mkernel -DKERNEL_USE<span class="Apple-converted-space"> </span><br class="">-Wall -Werror -O3 -fomit-frame-pointer -mmacosx-version-min=10.4<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-c -o<br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/powisf2.o<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/powisf2.<br class="">c<br class="">clang: note: diagnostic msg:<br class="">********************<br class=""><br class="">PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:<br class="">Preprocessed source(s) and associated run script(s) are located at:<br class="">clang: note: diagnostic msg:<br class="">/var/folders/8d/mksp0c9x6yngd578zj_s72ym0000gn/T/fixxfti-868934.c<br class="">clang: note: diagnostic msg:<br class="">/var/folders/8d/mksp0c9x6yngd578zj_s72ym0000gn/T/fixxfti-868934.sh<br class="">clang: note: diagnostic msg:<br class=""><br class="">********************<br class=""> COMPILE:   clang_darwin/cc_kext/x86_64:<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/powixf2.<br class="">c<br class="">make[5]: ***<br class="">[/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang<br class="">_darwin/cc_kext/x86_64/SubDir.lib__builtins/fixxfti.o]<br class="">Error 254<br class="">make[5]: *** Waiting for unfinished jobs....<br class="">/Users/manmanren/gmail/selfhost/Release/bin/clang -fPIC<span class="Apple-converted-space"> </span><br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/lib<br class="">-I/Users/manmanren/gmail/llvm/projects/compiler-rt/include -arch<span class="Apple-converted-space"> </span><br class="">x86_64 -fvisibility=hidden -DVISIBILITY_HIDDEN -mkernel -DKERNEL_USE<span class="Apple-converted-space"> </span><br class="">-Wall -Werror -O3 -fomit-frame-pointer -mmacosx-version-min=10.4<span class="Apple-converted-space"> </span><br class="">-isysroot<span class="Apple-converted-space"> </span><br class="">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D<br class="">eveloper/SDKs/MacOSX10.10.sdk<br class="">-c -o<br class="">/Users/manmanren/gmail/selfhost/tools/clang/runtime/compiler-rt/clang_<br class="">darwin/cc_kext/x86_64/SubDir.lib__builtins/powixf2.o<br class="">/Users/manmanren/gmail/llvm/projects/compiler-rt/lib/builtins/powixf2.<br class="">c<br class="">clang: error: unable to execute command: Abort trap: 6<br class="">clang: error: clang frontend command failed due to signal (use -v to<span class="Apple-converted-space"> </span><br class="">see<br class="">invocation)<br class="">clang version 3.6.0 (clang-Rlto_master_build 222059) (llvm/trunk<span class="Apple-converted-space"> </span><br class="">222239)<br class="">Target: x86_64-apple-darwin14.0.0<br class="">Thread model: posix<br class="">clang: note: diagnostic msg: PLEASE submit a bug report to<span class="Apple-converted-space"> </span><br class=""><a href="http://llvm.org/bugs/" class="">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed<span class="Apple-converted-space"> </span><br class="">source, and associated run script.<br class="">clang: note: diagnostic msg:<br class="">********************<br class=""><br class="">PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:<br class="">Preprocessed source(s) and associated run script(s) are located at:<br class="">clang: note: diagnostic msg:<br class="">/var/folders/8d/mksp0c9x6yngd578zj_s72ym0000gn/T/fixunsxfti-33f776.c<br class="">clang: note: diagnostic msg:<br class="">/var/folders/8d/mksp0c9x6yngd578zj_s72ym0000gn/T/fixunsxfti-33f776.sh<br class="">clang: note: diagnostic msg:<br class=""><br class="">********************<br class=""><br class=""><br class=""><blockquote type="cite" class="">On Nov 18, 2014, at 2:53 PM, Chad Rosier <<a href="mailto:mcrosier@codeaurora.org" class="">mcrosier@codeaurora.org</a>><br class="">wrote:<br class=""><br class="">Hi Manman,<br class="">Feel free to revert the patch if you're convinced this is the problem.<br class="">Please keep Balaram, James, and I updated on the progress.  This is a<span class="Apple-converted-space"> </span><br class="">performance critical fix, so we need to make sure it doesn't get lost<span class="Apple-converted-space"> </span><br class="">in the mix.<br class=""><br class="">Chad<br class=""><br class=""><blockquote type="cite" class="">Hi Chad,<br class=""><br class="">About the buildbot phase 2 failure, I now think this commit is the<span class="Apple-converted-space"> </span><br class="">root cause.<br class=""><br class="">What I did was:<br class="">1> update the repo to r222239, then "svn merge -c -r222039 .”,<span class="Apple-converted-space"> </span><br class="">1> made a<br class="">release+assert build (installed to clang-install).<br class="">2> use clang-install binary and library to build the same repo with<br class="">lto.<br class="">   make -j 4 VERBOSE=1<span class="Apple-converted-space"> </span><br class="">CLANG_REPOSITORY_STRING=clang-Rlto_master_build<br class="">SVN_REVISION=222059<br class="">DYLD_LIBRARY_PATH=/Users/manmanren/llvm_gmail/clang-install/lib/<br class="">3> the build completed<br class="">make[1]: Nothing to be done for `all'.<br class="">make[1]: Nothing to be done for `all'.<br class="">llvm[0]: ***** Completed Release Build<br class=""><br class="">Is it okay for us to revert this commit and watch the bot? If the<span class="Apple-converted-space"> </span><br class="">bot is still red, we can re-submit it.<br class=""><br class="">If you want me to do more testing (maybe a lto self host with<span class="Apple-converted-space"> </span><br class="">r22239), let me know,<br class=""><br class="">Thanks,<br class="">Manman (The build czar)<br class=""><br class=""><blockquote type="cite" class="">On Nov 14, 2014, at 1:09 PM, Chad Rosier <<a href="mailto:mcrosier@codeaurora.org" class="">mcrosier@codeaurora.org</a>><br class="">wrote:<br class=""><br class="">Author: mcrosier<br class="">Date: Fri Nov 14 15:09:13 2014<br class="">New Revision: 222039<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=222039&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=222039&view=rev</a><br class="">Log:<br class="">Reapply r221924: "[GVN] Perform Scalar PRE on gep indices that feed<span class="Apple-converted-space"> </span><br class="">loads before doing Load PRE"<br class=""><br class="">This commit updates the failing test in<span class="Apple-converted-space"> </span><br class="">Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-mismatch.ll<br class=""><br class="">The failing test is sensitive to the order in which we process loads.<br class="">This<br class="">version turns on the RPO traversal instead of the while DT<span class="Apple-converted-space"> </span><br class="">traversal in GVN.<br class="">The new test code is functionally same just the order of loads that<span class="Apple-converted-space"> </span><br class="">are eliminated is swapped.<br class=""><br class="">This new version also fixes an issue where GVN splits a critical<span class="Apple-converted-space"> </span><br class="">edge and potentially invalidate the RPO/DT iterator.<br class=""><br class="">Added:<br class=""> llvm/trunk/test/Transforms/GVN/pre-gep-load.ll<br class="">Modified:<br class=""> llvm/trunk/lib/Transforms/Scalar/GVN.cpp<br class=""><br class="">llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-m<br class="">ismatch.ll<br class=""><br class="">Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp<br class="">URL:<br class=""><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scala" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scala</a><br class="">r/GVN.cpp?rev=222039&r1=222038&r2=222039&view=diff<br class="">===================================================================<br class="">===========<br class="">--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)<br class="">+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Nov 14 15:09:13<span class="Apple-converted-space"> </span><br class="">+++ 2014<br class="">@@ -20,6 +20,7 @@<br class="">#include "llvm/ADT/DepthFirstIterator.h"<br class="">#include "llvm/ADT/Hashing.h"<br class="">#include "llvm/ADT/MapVector.h"<br class="">+#include "llvm/ADT/PostOrderIterator.h"<br class="">#include "llvm/ADT/SetVector.h"<br class="">#include "llvm/ADT/SmallPtrSet.h"<br class="">#include "llvm/ADT/Statistic.h"<br class="">@@ -709,6 +710,7 @@ namespace {<br class="">  void dump(DenseMap<uint32_t, Value*> &d);<br class="">  bool iterateOnFunction(Function &F);<br class="">  bool performPRE(Function &F);<br class="">+    bool performScalarPRE(Instruction *I);<br class="">  Value *findLeader(const BasicBlock *BB, uint32_t num);<br class="">  void cleanupGlobalSets();<br class="">  void verifyRemoved(const Instruction *I) const; @@ -1729,6<span class="Apple-converted-space"> </span><br class="">+1731,15 @@ bool GVN::processNonLocalLoad(LoadInst *<br class="">  return false;<br class="">}<br class=""><br class="">+  // If this load follows a GEP, see if we can PRE the indices<span class="Apple-converted-space"> </span><br class="">+ before<br class="">analyzing.<br class="">+  if (GetElementPtrInst *GEP =<br class="">dyn_cast<GetElementPtrInst>(LI->getOperand(0))) {<br class="">+    for (GetElementPtrInst::op_iterator OI = GEP->idx_begin(),<br class="">+                                        OE = GEP->idx_end();<br class="">+         OI != OE; ++OI)<br class="">+      if (Instruction *I = dyn_cast<Instruction>(OI->get()))<br class="">+        performScalarPRE(I);<br class="">+  }<br class="">+<br class="">// Step 2: Analyze the availability of the load  AvailValInBlkVect<span class="Apple-converted-space"> </span><br class="">ValuesPerBlock;  UnavailBlkVect UnavailableBlocks; @@ -2431,175<span class="Apple-converted-space"> </span><br class="">+2442,182 @@ bool GVN::processBlock(BasicBlock *BB) {  return<span class="Apple-converted-space"> </span><br class="">ChangedFunction; }<br class=""><br class="">-/// performPRE - Perform a purely local form of PRE that looks for<span class="Apple-converted-space"> </span><br class="">diamond -/// control flow patterns and attempts to perform simple<span class="Apple-converted-space"> </span><br class="">PRE at the join point.<br class="">-bool GVN::performPRE(Function &F) {<br class="">-  bool Changed = false;<br class="">+bool GVN::performScalarPRE(Instruction *CurInst) {<br class="">SmallVector<std::pair<Value*, BasicBlock*>, 8> predMap;<br class="">-  for (BasicBlock *CurrentBlock : depth_first(&F.getEntryBlock())) {<br class="">-    // Nothing to PRE in the entry block.<br class="">-    if (CurrentBlock == &F.getEntryBlock()) continue;<br class=""><br class="">-    // Don't perform PRE on a landing pad.<br class="">-    if (CurrentBlock->isLandingPad()) continue;<br class="">+  if (isa<AllocaInst>(CurInst) || isa<TerminatorInst>(CurInst) ||<br class="">+      isa<PHINode>(CurInst) || CurInst->getType()->isVoidTy() ||<br class="">+      CurInst->mayReadFromMemory() ||<span class="Apple-converted-space"> </span><br class="">+ CurInst->mayHaveSideEffects()<br class="">||<br class="">+      isa<DbgInfoIntrinsic>(CurInst))<br class="">+    return false;<br class=""><br class="">-    for (BasicBlock::iterator BI = CurrentBlock->begin(),<br class="">-         BE = CurrentBlock->end(); BI != BE; ) {<br class="">-      Instruction *CurInst = BI++;<br class="">+  // Don't do PRE on compares. The PHI would prevent<span class="Apple-converted-space"> </span><br class="">+ CodeGenPrepare<br class="">from<br class="">+  // sinking the compare again, and it would force the code<span class="Apple-converted-space"> </span><br class="">+ generator<br class="">to<br class="">+  // move the i1 from processor flags or predicate registers into<span class="Apple-converted-space"> </span><br class="">+ a<br class="">general<br class="">+  // purpose register.<br class="">+  if (isa<CmpInst>(CurInst))<br class="">+    return false;<br class=""><br class="">-      if (isa<AllocaInst>(CurInst) ||<br class="">-          isa<TerminatorInst>(CurInst) || isa<PHINode>(CurInst) ||<br class="">-          CurInst->getType()->isVoidTy() ||<br class="">-          CurInst->mayReadFromMemory() ||<br class="">CurInst->mayHaveSideEffects()<br class="">||<br class="">-          isa<DbgInfoIntrinsic>(CurInst))<br class="">-        continue;<br class="">+  // We don't currently value number ANY inline asm calls.<br class="">+  if (CallInst *CallI = dyn_cast<CallInst>(CurInst))<br class="">+    if (CallI->isInlineAsm())<br class="">+      return false;<br class=""><br class="">-      // Don't do PRE on compares. The PHI would prevent<br class="">CodeGenPrepare<br class="">from<br class="">-      // sinking the compare again, and it would force the code<br class="">generator to<br class="">-      // move the i1 from processor flags or predicate registers into<br class="">a<br class="">general<br class="">-      // purpose register.<br class="">-      if (isa<CmpInst>(CurInst))<br class="">-        continue;<br class="">+  uint32_t ValNo = VN.lookup(CurInst);<br class=""><br class="">-      // We don't currently value number ANY inline asm calls.<br class="">-      if (CallInst *CallI = dyn_cast<CallInst>(CurInst))<br class="">-        if (CallI->isInlineAsm())<br class="">-          continue;<br class="">+  // Look for the predecessors for PRE opportunities.  We're  //<span class="Apple-converted-space"> </span><br class="">+ only trying to solve the basic diamond case, where  // a value is<span class="Apple-converted-space"> </span><br class="">+ computed in the successor and one predecessor,  // but not the<span class="Apple-converted-space"> </span><br class="">+ other.  We also explicitly disallow cases  // where the successor<span class="Apple-converted-space"> </span><br class="">+ is its own predecessor, because they're  // more complicated to<span class="Apple-converted-space"> </span><br class="">+ get right.<br class="">+  unsigned NumWith = 0;<br class="">+  unsigned NumWithout = 0;<br class="">+  BasicBlock *PREPred = nullptr;<br class="">+  BasicBlock *CurrentBlock = CurInst->getParent();  <br class="">+ predMap.clear();<br class="">+<br class="">+  for (pred_iterator PI = pred_begin(CurrentBlock), PE =<br class="">pred_end(CurrentBlock);<br class="">+       PI != PE; ++PI) {<br class="">+    BasicBlock *P = *PI;<br class="">+    // We're not interested in PRE where the block is its<br class="">+    // own predecessor, or in blocks with predecessors<br class="">+    // that are not reachable.<br class="">+    if (P == CurrentBlock) {<br class="">+      NumWithout = 2;<br class="">+      break;<br class="">+    } else if (!DT->isReachableFromEntry(P)) {<br class="">+      NumWithout = 2;<br class="">+      break;<br class="">+    }<br class=""><br class="">-      uint32_t ValNo = VN.lookup(CurInst);<br class="">+    Value *predV = findLeader(P, ValNo);<br class="">+    if (!predV) {<br class="">+      predMap.push_back(std::make_pair(static_cast<Value<span class="Apple-converted-space"> </span><br class="">+ *>(nullptr),<br class="">P));<br class="">+      PREPred = P;<br class="">+      ++NumWithout;<br class="">+    } else if (predV == CurInst) {<br class="">+      /* CurInst dominates this predecessor. */<br class="">+      NumWithout = 2;<br class="">+      break;<br class="">+    } else {<br class="">+      predMap.push_back(std::make_pair(predV, P));<br class="">+      ++NumWith;<br class="">+    }<br class="">+  }<br class=""><br class="">-      // Look for the predecessors for PRE opportunities.  We're<br class="">-      // only trying to solve the basic diamond case, where<br class="">-      // a value is computed in the successor and one predecessor,<br class="">-      // but not the other.  We also explicitly disallow cases<br class="">-      // where the successor is its own predecessor, because they're<br class="">-      // more complicated to get right.<br class="">-      unsigned NumWith = 0;<br class="">-      unsigned NumWithout = 0;<br class="">-      BasicBlock *PREPred = nullptr;<br class="">-      predMap.clear();<br class="">-<br class="">-      for (pred_iterator PI = pred_begin(CurrentBlock),<br class="">-           PE = pred_end(CurrentBlock); PI != PE; ++PI) {<br class="">-        BasicBlock *P = *PI;<br class="">-        // We're not interested in PRE where the block is its<br class="">-        // own predecessor, or in blocks with predecessors<br class="">-        // that are not reachable.<br class="">-        if (P == CurrentBlock) {<br class="">-          NumWithout = 2;<br class="">-          break;<br class="">-        } else if (!DT->isReachableFromEntry(P))  {<br class="">-          NumWithout = 2;<br class="">-          break;<br class="">-        }<br class="">+  // Don't do PRE when it might increase code size, i.e. when  //<span class="Apple-converted-space"> </span><br class="">+ we would need to insert instructions in more than one pred.<br class="">+  if (NumWithout != 1 || NumWith == 0)<br class="">+    return false;<br class=""><br class="">-        Value* predV = findLeader(P, ValNo);<br class="">-        if (!predV) {<br class="">-          predMap.push_back(std::make_pair(static_cast<Value<br class="">*>(nullptr), P));<br class="">-          PREPred = P;<br class="">-          ++NumWithout;<br class="">-        } else if (predV == CurInst) {<br class="">-          /* CurInst dominates this predecessor. */<br class="">-          NumWithout = 2;<br class="">-          break;<br class="">-        } else {<br class="">-          predMap.push_back(std::make_pair(predV, P));<br class="">-          ++NumWith;<br class="">-        }<br class="">-      }<br class="">+  // Don't do PRE across indirect branch.<br class="">+  if (isa<IndirectBrInst>(PREPred->getTerminator()))<br class="">+    return false;<br class=""><br class="">-      // Don't do PRE when it might increase code size, i.e. when<br class="">-      // we would need to insert instructions in more than one pred.<br class="">-      if (NumWithout != 1 || NumWith == 0)<br class="">-        continue;<br class="">+  // We can't do PRE safely on a critical edge, so instead we<br class="">schedule<br class="">+  // the edge to be split and perform the PRE the next time we<br class="">iterate<br class="">+  // on the function.<br class="">+  unsigned SuccNum = GetSuccessorNumber(PREPred, CurrentBlock);  <br class="">+ if (isCriticalEdge(PREPred->getTerminator(), SuccNum)) {<br class="">+    toSplit.push_back(std::make_pair(PREPred->getTerminator(),<br class="">SuccNum));<br class="">+    return false;<br class="">+  }<br class=""><br class="">-      // Don't do PRE across indirect branch.<br class="">-      if (isa<IndirectBrInst>(PREPred->getTerminator()))<br class="">-        continue;<br class="">+  // Instantiate the expression in the predecessor that lacked it.<br class="">+  // Because we are going top-down through the block, all value<br class="">numbers<br class="">+  // will be available in the predecessor by the time we need them.<br class="">Any<br class="">+  // that weren't originally present will have been instantiated<br class="">earlier<br class="">+  // in this loop.<br class="">+  Instruction *PREInstr = CurInst->clone();  bool success = true;  <br class="">+ for (unsigned i = 0, e = CurInst->getNumOperands(); i != e; ++i) {<br class="">+    Value *Op = PREInstr->getOperand(i);<br class="">+    if (isa<Argument>(Op) || isa<Constant>(Op) ||<br class="">isa<GlobalValue>(Op))<br class="">+      continue;<br class=""><br class="">-      // We can't do PRE safely on a critical edge, so instead we<br class="">schedule<br class="">-      // the edge to be split and perform the PRE the next time we<br class="">iterate<br class="">-      // on the function.<br class="">-      unsigned SuccNum = GetSuccessorNumber(PREPred, CurrentBlock);<br class="">-      if (isCriticalEdge(PREPred->getTerminator(), SuccNum)) {<br class="">-        toSplit.push_back(std::make_pair(PREPred->getTerminator(),<br class="">SuccNum));<br class="">-        continue;<br class="">-      }<br class="">+    if (Value *V = findLeader(PREPred, VN.lookup(Op))) {<br class="">+      PREInstr->setOperand(i, V);<br class="">+    } else {<br class="">+      success = false;<br class="">+      break;<br class="">+    }<br class="">+  }<br class=""><br class="">-      // Instantiate the expression in the predecessor that lacked<br class="">it.<br class="">-      // Because we are going top-down through the block, all value<br class="">numbers<br class="">-      // will be available in the predecessor by the time we need<br class="">them.<br class="">Any<br class="">-      // that weren't originally present will have been instantiated<br class="">earlier<br class="">-      // in this loop.<br class="">-      Instruction *PREInstr = CurInst->clone();<br class="">-      bool success = true;<br class="">-      for (unsigned i = 0, e = CurInst->getNumOperands(); i != e;<br class="">++i)<br class="">{<br class="">-        Value *Op = PREInstr->getOperand(i);<br class="">-        if (isa<Argument>(Op) || isa<Constant>(Op) ||<br class="">isa<GlobalValue>(Op))<br class="">-          continue;<br class="">+  // Fail out if we encounter an operand that is not available in  <br class="">+ // the PRE predecessor.  This is typically because of loads which  <br class="">+ // are not value numbered precisely.<br class="">+  if (!success) {<br class="">+    DEBUG(verifyRemoved(PREInstr));<br class="">+    delete PREInstr;<br class="">+    return false;<br class="">+  }<br class=""><br class="">-        if (Value *V = findLeader(PREPred, VN.lookup(Op))) {<br class="">-          PREInstr->setOperand(i, V);<br class="">-        } else {<br class="">-          success = false;<br class="">-          break;<br class="">-        }<br class="">-      }<br class="">+  PREInstr->insertBefore(PREPred->getTerminator());<br class="">+  PREInstr->setName(CurInst->getName() + ".pre");  <br class="">+ PREInstr->setDebugLoc(CurInst->getDebugLoc());<br class="">+  VN.add(PREInstr, ValNo);<br class="">+  ++NumGVNPRE;<br class="">+<br class="">+  // Update the availability map to include the new instruction.<br class="">+  addToLeaderTable(ValNo, PREInstr, PREPred);<br class="">+<br class="">+  // Create a PHI to make the value available in this block.<br class="">+  PHINode *Phi =<br class="">+      PHINode::Create(CurInst->getType(), predMap.size(),<br class="">+                      CurInst->getName() + ".pre-phi",<br class="">CurrentBlock->begin());<br class="">+  for (unsigned i = 0, e = predMap.size(); i != e; ++i) {<br class="">+    if (Value *V = predMap[i].first)<br class="">+      Phi->addIncoming(V, predMap[i].second);<br class="">+    else<br class="">+      Phi->addIncoming(PREInstr, PREPred);  }<br class=""><br class="">-      // Fail out if we encounter an operand that is not available in<br class="">-      // the PRE predecessor.  This is typically because of loads<br class="">which<br class="">-      // are not value numbered precisely.<br class="">-      if (!success) {<br class="">-        DEBUG(verifyRemoved(PREInstr));<br class="">-        delete PREInstr;<br class="">-        continue;<br class="">-      }<br class="">+  VN.add(Phi, ValNo);<br class="">+  addToLeaderTable(ValNo, Phi, CurrentBlock);  <br class="">+ Phi->setDebugLoc(CurInst->getDebugLoc());<br class="">+  CurInst->replaceAllUsesWith(Phi);  if<span class="Apple-converted-space"> </span><br class="">+ (Phi->getType()->getScalarType()->isPointerTy()) {<br class="">+    // Because we have added a PHI-use of the pointer value, it<span class="Apple-converted-space"> </span><br class="">+ has<br class="">now<br class="">+    // "escaped" from alias analysis' perspective.  We need to inform<br class="">+    // AA of this.<br class="">+    for (unsigned ii = 0, ee = Phi->getNumIncomingValues(); ii !=<span class="Apple-converted-space"> </span><br class="">+ ee;<br class="">++ii) {<br class="">+      unsigned jj = PHINode::getOperandNumForIncomingValue(ii);<br class="">+      VN.getAliasAnalysis()->addEscapingUse(Phi->getOperandUse(jj));<br class="">+    }<br class=""><br class="">-      PREInstr->insertBefore(PREPred->getTerminator());<br class="">-      PREInstr->setName(CurInst->getName() + ".pre");<br class="">-      PREInstr->setDebugLoc(CurInst->getDebugLoc());<br class="">-      VN.add(PREInstr, ValNo);<br class="">-      ++NumGVNPRE;<br class="">-<br class="">-      // Update the availability map to include the new instruction.<br class="">-      addToLeaderTable(ValNo, PREInstr, PREPred);<br class="">-<br class="">-      // Create a PHI to make the value available in this block.<br class="">-      PHINode* Phi = PHINode::Create(CurInst->getType(),<br class="">predMap.size(),<br class="">-                                     CurInst->getName() + ".pre-phi",<br class="">-                                     CurrentBlock->begin());<br class="">-      for (unsigned i = 0, e = predMap.size(); i != e; ++i) {<br class="">-        if (Value *V = predMap[i].first)<br class="">-          Phi->addIncoming(V, predMap[i].second);<br class="">-        else<br class="">-          Phi->addIncoming(PREInstr, PREPred);<br class="">-      }<br class="">-<br class="">-      VN.add(Phi, ValNo);<br class="">-      addToLeaderTable(ValNo, Phi, CurrentBlock);<br class="">-      Phi->setDebugLoc(CurInst->getDebugLoc());<br class="">-      CurInst->replaceAllUsesWith(Phi);<br class="">-      if (Phi->getType()->getScalarType()->isPointerTy()) {<br class="">-        // Because we have added a PHI-use of the pointer value, it<br class="">has<br class="">now<br class="">-        // "escaped" from alias analysis' perspective.  We need to<br class="">inform<br class="">-        // AA of this.<br class="">-        for (unsigned ii = 0, ee = Phi->getNumIncomingValues(); ii !=<br class="">ee;<br class="">-             ++ii) {<br class="">-          unsigned jj = PHINode::getOperandNumForIncomingValue(ii);<br class="">-<br class="">VN.getAliasAnalysis()->addEscapingUse(Phi->getOperandUse(jj));<br class="">-        }<br class="">+    if (MD)<br class="">+      MD->invalidateCachedPointerInfo(Phi);<br class="">+  }<br class="">+  VN.erase(CurInst);<br class="">+  removeFromLeaderTable(ValNo, CurInst, CurrentBlock);<br class=""><br class="">-        if (MD)<br class="">-          MD->invalidateCachedPointerInfo(Phi);<br class="">-      }<br class="">-      VN.erase(CurInst);<br class="">-      removeFromLeaderTable(ValNo, CurInst, CurrentBlock);<br class="">+  DEBUG(dbgs() << "GVN PRE removed: " << *CurInst << '\n');<br class="">+  if (MD)<br class="">+    MD->removeInstruction(CurInst);<br class="">+  DEBUG(verifyRemoved(CurInst));<br class="">+  CurInst->eraseFromParent();<br class="">+  return true;<br class="">+}<br class="">+<br class="">+/// performPRE - Perform a purely local form of PRE that looks for<br class="">diamond<br class="">+/// control flow patterns and attempts to perform simple PRE at<span class="Apple-converted-space"> </span><br class="">+the<br class="">join point.<br class="">+bool GVN::performPRE(Function &F) {<br class="">+  bool Changed = false;<br class="">+  for (BasicBlock *CurrentBlock : depth_first(&F.getEntryBlock())) {<br class="">+    // Nothing to PRE in the entry block.<br class="">+    if (CurrentBlock == &F.getEntryBlock())<br class="">+      continue;<br class=""><br class="">-      DEBUG(dbgs() << "GVN PRE removed: " << *CurInst << '\n');<br class="">-      if (MD) MD->removeInstruction(CurInst);<br class="">-      DEBUG(verifyRemoved(CurInst));<br class="">-      CurInst->eraseFromParent();<br class="">-      Changed = true;<br class="">+    // Don't perform PRE on a landing pad.<br class="">+    if (CurrentBlock->isLandingPad())<br class="">+      continue;<br class="">+<br class="">+    for (BasicBlock::iterator BI = CurrentBlock->begin(),<br class="">+                              BE = CurrentBlock->end();<br class="">+         BI != BE;) {<br class="">+      Instruction *CurInst = BI++;<br class="">+      Changed = performScalarPRE(CurInst);<br class="">  }<br class="">}<br class=""><br class="">@@ -2637,25 +2655,21 @@ bool GVN::iterateOnFunction(Function &F)<br class=""><br class="">// Top-down walk of the dominator tree  bool Changed = false; -#if<span class="Apple-converted-space"> </span><br class="">0<br class="">-  // Needed for value numbering with phi construction to work.<br class="">-  ReversePostOrderTraversal<Function*> RPOT(&F);<br class="">-  for (ReversePostOrderTraversal<Function*>::rpo_iterator RI =<span class="Apple-converted-space"> </span><br class="">RPOT.begin(),<br class="">-       RE = RPOT.end(); RI != RE; ++RI)<br class="">-    Changed |= processBlock(*RI);<br class="">-#else<br class="">// Save the blocks this function have before transformation begins.<br class="">GVN may<br class="">// split critical edge, and hence may invalidate the RPO/DT iterator.<br class="">//<br class="">std::vector<BasicBlock *> BBVect;<br class="">BBVect.reserve(256);<br class="">-  for (DomTreeNode *X : depth_first(DT->getRootNode()))<br class="">-    BBVect.push_back(X->getBlock());<br class="">+  // Needed for value numbering with phi construction to work.<br class="">+  ReversePostOrderTraversal<Function *> RPOT(&F);  for<span class="Apple-converted-space"> </span><br class="">+ (ReversePostOrderTraversal<Function *>::rpo_iterator RI =<br class="">RPOT.begin(),<br class="">+                                                           RE =<br class="">RPOT.end();<br class="">+       RI != RE; ++RI)<br class="">+    BBVect.push_back(*RI);<br class=""><br class="">for (std::vector<BasicBlock *>::iterator I = BBVect.begin(), E =<span class="Apple-converted-space"> </span><br class="">BBVect.end();<br class="">     I != E; I++)<br class="">  Changed |= processBlock(*I);<br class="">-#endif<br class=""><br class="">return Changed;<br class="">}<br class=""><br class="">Modified:<br class="">llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-m<br class="">ismatch.ll<br class="">URL:<br class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/TypeBa<br class="">sedAliasAnalysis/gvn-nonlocal-type-mismatch.ll?rev=222039&r1=222038<br class="">&r2=222039&view=diff<span class="Apple-converted-space"> </span><br class="">===================================================================<br class="">===========<br class="">---<br class="">llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-m<br class="">ismatch.ll<br class="">(original)<br class="">+++<br class="">llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-m<br class="">ismatch.ll<br class="">Fri Nov 14 15:09:13 2014<br class="">@@ -46,12 +46,12 @@ entry:<br class="">br i1 %c, label %if.else, label %if.then<br class=""><br class="">if.then:<br class="">-  %t = load i32* %p, !tbaa !4<br class="">+  %t = load i32* %p, !tbaa !3<br class="">store i32 %t, i32* %q<br class="">ret void<br class=""><br class="">if.else:<br class="">-  %u = load i32* %p, !tbaa !3<br class="">+  %u = load i32* %p, !tbaa !4<br class="">store i32 %u, i32* %q<br class="">ret void<br class="">}<br class="">@@ -61,11 +61,11 @@ if.else:<br class=""><br class="">; CHECK: @watch_out_for_another_type_change<br class="">; CHECK: if.then:<br class="">-; CHECK:   %t = load i32* %p<br class="">-; CHECK:   store i32 %t, i32* %q<br class="">+; CHECK:   store i32 0, i32* %q<br class="">; CHECK:   ret void<br class="">; CHECK: if.else:<br class="">-; CHECK:   store i32 0, i32* %q<br class="">+; CHECK:   %u = load i32* %p<br class="">+; CHECK:   store i32 %u, i32* %q<br class=""><br class="">define void @watch_out_for_another_type_change(i1 %c, i32* %p, i32*<span class="Apple-converted-space"> </span><br class="">%p1,<br class="">i32* %q) nounwind {<br class="">entry:<br class="">@@ -74,12 +74,12 @@ entry:<br class="">br i1 %c, label %if.else, label %if.then<br class=""><br class="">if.then:<br class="">-  %t = load i32* %p, !tbaa !3<br class="">+  %t = load i32* %p, !tbaa !4<br class="">store i32 %t, i32* %q<br class="">ret void<br class=""><br class="">if.else:<br class="">-  %u = load i32* %p, !tbaa !4<br class="">+  %u = load i32* %p, !tbaa !3<br class="">store i32 %u, i32* %q<br class="">ret void<br class="">}<br class=""><br class="">Added: llvm/trunk/test/Transforms/GVN/pre-gep-load.ll<br class="">URL:<br class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/<br class="">pre-gep-load.ll?rev=222039&view=auto<br class="">===================================================================<br class="">===========<br class="">--- llvm/trunk/test/Transforms/GVN/pre-gep-load.ll (added)<br class="">+++ llvm/trunk/test/Transforms/GVN/pre-gep-load.ll Fri Nov 14<span class="Apple-converted-space"> </span><br class="">+++ 15:09:13<br class="">2014<br class="">@@ -0,0 +1,49 @@<br class="">+; RUN: opt < %s -basicaa -gvn -enable-load-pre -S | FileCheck %s<span class="Apple-converted-space"> </span><br class="">+target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"<br class="">+target triple = "aarch64--linux-gnu"<br class="">+<br class="">+define double @foo(i32 %stat, i32 %i, double** %p) { ;<span class="Apple-converted-space"> </span><br class="">+CHECK-LABEL: @foo(<br class="">+entry:<br class="">+  switch i32 %stat, label %sw.default [<br class="">+    i32 0, label %sw.bb<br class="">+    i32 1, label %sw.bb<br class="">+    i32 2, label %sw.bb2<br class="">+  ]<br class="">+<br class="">+sw.bb:                                            ; preds = %entry,<br class="">%entry<br class="">+  %idxprom = sext i32 %i to i64<br class="">+  %arrayidx = getelementptr inbounds double** %p, i64 0<br class="">+  %0 = load double** %arrayidx, align 8<br class="">+  %arrayidx1 = getelementptr inbounds double* %0, i64 %idxprom<br class="">+  %1 = load double* %arrayidx1, align 8  %sub = fsub double %1,<span class="Apple-converted-space"> </span><br class="">+ 1.000000e+00  %cmp = fcmp olt double %sub, 0.000000e+00  br i1<span class="Apple-converted-space"> </span><br class="">+ %cmp, label %if.then, label %if.end<br class="">+<br class="">+if.then:                                          ; preds = %sw.bb<br class="">+  br label %return<br class="">+<br class="">+if.end:                                           ; preds = %sw.bb<br class="">+  br label %sw.bb2<br class="">+<br class="">+sw.bb2:                                           ; preds = %if.end,<br class="">%entry<br class="">+  %idxprom3 = sext i32 %i to i64<br class="">+  %arrayidx4 = getelementptr inbounds double** %p, i64 0<br class="">+  %2 = load double** %arrayidx4, align 8<br class="">+  %arrayidx5 = getelementptr inbounds double* %2, i64 %idxprom3<br class="">+  %3 = load double* %arrayidx5, align 8 ; CHECK: sw.bb2:<br class="">+; CHECK-NEXT-NOT: sext<br class="">+; CHECK-NEXT: phi double [<br class="">+; CHECK-NOT: load<br class="">+  %sub6 = fsub double 3.000000e+00, %3<br class="">+  br label %return<br class="">+<br class="">+sw.default:                                       ; preds = %entry<br class="">+  br label %return<br class="">+<br class="">+return:                                           ; preds =<br class="">%sw.default, %sw.bb2, %if.then<br class="">+  %retval.0 = phi double [ 0.000000e+00, %sw.default ], [ %sub6,<br class="">%sw.bb2 ], [ %sub, %if.then ]<br class="">+  ret double %retval.0<br class="">+}<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class="">llvm-commits@cs.uiuc.edu<br class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br class=""></blockquote><br class=""><br class=""></blockquote><br class=""><br class=""></blockquote><br class=""><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span id="cid:5585EC04-4F38-488E-BCA7-54558DD2B7A1@apple.com"><0001-Reapply-r221924-GVN-Perform-Scalar-PRE-on-gep-indice.patch></span></div></blockquote></div><br class=""></body></html>