[PATCH] D125696: [BasicBlockUtils] Add corner case test for loop metadata.
Hendrik Greving via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 23 16:41:39 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe5d8fb690e35: [BasicBlockUtils] Add corner case test for loop metadata. (authored by hgreving).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125696/new/
https://reviews.llvm.org/D125696
Files:
llvm/test/Transforms/LoopSimplify/update_latch_md2.ll
Index: llvm/test/Transforms/LoopSimplify/update_latch_md2.ll
===================================================================
--- /dev/null
+++ llvm/test/Transforms/LoopSimplify/update_latch_md2.ll
@@ -0,0 +1,36 @@
+; Tests loop-simplify does not move the loop metadata, because
+; the loopexit block is not the latch of the loop _bb6.
+
+; FIXME(#55416): The metadata should not move.
+
+; RUN: opt < %s -passes=loop-simplify -S | FileCheck %s
+; CHECK-LABEL: loop.header.loopexit:
+; CHECK: br label %loop.header, !llvm.loop !0
+; CHECK-LABEL: loop.latch:
+; CHECK-NOT: br i1 %p, label %loop.latch, label %loop.header.loopexit, !llvm.loop !0
+
+define void @func(i1 %p) {
+entry:
+ br label %loop.header
+
+loop.header:
+ br i1 %p, label %bb1, label %exit
+
+bb1:
+ br i1 %p, label %bb2, label %bb3
+
+bb2:
+ br label %bb3
+
+bb3:
+ br label %loop.latch
+
+loop.latch:
+ br i1 %p, label %loop.latch, label %loop.header, !llvm.loop !0
+
+exit:
+ ret void
+}
+
+!0 = distinct !{!0, !1}
+!1 = !{!"llvm.loop.mustprogress"}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125696.431522.patch
Type: text/x-patch
Size: 1031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220523/f95dc0bc/attachment.bin>
More information about the llvm-commits
mailing list