[PATCH] D64403: [SimpleLoopUnswitch] Add a test case exposing a bug

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 01:28:54 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL365600: [SimpleLoopUnswitch] Add a test case exposing a bug (authored by skatkov, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D64403?vs=208642&id=208892#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64403/new/

https://reviews.llvm.org/D64403

Files:
  llvm/trunk/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-redundant-switch.ll


Index: llvm/trunk/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-redundant-switch.ll
===================================================================
--- llvm/trunk/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-redundant-switch.ll
+++ llvm/trunk/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-redundant-switch.ll
@@ -0,0 +1,25 @@
+; REQUIRES: asserts
+; XFAIL: *
+; RUN: opt -passes='unswitch<nontrivial>' -disable-output -S < %s
+; RUN: opt -simple-loop-unswitch -enable-nontrivial-unswitch -disable-output -S < %s
+
+; This loop shouldn't trigger asserts in SimpleLoopUnswitch.
+define void @test_redundant_switch(i1* %ptr, i32 %cond) {
+entry:
+  br label %loop_begin
+
+loop_begin:
+  switch i32 %cond, label %loop_body [
+      i32 0, label %loop_body
+  ]
+
+loop_body:
+  br label %loop_latch
+
+loop_latch:
+  %v = load i1, i1* %ptr
+  br i1 %v, label %loop_begin, label %loop_exit
+
+loop_exit:
+  ret void
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64403.208892.patch
Type: text/x-patch
Size: 947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190710/a0ebfb59/attachment.bin>


More information about the llvm-commits mailing list