[llvm] r299912 - [LoopUnswitch] Fix a test case

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 21:11:47 PDT 2017


Author: sanjoy
Date: Mon Apr 10 23:11:47 2017
New Revision: 299912

URL: http://llvm.org/viewvc/llvm-project?rev=299912&view=rev
Log:
[LoopUnswitch] Fix a test case

(h/t to Chandler for pointing this out)

The test in question was not at all testing what it was supposed to
test.  We do not //care// about placing `!make.implicit` in inner
constant branch (since it will be folded away anyway).  We care about
placing `!make.implicit` in the outer branch that switches between
either version of the loop.

Having said that, it is _correct_ to leave behind the `!make.implicit`
in the inner branch, but there is no need to do so.

Modified:
    llvm/trunk/test/Transforms/LoopUnswitch/copy-metadata.ll

Modified: llvm/trunk/test/Transforms/LoopUnswitch/copy-metadata.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnswitch/copy-metadata.ll?rev=299912&r1=299911&r2=299912&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopUnswitch/copy-metadata.ll (original)
+++ llvm/trunk/test/Transforms/LoopUnswitch/copy-metadata.ll Mon Apr 10 23:11:47 2017
@@ -3,11 +3,11 @@
 ; This test checks if unswitched condition preserve make.implicit metadata.
 
 define i32 @test(i1 %cond) {
-; CHECK: br i1 %cond, label %..split_crit_edge, label %.loop_exit.split_crit_edge, !make.implicit !0
+; CHECK-LABEL: @test(
+; CHECK:  br i1 %cond, label %..split_crit_edge, label %.loop_exit.split_crit_edge, !make.implicit !0
   br label %loop_begin
 
 loop_begin:
-; CHECK: br i1 true, label %continue, label %loop_exit, !make.implicit !0
   br i1 %cond, label %continue, label %loop_exit, !make.implicit !0
 
 continue:




More information about the llvm-commits mailing list