[PATCH] D108337: StackLifetime: Remove asserts for multiple lifetime intrinsics.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 18 17:50:41 PDT 2021
pcc updated this revision to Diff 367375.
pcc added a comment.
Test this in test/Analysis/StackSafetyAnalysis/lifetime.ll instead
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108337/new/
https://reviews.llvm.org/D108337
Files:
llvm/lib/Analysis/StackLifetime.cpp
llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll
Index: llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll
===================================================================
--- llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll
+++ llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll
@@ -924,6 +924,31 @@
ret void
}
+define void @multiple_start_end() {
+; CHECK-LABEL: define void @multiple_start_end
+entry:
+; CHECK: entry:
+; CHECK-NEXT: Alive: <>
+ %x = alloca i8
+ call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+; CHECK-NEXT: Alive: <x>
+
+ call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %x)
+; CHECK-NEXT: Alive: <x>
+
+ call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
+; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
+; CHECK-NEXT: Alive: <>
+
+ call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
+; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %x)
+; CHECK-NEXT: Alive: <>
+
+ ret void
+}
+
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
declare void @llvm.lifetime.start.p0i32(i64, i32* nocapture)
Index: llvm/lib/Analysis/StackLifetime.cpp
===================================================================
--- llvm/lib/Analysis/StackLifetime.cpp
+++ llvm/lib/Analysis/StackLifetime.cpp
@@ -257,14 +257,12 @@
unsigned AllocaNo = It.second.AllocaNo;
if (IsStart) {
- assert(!Started.test(AllocaNo) || Start[AllocaNo] == BBStart);
if (!Started.test(AllocaNo)) {
Started.set(AllocaNo);
Ended.reset(AllocaNo);
Start[AllocaNo] = InstNo;
}
} else {
- assert(!Ended.test(AllocaNo));
if (Started.test(AllocaNo)) {
LiveRanges[AllocaNo].addRange(Start[AllocaNo], InstNo);
Started.reset(AllocaNo);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108337.367375.patch
Type: text/x-patch
Size: 1896 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210819/9636d2f3/attachment.bin>
More information about the llvm-commits
mailing list