[llvm] r217453 - Add a test for hoisting instructions with metadata out of then/else blocks

Bjorn Steinbrink bsteinbr at gmail.com
Tue Sep 9 10:10:21 PDT 2014


Author: bsteinbr
Date: Tue Sep  9 12:10:21 2014
New Revision: 217453

URL: http://llvm.org/viewvc/llvm-project?rev=217453&view=rev
Log:
Add a test for hoisting instructions with metadata out of then/else blocks

Test for the bug fixed in r215723.

Added:
    llvm/trunk/test/Transforms/SimplifyCFG/hoist-with-range.ll

Added: llvm/trunk/test/Transforms/SimplifyCFG/hoist-with-range.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/hoist-with-range.ll?rev=217453&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyCFG/hoist-with-range.ll (added)
+++ llvm/trunk/test/Transforms/SimplifyCFG/hoist-with-range.ll Tue Sep  9 12:10:21 2014
@@ -0,0 +1,20 @@
+; RUN: opt < %s -simplifycfg -S | FileCheck %s
+
+define void @foo(i1 %c, i8* %p) {
+; CHECK: if:
+; CHECK-NEXT: load i8* %p, !range !0
+; CHECK: !0 = metadata !{i8 0, i8 1, i8 3, i8 5}
+if:
+  br i1 %c, label %then, label %else
+then:
+  %t = load i8* %p, !range !0
+  br label %out
+else:
+  %e = load i8* %p, !range !1
+  br label %out
+out:
+  ret void
+}
+
+!0 = metadata !{ i8 0, i8 1 }
+!1 = metadata !{ i8 3, i8 5 }





More information about the llvm-commits mailing list