Skip to content

[CoroSplit] Remove lifetime marker checks for subranges of allocas #152886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025

Conversation

NewSigma
Copy link
Contributor

#150248 starts to drop size argument of lifetime markers. Then lifetime markers cannot refer to subrange of allocas. Maybe we should remove this check.

@llvmbot
Copy link
Member

llvmbot commented Aug 10, 2025

@llvm/pr-subscribers-coroutines

Author: Weibo He (NewSigma)

Changes

#150248 starts to drop size argument of lifetime markers. Then lifetime markers cannot refer to subrange of allocas. Maybe we should remove this check.


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Coroutines/SpillUtils.cpp (-5)
diff --git a/llvm/lib/Transforms/Coroutines/SpillUtils.cpp b/llvm/lib/Transforms/Coroutines/SpillUtils.cpp
index 4e717685555b5..d5d60a320b521 100644
--- a/llvm/lib/Transforms/Coroutines/SpillUtils.cpp
+++ b/llvm/lib/Transforms/Coroutines/SpillUtils.cpp
@@ -264,11 +264,6 @@ struct AllocaUseVisitor : PtrUseVisitor<AllocaUseVisitor> {
   }
 
   void visitIntrinsicInst(IntrinsicInst &II) {
-    // When we found the lifetime markers refers to a
-    // subrange of the original alloca, ignore the lifetime
-    // markers to avoid misleading the analysis.
-    if (!IsOffsetKnown || !Offset.isZero())
-      return Base::visitIntrinsicInst(II);
     switch (II.getIntrinsicID()) {
     default:
       return Base::visitIntrinsicInst(II);

@llvmbot
Copy link
Member

llvmbot commented Aug 10, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Weibo He (NewSigma)

Changes

#150248 starts to drop size argument of lifetime markers. Then lifetime markers cannot refer to subrange of allocas. Maybe we should remove this check.


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Coroutines/SpillUtils.cpp (-5)
diff --git a/llvm/lib/Transforms/Coroutines/SpillUtils.cpp b/llvm/lib/Transforms/Coroutines/SpillUtils.cpp
index 4e717685555b5..d5d60a320b521 100644
--- a/llvm/lib/Transforms/Coroutines/SpillUtils.cpp
+++ b/llvm/lib/Transforms/Coroutines/SpillUtils.cpp
@@ -264,11 +264,6 @@ struct AllocaUseVisitor : PtrUseVisitor<AllocaUseVisitor> {
   }
 
   void visitIntrinsicInst(IntrinsicInst &II) {
-    // When we found the lifetime markers refers to a
-    // subrange of the original alloca, ignore the lifetime
-    // markers to avoid misleading the analysis.
-    if (!IsOffsetKnown || !Offset.isZero())
-      return Base::visitIntrinsicInst(II);
     switch (II.getIntrinsicID()) {
     default:
       return Base::visitIntrinsicInst(II);

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

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

LGTM

@nikic nikic merged commit 13cd725 into llvm:main Aug 11, 2025
12 checks passed
@NewSigma NewSigma deleted the incomplete-alloca branch August 12, 2025 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants