<div dir="ltr">Thank you, Maxim!<div>Sent out <a href="https://reviews.llvm.org/D50422" rel="noreferrer" target="_blank" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:12.8px;background-color:rgb(255,255,255)">https://reviews.llvm.org/D50422</a>.</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 7, 2018 at 7:25 PM Maxim Kazantsev <<a href="mailto:max.kazantsev@azul.com">max.kazantsev@azul.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="RU" link="blue" vlink="purple">
<div class="m_-6786037660875698025WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hi Alina,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">We've faced a bunch of similar issues before, and I believe that this can be just one another example. The story is following:
 after we've improved calculation of exact backedge taken count for loops, the algorithm started considering exiting blocks of inner loops in calculation of exit count of outer loops, which did not happen before because of old algorithm's limitation. Therefore,
 whenever we make changes to exiting blocks of inner loops or their exit conditions, we also may need to update all loops that contain it.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I believe that the function you need is "forgetTopmostLoop". We've fixed it in many passes, but apparently still not in
 all of them. Try calling it instead of forgetLoop, it should help your example. I will gladly review the fix patch.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Max<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Alina Sbirlea [mailto:<a href="mailto:asbirlea@google.com" target="_blank">asbirlea@google.com</a>]
<br>
<b>Sent:</b> Wednesday, August 8, 2018 5:00 AM<br>
<b>To:</b> <a href="mailto:mikael.holmen@ericsson.com" target="_blank">mikael.holmen@ericsson.com</a>; Maxim Kazantsev <<a href="mailto:max.kazantsev@azul.com" target="_blank">max.kazantsev@azul.com</a>><br>
<b>Cc:</b> llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>><br>
<b>Subject:</b> Re: [llvm] r335183 - Generalize MergeBlockIntoPredecessor. Replace uses of MergeBasicBlockIntoOnlyPred.<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">FWIW, the assertion is no longer triggered with invalidating the parent loop in ScEv in this particular case.<u></u><u></u></p>
<div>
<p class="MsoNormal">I'm not clear of the larger scope yet though, e.g. how loop nesting can change in general; and, does this require updating LoopInfo too?<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="m_-6786037660875698025gmail-p1" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="m_-6786037660875698025gmail-s1"><b><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">diff --git a/lib/Transforms/Scalar/LoopSimplifyCFG.cpp b/lib/Transforms/Scalar/LoopSimplifyCFG.cpp</span></b></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><u></u><u></u></span></p>
<p class="m_-6786037660875698025gmail-p1" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="m_-6786037660875698025gmail-s1"><b><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">index 3f31d8efeb4..dd36468696a 100644</span></b></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><u></u><u></u></span></p>
<p class="m_-6786037660875698025gmail-p1" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="m_-6786037660875698025gmail-s1"><b><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">--- a/lib/Transforms/Scalar/LoopSimplifyCFG.cpp</span></b></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><u></u><u></u></span></p>
<p class="m_-6786037660875698025gmail-p1" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="m_-6786037660875698025gmail-s1"><b><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">+++ b/lib/Transforms/Scalar/LoopSimplifyCFG.cpp</span></b></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><u></u><u></u></span></p>
<p class="m_-6786037660875698025gmail-p1" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="m_-6786037660875698025gmail-s2"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:#33bbc8">@@ -62,6 +62,7 @@</span></span><span class="m_-6786037660875698025gmail-s1"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"> static bool simplifyLoopCFG(Loop &L, DominatorTree
 &DT, LoopInfo &LI,</span></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><u></u><u></u></span></p>
<p class="m_-6786037660875698025gmail-p1" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="m_-6786037660875698025gmail-apple-converted-space"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">    
</span></span><span class="m_-6786037660875698025gmail-s1"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">MergeBlockIntoPredecessor(Succ, &DTU, &LI);</span></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><u></u><u></u></span></p>
<p class="m_-6786037660875698025gmail-p2" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;min-height:13px">
<span class="m_-6786037660875698025gmail-apple-converted-space"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"> </span></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><u></u><u></u></span></p>
<p class="m_-6786037660875698025gmail-p1" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="m_-6786037660875698025gmail-apple-converted-space"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">    
</span></span><span class="m_-6786037660875698025gmail-s1"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">SE.forgetLoop(&L);</span></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><u></u><u></u></span></p>
<p class="m_-6786037660875698025gmail-p3" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="m_-6786037660875698025gmail-s1"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:#34bc26">+</span></span><span class="m_-6786037660875698025gmail-apple-converted-space"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:#34bc26">   
</span></span><span class="m_-6786037660875698025gmail-s1"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:#34bc26">SE.forgetLoop(L.getParentLoop());</span></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:#34bc26"><u></u><u></u></span></p>
<p class="m_-6786037660875698025gmail-p1" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="m_-6786037660875698025gmail-apple-converted-space"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">    
</span></span><span class="m_-6786037660875698025gmail-s1"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">Changed = true;</span></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><u></u><u></u></span></p>
<p class="m_-6786037660875698025gmail-p1" style="margin:0cm;margin-bottom:.0001pt;background:white;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="m_-6786037660875698025gmail-apple-converted-space"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">  
</span></span><span class="m_-6786037660875698025gmail-s1"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">}</span></span><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Tue, Aug 7, 2018 at 2:30 PM Alina Sbirlea <<a href="mailto:asbirlea@google.com" target="_blank">asbirlea@google.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">This looks like an issue in ScEv, looking into it. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">+CC Maxim Kazantsev who may have more background than me and faster turn-around.<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Tue, Aug 7, 2018 at 6:49 AM Mikael Holmén <<a href="mailto:mikael.holmen@ericsson.com" target="_blank">mikael.holmen@ericsson.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Hi Alina,<br>
<br>
I've found a case that hits an assertion with your commit. If I do<br>
<br>
  opt -S -o - bbi-16360.ll -loop-idiom -verify -loop-simplifycfg -loop-idiom<br>
<br>
I get<br>
<br>
opt: ../include/llvm/IR/ValueHandle.h:494: ValueTy <br>
*llvm::PoisoningVH<llvm::BasicBlock>::getValPtr() const [ValueTy = <br>
llvm::BasicBlock]: Assertion `!Poisoned && "Accessed a poisoned value <br>
handle!"' failed.<br>
Stack dump:<br>
0.      Program arguments: /data/repo/llvm-patch/build-all/bin/opt -S -o <br>
- bbi-16360.ll -loop-idiom -verify -loop-simplifycfg -loop-idiom<br>
1.      Running pass 'Function Pass Manager' on module 'bbi-16360.ll'.<br>
2.      Running pass 'Loop Pass Manager' on function '@f1'<br>
3.      Running pass 'Recognize loop idioms' on basic block '%lbl1'<br>
#0 0x0000000002085c94 PrintStackTraceSignalHandler(void*) <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x2085c94)<br>
#1 0x0000000002083df0 llvm::sys::RunSignalHandlers() <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x2083df0)<br>
#2 0x0000000002085ff8 SignalHandler(int) <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x2085ff8)<br>
#3 0x00007f47ba77a330 __restore_rt <br>
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)<br>
#4 0x00007f47b9369c37 gsignal <br>
/build/eglibc-ripdx6/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0<br>
#5 0x00007f47b936d028 abort <br>
/build/eglibc-ripdx6/eglibc-2.19/stdlib/abort.c:91:0<br>
#6 0x00007f47b9362bf6 __assert_fail_base <br>
/build/eglibc-ripdx6/eglibc-2.19/assert/assert.c:92:0<br>
#7 0x00007f47b9362ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)<br>
#8 0x000000000160feca <br>
llvm::ScalarEvolution::BackedgeTakenInfo::getExact(llvm::Loop const*, <br>
llvm::ScalarEvolution*, llvm::SCEVUnionPredicate*) const <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x160feca)<br>
#9 0x000000000162a69f <br>
llvm::ScalarEvolution::hasLoopInvariantBackedgeTakenCount(llvm::Loop <br>
const*) (/data/repo/llvm-patch/build-all/bin/opt+0x162a69f)<br>
#10 0x0000000001eb153e (anonymous <br>
namespace)::LoopIdiomRecognize::runOnLoop(llvm::Loop*) <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x1eb153e)<br>
#11 0x0000000001eba15b (anonymous <br>
namespace)::LoopIdiomRecognizeLegacyPass::runOnLoop(llvm::Loop*, <br>
llvm::LPPassManager&) (/data/repo/llvm-patch/build-all/bin/opt+0x1eba15b)<br>
#12 0x0000000001590e64 <br>
llvm::LPPassManager::runOnFunction(llvm::Function&) <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x1590e64)<br>
#13 0x0000000001af7273 <br>
llvm::FPPassManager::runOnFunction(llvm::Function&) <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x1af7273)<br>
#14 0x0000000001af7488 llvm::FPPassManager::runOnModule(llvm::Module&) <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x1af7488)<br>
#15 0x0000000001af793a llvm::legacy::PassManagerImpl::run(llvm::Module&) <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x1af793a)<br>
#16 0x0000000000754e44 main <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x754e44)<br>
#17 0x00007f47b9354f45 __libc_start_main <br>
/build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:321:0<br>
#18 0x000000000073d58d _start <br>
(/data/repo/llvm-patch/build-all/bin/opt+0x73d58d)<br>
Abort<br>
<br>
It starts crashing with your commit and it still crashes on trunk today.<br>
<br>
Regards,<br>
Mikael<br>
<br>
On 06/21/2018 12:01 AM, Alina Sbirlea via llvm-commits wrote:<br>
> Author: asbirlea<br>
> Date: Wed Jun 20 15:01:04 2018<br>
> New Revision: 335183<br>
> <br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=335183&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=335183&view=rev</a><br>
> Log:<br>
> Generalize MergeBlockIntoPredecessor. Replace uses of MergeBasicBlockIntoOnlyPred.<br>
> <br>
> Summary:<br>
> Two utils methods have essentially the same functionality. This is an attempt to merge them into one.<br>
> 1. lib/Transforms/Utils/Local.cpp : MergeBasicBlockIntoOnlyPred<br>
> 2. lib/Transforms/Utils/BasicBlockUtils.cpp : MergeBlockIntoPredecessor<br>
> <br>
> Prior to the patch:<br>
> 1. MergeBasicBlockIntoOnlyPred<br>
> Updates either DomTree or DeferredDominance<br>
> Moves all instructions from Pred to BB, deletes Pred<br>
> Asserts BB has single predecessor<br>
> If address was taken, replace the block address with constant 1 (?)<br>
> <br>
> 2. MergeBlockIntoPredecessor<br>
> Updates DomTree, LoopInfo and MemoryDependenceResults<br>
> Moves all instruction from BB to Pred, deletes BB<br>
> Returns if doesn't have a single predecessor<br>
> Returns if BB's address was taken<br>
> <br>
> After the patch:<br>
> Method 2. MergeBlockIntoPredecessor is attempting to become the new default:<br>
> Updates DomTree or DeferredDominance, and LoopInfo and MemoryDependenceResults<br>
> Moves all instruction from BB to Pred, deletes BB<br>
> Returns if doesn't have a single predecessor<br>
> Returns if BB's address was taken<br>
> <br>
> Uses of MergeBasicBlockIntoOnlyPred that need to be replaced:<br>
> <br>
> 1. lib/Transforms/Scalar/LoopSimplifyCFG.cpp<br>
> Updated in this patch. No challenges.<br>
> <br>
> 2. lib/CodeGen/CodeGenPrepare.cpp<br>
> Updated in this patch.<br>
>    i. eliminateFallThrough is straightforward, but I added using a temporary array to avoid the iterator invalidation.<br>
>    ii. eliminateMostlyEmptyBlock(s) methods also now use a temporary array for blocks<br>
> Some interesting aspects:<br>
>    - Since Pred is not deleted (BB is), the entry block does not need updating.<br>
>    - The entry block was being updated with the deleted block in eliminateMostlyEmptyBlock. Added assert to make obvious that BB=SinglePred.<br>
>    - isMergingEmptyBlockProfitable assumes BB is the one to be deleted.<br>
>    - eliminateMostlyEmptyBlock(BB) does not delete BB on one path, it deletes its unique predecessor instead.<br>
>    - adding some test owner as subscribers for the interesting tests modified:<br>
>      test/CodeGen/X86/avx-cmp.ll<br>
>      test/CodeGen/AMDGPU/nested-loop-conditions.ll<br>
>      test/CodeGen/AMDGPU/si-annotate-cf.ll<br>
>      test/CodeGen/X86/hoist-spill.ll<br>
>      test/CodeGen/X86/2006-11-17-IllegalMove.ll<br>
> <br>
> 3. lib/Transforms/Scalar/JumpThreading.cpp<br>
> Not covered in this patch. It is the only use case using the DeferredDominance.<br>
> I would defer to Brian Rzycki to make this replacement.<br>
> <br>
> Reviewers: chandlerc, spatel, davide, brzycki, bkramer, javed.absar<br>
> <br>
> Subscribers: qcolombet, sanjoy, nemanjai, nhaehnle, jlebar, tpr, kbarton, RKSimon, wmi, arsenm, llvm-commits<br>
> <br>
> Differential Revision: <a href="https://reviews.llvm.org/D48202" target="_blank">
https://reviews.llvm.org/D48202</a><br>
> <br>
> Modified:<br>
>      llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h<br>
>      llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp<br>
>      llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp<br>
>      llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp<br>
>      llvm/trunk/test/CodeGen/AMDGPU/branch-relaxation.ll<br>
>      llvm/trunk/test/CodeGen/AMDGPU/nested-loop-conditions.ll<br>
>      llvm/trunk/test/CodeGen/AMDGPU/si-annotate-cf.ll<br>
>      llvm/trunk/test/CodeGen/ARM/indirectbr.ll<br>
>      llvm/trunk/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll<br>
>      llvm/trunk/test/CodeGen/PowerPC/memcmp-mergeexpand.ll<br>
>      llvm/trunk/test/CodeGen/PowerPC/ppc-shrink-wrapping.ll<br>
>      llvm/trunk/test/CodeGen/PowerPC/simplifyConstCmpToISEL.ll<br>
>      llvm/trunk/test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll<br>
>      llvm/trunk/test/CodeGen/Thumb2/thumb2-jtb.ll<br>
>      llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll<br>
>      llvm/trunk/test/CodeGen/X86/avx-cmp.ll<br>
>      llvm/trunk/test/CodeGen/X86/avx-splat.ll<br>
>      llvm/trunk/test/CodeGen/X86/avx2-vbroadcast.ll<br>
>      llvm/trunk/test/CodeGen/X86/avx512-i1test.ll<br>
>      llvm/trunk/test/CodeGen/X86/block-placement.ll<br>
>      llvm/trunk/test/CodeGen/X86/hoist-spill.ll<br>
>      llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-1.ll<br>
>      llvm/trunk/test/CodeGen/X86/memcmp-mergeexpand.ll<br>
>      llvm/trunk/test/CodeGen/X86/pr32108.ll<br>
>      llvm/trunk/test/CodeGen/X86/setcc-lowering.ll<br>
>      llvm/trunk/test/CodeGen/X86/split-store.ll<br>
>      llvm/trunk/test/CodeGen/X86/tail-dup-merge-loop-headers.ll<br>
>      llvm/trunk/test/DebugInfo/Generic/sunk-compare.ll<br>
>      llvm/trunk/test/Transforms/CodeGenPrepare/X86/computedgoto.ll<br>
>      llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll<br>
>      llvm/trunk/test/Transforms/LoopSimplifyCFG/scev.ll<br>
>      llvm/trunk/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll<br>
>      llvm/trunk/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll<br>
>      llvm/trunk/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-iteration.ll<br>
> <br>
> Modified: llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h (original)<br>
> +++ llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h Wed Jun 20 15:01:04 2018<br>
> @@ -58,7 +58,8 @@ bool DeleteDeadPHIs(BasicBlock *BB, cons<br>
>   /// value indicates success or failure.<br>
>   bool MergeBlockIntoPredecessor(BasicBlock *BB, DominatorTree *DT = nullptr,<br>
>                                  LoopInfo *LI = nullptr,<br>
> -                               MemoryDependenceResults *MemDep = nullptr);<br>
> +                               MemoryDependenceResults *MemDep = nullptr,<br>
> +                               DeferredDominance *DDT = nullptr);<br>
>   <br>
>   /// Replace all uses of an instruction (specified by BI) with a value, then<br>
>   /// remove and delete the original instruction.<br>
> <br>
> Modified: llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp (original)<br>
> +++ llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp Wed Jun 20 15:01:04 2018<br>
> @@ -516,8 +516,16 @@ bool CodeGenPrepare::runOnFunction(Funct<br>
>   bool CodeGenPrepare::eliminateFallThrough(Function &F) {<br>
>     bool Changed = false;<br>
>     // Scan all of the blocks in the function, except for the entry block.<br>
> -  for (Function::iterator I = std::next(F.begin()), E = F.end(); I != E;) {<br>
> -    BasicBlock *BB = &*I++;<br>
> +  // Use a temporary array to avoid iterator being invalidated when<br>
> +  // deleting blocks.<br>
> +  SmallVector<WeakTrackingVH, 16> Blocks;<br>
> +  for (auto &Block : llvm::make_range(std::next(F.begin()), F.end()))<br>
> +    Blocks.push_back(&Block);<br>
> +<br>
> +  for (auto &Block : Blocks) {<br>
> +    auto *BB = cast_or_null<BasicBlock>(Block);<br>
> +    if (!BB)<br>
> +      continue;<br>
>       // If the destination block has a single pred, then this is a trivial<br>
>       // edge, just collapse it.<br>
>       BasicBlock *SinglePred = BB->getSinglePredecessor();<br>
> @@ -528,17 +536,10 @@ bool CodeGenPrepare::eliminateFallThroug<br>
>       BranchInst *Term = dyn_cast<BranchInst>(SinglePred->getTerminator());<br>
>       if (Term && !Term->isConditional()) {<br>
>         Changed = true;<br>
> -      LLVM_DEBUG(dbgs() << "To merge:\n" << *SinglePred << "\n\n\n");<br>
> -      // Remember if SinglePred was the entry block of the function.<br>
> -      // If so, we will need to move BB back to the entry position.<br>
> -      bool isEntry = SinglePred == &SinglePred->getParent()->getEntryBlock();<br>
> -      MergeBasicBlockIntoOnlyPred(BB, nullptr);<br>
> -<br>
> -      if (isEntry && BB != &BB->getParent()->getEntryBlock())<br>
> -        BB->moveBefore(&BB->getParent()->getEntryBlock());<br>
> +      LLVM_DEBUG(dbgs() << "To merge:\n" << *BB << "\n\n\n");<br>
>   <br>
> -      // We have erased a block. Update the iterator.<br>
> -      I = BB->getIterator();<br>
> +      // Merge BB into SinglePred and delete it.<br>
> +      MergeBlockIntoPredecessor(BB);<br>
>       }<br>
>     }<br>
>     return Changed;<br>
> @@ -591,9 +592,17 @@ bool CodeGenPrepare::eliminateMostlyEmpt<br>
>     }<br>
>   <br>
>     bool MadeChange = false;<br>
> +  // Copy blocks into a temporary array to avoid iterator invalidation issues<br>
> +  // as we remove them.<br>
>     // Note that this intentionally skips the entry block.<br>
> -  for (Function::iterator I = std::next(F.begin()), E = F.end(); I != E;) {<br>
> -    BasicBlock *BB = &*I++;<br>
> +  SmallVector<WeakTrackingVH, 16> Blocks;<br>
> +  for (auto &Block : llvm::make_range(std::next(F.begin()), F.end()))<br>
> +    Blocks.push_back(&Block);<br>
> +<br>
> +  for (auto &Block : Blocks) {<br>
> +    BasicBlock *BB = cast_or_null<BasicBlock>(Block);<br>
> +    if (!BB)<br>
> +      continue;<br>
>       BasicBlock *DestBB = findDestBlockOfMergeableEmptyBlock(BB);<br>
>       if (!DestBB ||<br>
>           !isMergingEmptyBlockProfitable(BB, DestBB, Preheaders.count(BB)))<br>
> @@ -762,15 +771,13 @@ void CodeGenPrepare::eliminateMostlyEmpt<br>
>     // just collapse it.<br>
>     if (BasicBlock *SinglePred = DestBB->getSinglePredecessor()) {<br>
>       if (SinglePred != DestBB) {<br>
> -      // Remember if SinglePred was the entry block of the function.  If so, we<br>
> -      // will need to move BB back to the entry position.<br>
> -      bool isEntry = SinglePred == &SinglePred->getParent()->getEntryBlock();<br>
> -      MergeBasicBlockIntoOnlyPred(DestBB, nullptr);<br>
> -<br>
> -      if (isEntry && BB != &BB->getParent()->getEntryBlock())<br>
> -        BB->moveBefore(&BB->getParent()->getEntryBlock());<br>
> -<br>
> -      LLVM_DEBUG(dbgs() << "AFTER:\n" << *DestBB << "\n\n\n");<br>
> +      assert(SinglePred == BB &&<br>
> +             "Single predecessor not the same as predecessor");<br>
> +      // Merge DestBB into SinglePred/BB and delete it.<br>
> +      MergeBlockIntoPredecessor(DestBB);<br>
> +      // Note: BB(=SinglePred) will not be deleted on this path.<br>
> +      // DestBB(=its single successor) is the one that was deleted.<br>
> +      LLVM_DEBUG(dbgs() << "AFTER:\n" << *SinglePred << "\n\n\n");<br>
>         return;<br>
>       }<br>
>     }<br>
> <br>
> Modified: llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp (original)<br>
> +++ llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp Wed Jun 20 15:01:04 2018<br>
> @@ -27,11 +27,12 @@<br>
>   #include "llvm/Analysis/ScalarEvolution.h"<br>
>   #include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"<br>
>   #include "llvm/Analysis/TargetTransformInfo.h"<br>
> -#include "llvm/Transforms/Utils/Local.h"<br>
>   #include "llvm/IR/Dominators.h"<br>
>   #include "llvm/Transforms/Scalar.h"<br>
>   #include "llvm/Transforms/Scalar/LoopPassManager.h"<br>
>   #include "llvm/Transforms/Utils.h"<br>
> +#include "llvm/Transforms/Utils/BasicBlockUtils.h"<br>
> +#include "llvm/Transforms/Utils/Local.h"<br>
>   #include "llvm/Transforms/Utils/LoopUtils.h"<br>
>   using namespace llvm;<br>
>   <br>
> @@ -55,11 +56,8 @@ static bool simplifyLoopCFG(Loop &L, Dom<br>
>       if (!Pred || !Pred->getSingleSuccessor() || LI.getLoopFor(Pred) != &L)<br>
>         continue;<br>
>   <br>
> -    // Pred is going to disappear, so we need to update the loop info.<br>
> -    if (L.getHeader() == Pred)<br>
> -      L.moveToHeader(Succ);<br>
> -    LI.removeBlock(Pred);<br>
> -    MergeBasicBlockIntoOnlyPred(Succ, &DT);<br>
> +    // Merge Succ into Pred and delete it.<br>
> +    MergeBlockIntoPredecessor(Succ, &DT, &LI);<br>
>   <br>
>       SE.forgetLoop(&L);<br>
>       Changed = true;<br>
> <br>
> Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original)<br>
> +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Wed Jun 20 15:01:04 2018<br>
> @@ -117,9 +117,12 @@ bool llvm::DeleteDeadPHIs(BasicBlock *BB<br>
>   <br>
>   bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, DominatorTree *DT,<br>
>                                        LoopInfo *LI,<br>
> -                                     MemoryDependenceResults *MemDep) {<br>
> -  // Don't merge away blocks who have their address taken.<br>
> -  if (BB->hasAddressTaken()) return false;<br>
> +                                     MemoryDependenceResults *MemDep,<br>
> +                                     DeferredDominance *DDT) {<br>
> +  assert(!(DT && DDT) && "Cannot call with both DT and DDT.");<br>
> +<br>
> +  if (BB->hasAddressTaken())<br>
> +    return false;<br>
>   <br>
>     // Can't merge if there are multiple predecessors, or no predecessors.<br>
>     BasicBlock *PredBB = BB->getUniquePredecessor();<br>
> @@ -131,16 +134,9 @@ bool llvm::MergeBlockIntoPredecessor(Bas<br>
>     if (PredBB->getTerminator()->isExceptional())<br>
>       return false;<br>
>   <br>
> -  succ_iterator SI(succ_begin(PredBB)), SE(succ_end(PredBB));<br>
> -  BasicBlock *OnlySucc = BB;<br>
> -  for (; SI != SE; ++SI)<br>
> -    if (*SI != OnlySucc) {<br>
> -      OnlySucc = nullptr;     // There are multiple distinct successors!<br>
> -      break;<br>
> -    }<br>
> -<br>
> -  // Can't merge if there are multiple successors.<br>
> -  if (!OnlySucc) return false;<br>
> +  // Can't merge if there are multiple distinct successors.<br>
> +  if (PredBB->getUniqueSuccessor() != BB)<br>
> +    return false;<br>
>   <br>
>     // Can't merge if there is PHI loop.<br>
>     for (PHINode &PN : BB->phis())<br>
> @@ -158,6 +154,18 @@ bool llvm::MergeBlockIntoPredecessor(Bas<br>
>       FoldSingleEntryPHINodes(BB, MemDep);<br>
>     }<br>
>   <br>
> +  // Deferred DT update: Collect all the edges that exit BB. These<br>
> +  // dominator edges will be redirected from Pred.<br>
> +  std::vector<DominatorTree::UpdateType> Updates;<br>
> +  if (DDT) {<br>
> +    Updates.reserve(1 + (2 * succ_size(BB)));<br>
> +    Updates.push_back({DominatorTree::Delete, PredBB, BB});<br>
> +    for (auto I = succ_begin(BB), E = succ_end(BB); I != E; ++I) {<br>
> +      Updates.push_back({DominatorTree::Delete, BB, *I});<br>
> +      Updates.push_back({DominatorTree::Insert, PredBB, *I});<br>
> +    }<br>
> +  }<br>
> +<br>
>     // Delete the unconditional branch from the predecessor...<br>
>     PredBB->getInstList().pop_back();<br>
>   <br>
> @@ -204,7 +212,12 @@ bool llvm::MergeBlockIntoPredecessor(Bas<br>
>     if (MemDep)<br>
>       MemDep->invalidateCachedPredecessors();<br>
>   <br>
> -  BB->eraseFromParent();<br>
> +  if (DDT) {<br>
> +    DDT->deleteBB(BB); // Deferred deletion of BB.<br>
> +    DDT->applyUpdates(Updates);<br>
> +  } else {<br>
> +    BB->eraseFromParent(); // Nuke BB.<br>
> +  }<br>
>     return true;<br>
>   }<br>
>   <br>
> <br>
> Modified: llvm/trunk/test/CodeGen/AMDGPU/branch-relaxation.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/branch-relaxation.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/branch-relaxation.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/AMDGPU/branch-relaxation.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/AMDGPU/branch-relaxation.ll Wed Jun 20 15:01:04 2018<br>
> @@ -441,7 +441,7 @@ endif:<br>
>   ; GCN-NEXT: s_xor_b64 exec, exec, [[TEMP_MASK1]]<br>
>   ; GCN-NEXT: ; mask branch [[RET:BB[0-9]+_[0-9]+]]<br>
>   <br>
> -; GCN: [[LOOP_BODY:BB[0-9]+_[0-9]+]]: ; %loop_body<br>
> +; GCN: [[LOOP_BODY:BB[0-9]+_[0-9]+]]: ; %loop<br>
>   ; GCN: ;;#ASMSTART<br>
>   ; GCN: v_nop_e64<br>
>   ; GCN: v_nop_e64<br>
> @@ -452,7 +452,7 @@ endif:<br>
>   ; GCN: ;;#ASMEND<br>
>   ; GCN: s_cbranch_vccz [[RET]]<br>
>   <br>
> -; GCN-NEXT: [[LONGBB:BB[0-9]+_[0-9]+]]: ; %loop_body<br>
> +; GCN-NEXT: [[LONGBB:BB[0-9]+_[0-9]+]]: ; %loop<br>
>   ; GCN-NEXT: ; in Loop: Header=[[LOOP_BODY]] Depth=1<br>
>   ; GCN-NEXT: s_getpc_b64 vcc<br>
>   ; GCN-NEXT: s_sub_u32 vcc_lo, vcc_lo, ([[LONGBB]]+4)-[[LOOP_BODY]]<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/AMDGPU/nested-loop-conditions.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/nested-loop-conditions.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/nested-loop-conditions.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/AMDGPU/nested-loop-conditions.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/AMDGPU/nested-loop-conditions.ll Wed Jun 20 15:01:04 2018<br>
> @@ -59,12 +59,12 @@<br>
>   <br>
>   ; GCN-LABEL: {{^}}reduced_nested_loop_conditions:<br>
>   <br>
> -; GCN: s_cmp_eq_u32 s{{[0-9]+}}, 1<br>
> -; GCN-NEXT: s_cbranch_scc1<br>
> +; GCN: s_cmp_lg_u32 s{{[0-9]+}}, 1<br>
> +; GCN-NEXT: s_cbranch_scc0<br>
>   <br>
>   ; FIXME: Should fold to unconditional branch?<br>
>   ; GCN: ; implicit-def<br>
> -; GCN: s_cbranch_vccz<br>
> +; GCN: s_cbranch_vccnz<br>
>   <br>
>   ; GCN: ds_read_b32<br>
>   <br>
> <br>
> Modified: llvm/trunk/test/CodeGen/AMDGPU/si-annotate-cf.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/si-annotate-cf.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/si-annotate-cf.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/AMDGPU/si-annotate-cf.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/AMDGPU/si-annotate-cf.ll Wed Jun 20 15:01:04 2018<br>
> @@ -89,11 +89,11 @@ declare float @llvm.fabs.f32(float) noun<br>
>   <br>
>   ; This broke the old AMDIL cfg structurizer<br>
>   ; FUNC-LABEL: {{^}}loop_land_info_assert:<br>
> -; SI: s_cmp_gt_i32<br>
> -; SI-NEXT: s_cbranch_scc0 [[ENDPGM:BB[0-9]+_[0-9]+]]<br>
> +; SI: s_cmp_lt_i32<br>
> +; SI-NEXT: s_cbranch_scc1 [[ENDPGM:BB[0-9]+_[0-9]+]]<br>
>   <br>
> -; SI: s_cmpk_gt_i32<br>
> -; SI-NEXT: s_cbranch_scc1 [[ENDPGM]]<br>
> +; SI: s_cmpk_lt_i32<br>
> +; SI-NEXT: s_cbranch_scc0 [[ENDPGM]]<br>
>   <br>
>   ; SI: [[INFLOOP:BB[0-9]+_[0-9]+]]<br>
>   ; SI: s_cbranch_vccnz [[INFLOOP]]<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/ARM/indirectbr.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/indirectbr.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/indirectbr.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/ARM/indirectbr.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/ARM/indirectbr.ll Wed Jun 20 15:01:04 2018<br>
> @@ -47,7 +47,7 @@ L3:<br>
>     br label %L2<br>
>   <br>
>   L2:                                               ; preds = %L3, %bb2<br>
> -; THUMB-LABEL: %L1.clone<br>
> +; THUMB-LABEL: %.split4<br>
>   ; THUMB: muls<br>
>     %res.2 = phi i32 [ %res.1, %L3 ], [ 1, %bb2 ]   ; <i32> [#uses=1]<br>
>     %phitmp = mul i32 %res.2, 6                     ; <i32> [#uses=1]<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll Wed Jun 20 15:01:04 2018<br>
> @@ -160,7 +160,7 @@ define signext i32 @zeroEqualityTest05()<br>
>   ; Validate with memcmp()?:<br>
>   define signext i32 @equalityFoldTwoConstants() {<br>
>   ; CHECK-LABEL: equalityFoldTwoConstants:<br>
> -; CHECK:       # %bb.0: # %endblock<br>
> +; CHECK:       # %bb.0: # %loadbb<br>
>   ; CHECK-NEXT:    li 3, 1<br>
>   ; CHECK-NEXT:    blr<br>
>     %call = tail call signext i32 @memcmp(i8* bitcast ([15 x i32]* @zeroEqualityTest04.buffer1 to i8*), i8* bitcast ([15 x i32]* @zeroEqualityTest04.buffer2 to i8*), i64 16)<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/PowerPC/memcmp-mergeexpand.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/memcmp-mergeexpand.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/memcmp-mergeexpand.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/PowerPC/memcmp-mergeexpand.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/PowerPC/memcmp-mergeexpand.ll Wed Jun 20 15:01:04 2018<br>
> @@ -7,7 +7,7 @@<br>
>   <br>
>   define zeroext i1 @opeq1(<br>
>   ; PPC64LE-LABEL: opeq1:<br>
> -; PPC64LE:       # %bb.0: # %opeq1.exit<br>
> +; PPC64LE:       # %bb.0: # %entry<br>
>   ; PPC64LE-NEXT:    ld 3, 0(3)<br>
>   ; PPC64LE-NEXT:    ld 4, 0(4)<br>
>   ; PPC64LE-NEXT:    xor 3, 3, 4<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/PowerPC/ppc-shrink-wrapping.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/ppc-shrink-wrapping.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/ppc-shrink-wrapping.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/PowerPC/ppc-shrink-wrapping.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/PowerPC/ppc-shrink-wrapping.ll Wed Jun 20 15:01:04 2018<br>
> @@ -169,7 +169,7 @@ declare i32 @something(...)<br>
>   ; CHECK-NEXT: bne 0, .[[LOOP]]<br>
>   ;<br>
>   ; Next BB<br>
> -; CHECK: %for.end<br>
> +; CHECK: %for.exit<br>
>   ; CHECK: mtlr {{[0-9]+}}<br>
>   ; CHECK-NEXT: blr<br>
>   define i32 @freqSaveAndRestoreOutsideLoop2(i32 %cond) {<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/PowerPC/simplifyConstCmpToISEL.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/simplifyConstCmpToISEL.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/simplifyConstCmpToISEL.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/PowerPC/simplifyConstCmpToISEL.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/PowerPC/simplifyConstCmpToISEL.ll Wed Jun 20 15:01:04 2018<br>
> @@ -3,7 +3,7 @@<br>
>   ; RUN:   -ppc-convert-rr-to-ri -verify-machineinstrs | FileCheck %s<br>
>   define void @test(i32 zeroext %parts) {<br>
>   ; CHECK-LABEL: test:<br>
> -; CHECK:       # %bb.0: # %cond.end.i<br>
> +; CHECK:       # %bb.0: # %entry<br>
>   ; CHECK-NEXT:    cmplwi 0, 3, 1<br>
>   ; CHECK-NEXT:    bnelr+ 0<br>
>   ; CHECK-NEXT:  # %bb.1: # %test2.exit.us.unr-lcssa<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll Wed Jun 20 15:01:04 2018<br>
> @@ -25,7 +25,7 @@ bb3:<br>
>     br i1 undef, label %return, label %bb<br>
>   <br>
>   return:<br>
> -; CHECK: %return<br>
> +; CHECK: %bb3<br>
>   ; 'mov sp, r7' would have left sp in an invalid state<br>
>   ; CHECK-NOT: mov sp, r7<br>
>   ; CHECK-NOT: sub, sp, #4<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-jtb.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-jtb.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-jtb.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/Thumb2/thumb2-jtb.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-jtb.ll Wed Jun 20 15:01:04 2018<br>
> @@ -14,9 +14,6 @@ define i16 @main__getopt_internal_2E_exi<br>
>   entry:<br>
>     br i1 %b, label %codeRepl127.exitStub, label %newFuncRoot<br>
>   <br>
> -newFuncRoot:<br>
> -     br label %_getopt_internal.exit.ce<br>
> -<br>
>   codeRepl127.exitStub:               ; preds = %_getopt_internal.exit.ce<br>
>     ; Add an explicit edge back to before the jump table to ensure this block<br>
>     ; is placed first.<br>
> @@ -103,6 +100,9 @@ codeRepl57.exitStub:              ; preds = %_getopt<br>
>   codeRepl103.exitStub:               ; preds = %_getopt_internal.exit.ce<br>
>       ret i16 26<br>
>   <br>
> +newFuncRoot:<br>
> +     br label %_getopt_internal.exit.ce<br>
> +<br>
>   _getopt_internal.exit.ce:           ; preds = %newFuncRoot<br>
>       switch i32 %0, label %codeRepl127.exitStub [<br>
>               i32 -1, label %parse_options.exit.loopexit.exitStub<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/2006-11-17-IllegalMove.ll Wed Jun 20 15:01:04 2018<br>
> @@ -6,9 +6,9 @@ define void @handle_vector_size_attribut<br>
>   ; CHECK:       # %bb.0: # %entry<br>
>   ; CHECK-NEXT:    movl 0, %eax<br>
>   ; CHECK-NEXT:    decl %eax<br>
> -; CHECK-NEXT:    cmpl $2, %eax<br>
> -; CHECK-NEXT:    jae .LBB0_2<br>
> -; CHECK-NEXT:  # %bb.1: # %cond_next129<br>
> +; CHECK-NEXT:    cmpl $1, %eax<br>
> +; CHECK-NEXT:    ja .LBB0_2<br>
> +; CHECK-NEXT:  # %bb.1: # %bb77<br>
>   ; CHECK-NEXT:    movb 0, %al<br>
>   ; CHECK-NEXT:    movzbl %al, %eax<br>
>   ; CHECK-NEXT:    # kill: def $eax killed $eax def $ax<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/avx-cmp.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx-cmp.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx-cmp.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/avx-cmp.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/avx-cmp.ll Wed Jun 20 15:01:04 2018<br>
> @@ -26,12 +26,15 @@ declare void @scale() nounwind<br>
>   define void @render() nounwind {<br>
>   ; CHECK-LABEL: render:<br>
>   ; CHECK:       # %bb.0: # %entry<br>
> +; CHECK-NEXT:    pushq %rbp<br>
>   ; CHECK-NEXT:    pushq %rbx<br>
> +; CHECK-NEXT:    pushq %rax<br>
>   ; CHECK-NEXT:    xorl %eax, %eax<br>
>   ; CHECK-NEXT:    testb %al, %al<br>
>   ; CHECK-NEXT:    jne .LBB2_6<br>
>   ; CHECK-NEXT:  # %bb.1: # %for.cond5.preheader<br>
>   ; CHECK-NEXT:    xorl %ebx, %ebx<br>
> +; CHECK-NEXT:    movb $1, %bpl<br>
>   ; CHECK-NEXT:    jmp .LBB2_2<br>
>   ; CHECK-NEXT:    .p2align 4, 0x90<br>
>   ; CHECK-NEXT:  .LBB2_5: # %if.then<br>
> @@ -43,8 +46,8 @@ define void @render() nounwind {<br>
>   ; CHECK-NEXT:    jne .LBB2_2<br>
>   ; CHECK-NEXT:  # %bb.3: # %for.cond5<br>
>   ; CHECK-NEXT:    # in Loop: Header=BB2_2 Depth=1<br>
> -; CHECK-NEXT:    testb %bl, %bl<br>
> -; CHECK-NEXT:    je .LBB2_2<br>
> +; CHECK-NEXT:    testb %bpl, %bpl<br>
> +; CHECK-NEXT:    jne .LBB2_2<br>
>   ; CHECK-NEXT:  # %bb.4: # %for.body33<br>
>   ; CHECK-NEXT:    # in Loop: Header=BB2_2 Depth=1<br>
>   ; CHECK-NEXT:    vucomisd {{\.LCPI.*}}, %xmm0<br>
> @@ -52,7 +55,9 @@ define void @render() nounwind {<br>
>   ; CHECK-NEXT:    jp .LBB2_5<br>
>   ; CHECK-NEXT:    jmp .LBB2_2<br>
>   ; CHECK-NEXT:  .LBB2_6: # %for.end52<br>
> +; CHECK-NEXT:    addq $8, %rsp<br>
>   ; CHECK-NEXT:    popq %rbx<br>
> +; CHECK-NEXT:    popq %rbp<br>
>   ; CHECK-NEXT:    retq<br>
>   entry:<br>
>     br i1 undef, label %for.cond5, label %for.end52<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/avx-splat.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx-splat.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx-splat.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/avx-splat.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/avx-splat.ll Wed Jun 20 15:01:04 2018<br>
> @@ -58,7 +58,7 @@ entry:<br>
>   ;<br>
>   define <8 x float> @funcE() nounwind {<br>
>   ; CHECK-LABEL: funcE:<br>
> -; CHECK:       # %bb.0: # %for_exit499<br>
> +; CHECK:       # %bb.0: # %allocas<br>
>   ; CHECK-NEXT:    xorl %eax, %eax<br>
>   ; CHECK-NEXT:    testb %al, %al<br>
>   ; CHECK-NEXT:    # implicit-def: $ymm0<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/avx2-vbroadcast.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx2-vbroadcast.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx2-vbroadcast.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/avx2-vbroadcast.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/avx2-vbroadcast.ll Wed Jun 20 15:01:04 2018<br>
> @@ -686,7 +686,7 @@ define void @crash() nounwind alwaysinli<br>
>   ; X32-NEXT:  ## %bb.2: ## %ret<br>
>   ; X32-NEXT:    retl<br>
>   ; X32-NEXT:    .p2align 4, 0x90<br>
> -; X32-NEXT:  LBB33_1: ## %footer349VF<br>
> +; X32-NEXT:  LBB33_1: ## %footer329VF<br>
>   ; X32-NEXT:    ## =>This Inner Loop Header: Depth=1<br>
>   ; X32-NEXT:    jmp LBB33_1<br>
>   ;<br>
> @@ -698,7 +698,7 @@ define void @crash() nounwind alwaysinli<br>
>   ; X64-NEXT:  ## %bb.2: ## %ret<br>
>   ; X64-NEXT:    retq<br>
>   ; X64-NEXT:    .p2align 4, 0x90<br>
> -; X64-NEXT:  LBB33_1: ## %footer349VF<br>
> +; X64-NEXT:  LBB33_1: ## %footer329VF<br>
>   ; X64-NEXT:    ## =>This Inner Loop Header: Depth=1<br>
>   ; X64-NEXT:    jmp LBB33_1<br>
>   WGLoopsEntry:<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/avx512-i1test.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx512-i1test.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx512-i1test.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/avx512-i1test.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/avx512-i1test.ll Wed Jun 20 15:01:04 2018<br>
> @@ -7,7 +7,7 @@ target triple = "x86_64-unknown-linux-gn<br>
>   <br>
>   define void @func() {<br>
>   ; CHECK-LABEL: func:<br>
> -; CHECK:       # %bb.0: # %L_10<br>
> +; CHECK:       # %bb.0: # %bb1<br>
>   ; CHECK-NEXT:    xorl %eax, %eax<br>
>   ; CHECK-NEXT:    testb %al, %al<br>
>   ; CHECK-NEXT:    je .LBB0_1<br>
> @@ -70,7 +70,7 @@ define i64 @func2(i1 zeroext %i, i32 %j)<br>
>   ; CHECK-NEXT:    je .LBB1_1<br>
>   ; CHECK-NEXT:  # %bb.2: # %if.then<br>
>   ; CHECK-NEXT:    jmp bar # TAILCALL<br>
> -; CHECK-NEXT:  .LBB1_1: # %return<br>
> +; CHECK-NEXT:  .LBB1_1: # %if.end<br>
>   ; CHECK-NEXT:    movzbl %dil, %eax<br>
>   ; CHECK-NEXT:    orq $-2, %rax<br>
>   ; CHECK-NEXT:    retq<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/block-placement.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/block-placement.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/block-placement.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/block-placement.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/block-placement.ll Wed Jun 20 15:01:04 2018<br>
> @@ -317,7 +317,7 @@ define void @unnatural_cfg1() {<br>
>   ; a function. This is a gross CFG reduced out of the single source GCC.<br>
>   ; CHECK-LABEL: unnatural_cfg1<br>
>   ; CHECK: %entry<br>
> -; CHECK: %loop.body1<br>
> +; CHECK: %loop.header<br>
>   ; CHECK: %loop.body2<br>
>   ; CHECK: %loop.body3<br>
>   <br>
> @@ -611,7 +611,7 @@ define void @test_unnatural_cfg_backward<br>
>   ; CHECK-LABEL: test_unnatural_cfg_backwards_inner_loop<br>
>   ; CHECK: %entry<br>
>   ; CHECK: %loop2b<br>
> -; CHECK: %loop1<br>
> +; CHECK: %loop3<br>
>   <br>
>   entry:<br>
>     br i1 undef, label %loop2a, label %body<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/hoist-spill.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/hoist-spill.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/hoist-spill.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/hoist-spill.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/hoist-spill.ll Wed Jun 20 15:01:04 2018<br>
> @@ -48,9 +48,6 @@ for.cond:<br>
>     %cmp326 = icmp sgt i32 %k.0, %p1<br>
>     br i1 %cmp326, label %for.cond4.preheader, label %for.body.preheader<br>
>   <br>
> -for.body.preheader:                               ; preds = %for.cond<br>
> -  br label %for.body<br>
> -<br>
>   for.cond4.preheader:                              ; preds = %for.body, %for.cond<br>
>     %k.1.lcssa = phi i32 [ %k.0, %for.cond ], [ %add, %for.body ]<br>
>     %cmp528 = icmp sgt i32 %sub., %p1<br>
> @@ -95,6 +92,9 @@ vector.body:<br>
>   middle.block:                                     ; preds = %vector.body, %vector.body.preheader.split<br>
>     br i1 undef, label %for.inc14, label %for.body6<br>
>   <br>
> +for.body.preheader:                               ; preds = %for.cond<br>
> +  br label %for.body<br>
> +<br>
>   for.body:                                         ; preds = %for.body, %for.body.preheader<br>
>     %k.127 = phi i32 [ %k.0, %for.body.preheader ], [ %add, %for.body ]<br>
>     %add = add nsw i32 %k.127, 1<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-1.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-1.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-1.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-1.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-1.ll Wed Jun 20 15:01:04 2018<br>
> @@ -3,7 +3,7 @@<br>
>   <br>
>   define fastcc i32 @t() nounwind  {<br>
>   ; CHECK-LABEL: t:<br>
> -; CHECK:       # %bb.0: # %walkExprTree.exit<br>
> +; CHECK:       # %bb.0: # %entry<br>
>   ; CHECK-NEXT:    movzwl 0, %eax<br>
>   ; CHECK-NEXT:    orl $2, %eax<br>
>   ; CHECK-NEXT:    movw %ax, 0<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/memcmp-mergeexpand.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/memcmp-mergeexpand.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/memcmp-mergeexpand.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/memcmp-mergeexpand.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/memcmp-mergeexpand.ll Wed Jun 20 15:01:04 2018<br>
> @@ -8,7 +8,7 @@<br>
>   <br>
>   define zeroext i1 @opeq1(<br>
>   ; X86-LABEL: opeq1:<br>
> -; X86:       # %bb.0: # %opeq1.exit<br>
> +; X86:       # %bb.0: # %entry<br>
>   ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax<br>
>   ; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx<br>
>   ; X86-NEXT:    movl (%ecx), %edx<br>
> @@ -20,7 +20,7 @@ define zeroext i1 @opeq1(<br>
>   ; X86-NEXT:    retl<br>
>   ;<br>
>   ; X64-LABEL: opeq1:<br>
> -; X64:       # %bb.0: # %opeq1.exit<br>
> +; X64:       # %bb.0: # %entry<br>
>   ; X64-NEXT:    movq (%rdi), %rax<br>
>   ; X64-NEXT:    cmpq (%rsi), %rax<br>
>   ; X64-NEXT:    sete %al<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/pr32108.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr32108.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr32108.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/pr32108.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/pr32108.ll Wed Jun 20 15:01:04 2018<br>
> @@ -3,7 +3,7 @@<br>
>   <br>
>   define void @pr32108() {<br>
>   ; CHECK-LABEL: pr32108:<br>
> -; CHECK:       # %bb.0: # %CF257<br>
> +; CHECK:       # %bb.0: # %BB<br>
>   ; CHECK-NEXT:    movb $0, -{{[0-9]+}}(%rsp)<br>
>   ; CHECK-NEXT:    .p2align 4, 0x90<br>
>   ; CHECK-NEXT:  .LBB0_1: # %CF244<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/setcc-lowering.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/setcc-lowering.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/setcc-lowering.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/setcc-lowering.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/setcc-lowering.ll Wed Jun 20 15:01:04 2018<br>
> @@ -43,7 +43,7 @@ entry:<br>
>   <br>
>   define void @pr26232(i64 %a, <16 x i1> %b) {<br>
>   ; AVX-LABEL: pr26232:<br>
> -; AVX:       # %bb.0: # %for_loop599.preheader<br>
> +; AVX:       # %bb.0: # %allocas<br>
>   ; AVX-NEXT:    vpxor %xmm1, %xmm1, %xmm1<br>
>   ; AVX-NEXT:    vmovdqa {{.*#+}} xmm2 = [128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128]<br>
>   ; AVX-NEXT:    .p2align 4, 0x90<br>
> @@ -64,7 +64,7 @@ define void @pr26232(i64 %a, <16 x i1> %<br>
>   ; AVX-NEXT:    retq<br>
>   ;<br>
>   ; KNL-32-LABEL: pr26232:<br>
> -; KNL-32:       # %bb.0: # %for_loop599.preheader<br>
> +; KNL-32:       # %bb.0: # %allocas<br>
>   ; KNL-32-NEXT:    pushl %esi<br>
>   ; KNL-32-NEXT:    .cfi_def_cfa_offset 8<br>
>   ; KNL-32-NEXT:    .cfi_offset %esi, -8<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/split-store.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/split-store.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/split-store.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/split-store.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/split-store.ll Wed Jun 20 15:01:04 2018<br>
> @@ -232,7 +232,7 @@ define void @int1_int1_pair(i1 signext %<br>
>   <br>
>   define void @mbb_int32_float_pair(i32 %tmp1, float %tmp2, i64* %ref.tmp) {<br>
>   ; CHECK-LABEL: mbb_int32_float_pair:<br>
> -; CHECK:       # %bb.0: # %next<br>
> +; CHECK:       # %bb.0: # %entry<br>
>   ; CHECK-NEXT:    movl %edi, (%rsi)<br>
>   ; CHECK-NEXT:    movss %xmm0, 4(%rsi)<br>
>   ; CHECK-NEXT:    retq<br>
> @@ -250,7 +250,7 @@ next:<br>
>   <br>
>   define void @mbb_int32_float_multi_stores(i32 %tmp1, float %tmp2, i64* %ref.tmp, i64* %ref.tmp1, i1 %cmp) {<br>
>   ; CHECK-LABEL: mbb_int32_float_multi_stores:<br>
> -; CHECK:       # %bb.0: # %bb1<br>
> +; CHECK:       # %bb.0: # %entry<br>
>   ; CHECK-NEXT:    movl %edi, (%rsi)<br>
>   ; CHECK-NEXT:    movss %xmm0, 4(%rsi)<br>
>   ; CHECK-NEXT:    testb $1, %cl<br>
> <br>
> Modified: llvm/trunk/test/CodeGen/X86/tail-dup-merge-loop-headers.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tail-dup-merge-loop-headers.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tail-dup-merge-loop-headers.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/tail-dup-merge-loop-headers.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/tail-dup-merge-loop-headers.ll Wed Jun 20 15:01:04 2018<br>
> @@ -10,7 +10,7 @@ target triple = "x86_64-unknown-linux-gn<br>
>   ; CHECK-NOT: # %{{[a-zA-Z_]+}}<br>
>   ; CHECK: # %inner_loop_latch<br>
>   ; CHECK-NOT: # %{{[a-zA-Z_]+}}<br>
> -; CHECK: # %inner_loop_test<br>
> +; CHECK: # %inner_loop_top<br>
>   ; CHECK-NOT: # %{{[a-zA-Z_]+}}<br>
>   ; CHECK: # %exit<br>
>   define void @tail_dup_merge_loops(i32 %a, i8* %b, i8* %c) local_unnamed_addr #0 {<br>
> <br>
> Modified: llvm/trunk/test/DebugInfo/Generic/sunk-compare.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/sunk-compare.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/sunk-compare.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/DebugInfo/Generic/sunk-compare.ll (original)<br>
> +++ llvm/trunk/test/DebugInfo/Generic/sunk-compare.ll Wed Jun 20 15:01:04 2018<br>
> @@ -8,7 +8,7 @@<br>
>   ; We check that the compare instruction retains its debug loc after<br>
>   ; it is sunk into <a href="http://other.bb" target="_blank">other.bb</a> by the codegen prepare pass.<br>
>   ;<br>
> -; CHECK:       <a href="http://other.bb" target="_blank">other.bb</a>:<br>
> +; CHECK:       entry:<br>
>   ; CHECK-NEXT:  icmp{{.*}}%x, 0, !dbg ![[MDHANDLE:[0-9]*]]<br>
>   ; CHECK:       ![[MDHANDLE]] = !DILocation(line: 2<br>
>   ;<br>
> <br>
> Modified: llvm/trunk/test/Transforms/CodeGenPrepare/X86/computedgoto.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/CodeGenPrepare/X86/computedgoto.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/CodeGenPrepare/X86/computedgoto.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/Transforms/CodeGenPrepare/X86/computedgoto.ll (original)<br>
> +++ llvm/trunk/test/Transforms/CodeGenPrepare/X86/computedgoto.ll Wed Jun 20 15:01:04 2018<br>
> @@ -168,7 +168,7 @@ exit:<br>
>   ; the block it terminates.<br>
>   define void @loop(i64* nocapture readonly %p) {<br>
>   ; CHECK-LABEL: @loop(<br>
> -; CHECK-NEXT:  bb0.clone:<br>
> +; CHECK-NEXT:  entry:<br>
>   ; CHECK-NEXT:    br label [[DOTSPLIT:%.*]]<br>
>   ; CHECK:       bb0:<br>
>   ; CHECK-NEXT:    br label [[DOTSPLIT]]<br>
> <br>
> Modified: llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll (original)<br>
> +++ llvm/trunk/test/Transforms/CodeGenPrepare/basic.ll Wed Jun 20 15:01:04 2018<br>
> @@ -13,7 +13,7 @@ entry:<br>
>     %1 = icmp ugt i64 %0, 3<br>
>     br i1 %1, label %T, label %trap<br>
>   <br>
> -; CHECK: T:<br>
> +; CHECK: entry:<br>
>   ; CHECK-NOT: br label %<br>
>   <br>
>   trap:                                             ; preds = %0, %entry<br>
> <br>
> Modified: llvm/trunk/test/Transforms/LoopSimplifyCFG/scev.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopSimplifyCFG/scev.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopSimplifyCFG/scev.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/Transforms/LoopSimplifyCFG/scev.ll (original)<br>
> +++ llvm/trunk/test/Transforms/LoopSimplifyCFG/scev.ll Wed Jun 20 15:01:04 2018<br>
> @@ -6,22 +6,22 @@<br>
>   define void @t_run_test() {<br>
>   ; CHECK-LABEL: @t_run_test(<br>
>   ; CHECK-NEXT:  entry:<br>
> -; CHECK-NEXT:    br label [[LOOP_PH:%.*]]<br>
> -; CHECK:       <a href="http://loop.ph" target="_blank">loop.ph</a>:<br>
> -; CHECK-NEXT:    br label [[LOOP_BODY:%.*]]<br>
> -; CHECK:       loop.body:<br>
> -; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ 0, [[LOOP_PH]] ], [ [[INC:%.*]], [[LOOP_BODY]] ]<br>
> +; CHECK-NEXT:    br label %[[LOOP_PH:.*]]<br>
> +; CHECK:       [[LOOP_PH]]:<br>
> +; CHECK-NEXT:    br label %[[LOOP_BODY:.*]]<br>
> +; CHECK:       [[LOOP_BODY]]:<br>
> +; CHECK-NEXT:    [[IV:%.*]] = phi i32 [ 0, %[[LOOP_PH]] ], [ [[INC:%.*]], %[[LOOP_BODY]] ]<br>
>   ; CHECK-NEXT:    [[INC]] = add i32 [[IV]], 1<br>
>   ; CHECK-NEXT:    [[CMP:%.*]] = icmp ult i32 [[INC]], 10<br>
> -; CHECK-NEXT:    br i1 [[CMP]], label [[LOOP_BODY]], label [[EXIT:%.*]]<br>
> -; CHECK:       exit:<br>
> -; CHECK-NEXT:    br label [[LOOP_BODY2:%.*]]<br>
> -; CHECK:       loop.body2:<br>
> -; CHECK-NEXT:    [[IV2:%.*]] = phi i32 [ 0, [[EXIT]] ], [ [[INC2:%.*]], [[LOOP_BODY2]] ]<br>
> +; CHECK-NEXT:    br i1 [[CMP]], label %[[LOOP_BODY]], label %[[EXIT:.*]]<br>
> +; CHECK:       [[EXIT]]:<br>
> +; CHECK-NEXT:    br label %[[LOOP_BODY2:.*]]<br>
> +; CHECK:       [[LOOP_BODY2]]:<br>
> +; CHECK-NEXT:    [[IV2:%.*]] = phi i32 [ 0, %[[EXIT]] ], [ [[INC2:%.*]], %[[LOOP_BODY2]] ]<br>
>   ; CHECK-NEXT:    [[INC2]] = add i32 [[IV2]], 1<br>
>   ; CHECK-NEXT:    [[CMP2:%.*]] = icmp ult i32 [[INC2]], 10<br>
> -; CHECK-NEXT:    br i1 [[CMP2]], label [[LOOP_BODY2]], label [[EXIT2:%.*]]<br>
> -; CHECK:       exit2:<br>
> +; CHECK-NEXT:    br i1 [[CMP2]], label %[[LOOP_BODY2]], label %[[EXIT2:.*]]<br>
> +; CHECK:       [[EXIT2]]:<br>
>   ; CHECK-NEXT:    ret void<br>
>   ;<br>
>   entry:<br>
> <br>
> Modified: llvm/trunk/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll (original)<br>
> +++ llvm/trunk/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll Wed Jun 20 15:01:04 2018<br>
> @@ -44,7 +44,7 @@ declare %s* @getstruct() nounwind<br>
>   <br>
>   ; CHECK: @main<br>
>   ; Check that the loop preheader contains no address computation.<br>
> -; CHECK: %end_of_chain<br>
> +; CHECK: %while.cond.i.i<br>
>   ; CHECK-NOT: add{{.*}}lsl<br>
>   ; CHECK: ldr{{.*}}lsl #2<br>
>   ; CHECK: ldr{{.*}}lsl #2<br>
> <br>
> Modified: llvm/trunk/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll (original)<br>
> +++ llvm/trunk/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll Wed Jun 20 15:01:04 2018<br>
> @@ -96,7 +96,8 @@ while.end:<br>
>   ; itself a phi.<br>
>   ;<br>
>   ; CHECK: @test3<br>
> -; CHECK: %for.body3.lr.ph.us.i.loopexit<br>
> +; CHECK: %meshBB1<br>
> +; CHECK: %meshBB<br>
>   ; CHECK-NEXT: Parent Loop<br>
>   ; CHECK-NEXT: Inner Loop<br>
>   ; CHECK-NEXT: incq<br>
> <br>
> Modified: llvm/trunk/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-iteration.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-iteration.ll?rev=335183&r1=335182&r2=335183&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-iteration.ll?rev=335183&r1=335182&r2=335183&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-iteration.ll (original)<br>
> +++ llvm/trunk/test/Transforms/SimpleLoopUnswitch/trivial-unswitch-iteration.ll Wed Jun 20 15:01:04 2018<br>
> @@ -13,7 +13,7 @@ entry:<br>
>   ; CHECK-NEXT:    br i1 %{{.*}}, label %entry.split.split, label %loop_exit<br>
>   ;<br>
>   ; CHECK:       entry.split.split:<br>
> -; CHECK-NEXT:    br label %do_something<br>
> +; CHECK-NEXT:    br label %loop_begin<br>
>   <br>
>   loop_begin:<br>
>     br i1 %cond1, label %continue, label %loop_exit ; first trivial condition<br>
> @@ -27,9 +27,9 @@ continue:<br>
>   do_something:<br>
>     call void @some_func() noreturn nounwind<br>
>     br label %loop_begin<br>
> -; CHECK:       do_something:<br>
> +; CHECK:       loop_begin:<br>
>   ; CHECK-NEXT:    call<br>
> -; CHECK-NEXT:    br label %do_something<br>
> +; CHECK-NEXT:    br label %loop_begin<br>
>   <br>
>   loop_exit:<br>
>     ret i32 0<br>
> @@ -38,4 +38,4 @@ loop_exit:<br>
>   ;<br>
>   ; CHECK:       loop_exit.split:<br>
>   ; CHECK-NEXT:    ret<br>
> -}<br>
> \ No newline at end of file<br>
> +}<br>
> <br>
> <br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
> <u></u><u></u></p>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>

</blockquote></div>