[llvm] [SimplifyCFG] Refine metadata handling during instruction hoisting (PR #158448)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 14 12:24:37 PDT 2025


================
@@ -0,0 +1,44 @@
+; RUN: opt -S -o - %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s
+
+
+declare i1 @make_condition()
+
+define i1 @specfn() readnone nounwind speculatable {
+    ret i1 true
+}
+
+; CHECK-LABEL: @test1(
+; CHECK: call i1 @specfn(), !dbg
+; CHECK: select i1
+define void @test1() !dbg !6 {
+start:
+  %cond = call i1 @make_condition(), !dbg !8
----------------
nikic wrote:

```suggestion
define void @test1(i1 %cond) !dbg !6 {
start:
```
Would probably work as well?

https://github.com/llvm/llvm-project/pull/158448


More information about the llvm-commits mailing list