1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/test/Transforms/LoopUnswitch/copy-metadata.ll
Sanjoy Das 47679d5af7 [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.

llvm-svn: 299912
2017-04-11 04:11:47 +00:00

24 lines
516 B
LLVM

; RUN: opt < %s -loop-unswitch -S < %s 2>&1 | FileCheck %s
; This test checks if unswitched condition preserve make.implicit metadata.
define i32 @test(i1 %cond) {
; 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:
br i1 %cond, label %continue, label %loop_exit, !make.implicit !0
continue:
call void @some_func()
br label %loop_begin
loop_exit:
ret i32 0
}
declare void @some_func()
!0 = !{}