Skip to content

Conversation

@shiltian
Copy link
Contributor

@shiltian shiltian commented Feb 6, 2025

I tried to fix it in #124051 but failed to do so. This PR adds the test and
marks it as xfail.

Copy link
Contributor Author

shiltian commented Feb 6, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@shiltian shiltian requested a review from arsenm February 6, 2025 16:25
@llvmbot
Copy link
Member

llvmbot commented Feb 6, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Shilei Tian (shiltian)

Changes

I tried to fix it in #124051 but failed to do so. This PR adds the test and
marks it as xfail.


Full diff: https://github.com/llvm/llvm-project/pull/126087.diff

1 Files Affected:

  • (added) llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll (+18)
diff --git a/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll b/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll
new file mode 100644
index 000000000000000..745b0bdc0382ada
--- /dev/null
+++ b/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll
@@ -0,0 +1,18 @@
+; RUN: opt -S -passes=structurizecfg %s -o -
+; XFAIL: *
+
+; FIXME: This test is expected to crash. Generate checklines after the crash is fixed.
+
+define void @foo() {
+entry:
+  br i1 false, label %cond.true, label %cond.false
+
+cond.true:                                        ; preds = %entry
+  br label %cond.end
+
+cond.false:                                       ; preds = %entry
+  br label %cond.end
+
+cond.end:                                         ; preds = %cond.false, %cond.true
+  ret void
+}

Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also open a tracking issue and add a reference to the test (like in the file name)

I tried to fix it in #124051 but failed to do so. This PR adds the test and
marks it as xfail.
@shiltian
Copy link
Contributor Author

Can you also open a tracking issue and add a reference to the test (like in the file name)

Done.

@shiltian shiltian merged commit 71fcc82 into main Feb 10, 2025
5 of 7 checks passed
@shiltian shiltian deleted the users/shiltian/structurizecfg-crash branch February 10, 2025 16:12
@Prabhuk
Copy link
Contributor

Prabhuk commented Feb 10, 2025

This test fails in our (Fuchsia) toolchain CI linux host builders. I am currently investigating this.

XPASS: LLVM :: Transforms/StructurizeCFG/simple-structurizecfg-crash.ll (50157 of 58077)
******************** TEST 'LLVM :: Transforms/StructurizeCFG/simple-structurizecfg-crash.ll' FAILED ********************
Exit Code: 0

Command Output (stdout):
--
; ModuleID = '/b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll'
source_filename = "/b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll"

define void @foo() {
entry:
  br label %cond.false

cond.true:                                        ; preds = %cond.false
  br label %cond.end

cond.false:                                       ; preds = %entry
  br i1 true, label %cond.true, label %cond.end

cond.end:                                         ; preds = %cond.true, %cond.false
  ret void
}

--
Command Output (stderr):
--
RUN: at line 1: /b/s/w/ir/x/w/llvm_build/bin/opt -S -passes=structurizecfg /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll -o -
+ /b/s/w/ir/x/w/llvm_build/bin/opt -S -passes=structurizecfg /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll -o -

Link to the logs: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8723305309974990577/+/u/clang/tests/stdout
Link to the bot: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-host-linux-x64/b8723305798791238737/overview

@dyung
Copy link
Collaborator

dyung commented Feb 10, 2025

I'm also seeing the test XPASS on my bot which builds without assertions enabled:

https://lab.llvm.org/staging/#/builders/202/builds/1029

@@ -0,0 +1,19 @@
; RUN: opt -S -passes=structurizecfg %s -o -
; XFAIL: *

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires asserts

@shiltian
Copy link
Contributor Author

@dyung 15412d9 should hopefully fix this.

Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
…lvm#126087)

I tried to fix it in llvm#124051 but failed to do so. This PR adds the test
and
marks it as xfail.
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
…lvm#126087)

I tried to fix it in llvm#124051 but failed to do so. This PR adds the test
and
marks it as xfail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants