forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[StackColoring] Delete dead stack slots (llvm#75351)
deletes slots that have lifetime markers and the lifetime ranges are empty.
- Loading branch information
1 parent
f94c410
commit 08b306d
Showing
6 changed files
with
48 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \ | ||
; RUN: | FileCheck %s | ||
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \ | ||
; RUN: | FileCheck %s | ||
|
||
; Remove the lifetime-marked alloca, but not the unmarked one. | ||
define signext i32 @f1() nounwind { | ||
; CHECK-LABEL: f1: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: addi sp, sp, -32 | ||
; CHECK-NEXT: li a0, 0 | ||
; CHECK-NEXT: addi sp, sp, 32 | ||
; CHECK-NEXT: ret | ||
%1 = alloca [32 x i8], align 4 | ||
%2 = alloca [32 x i8], align 4 | ||
%3 = getelementptr inbounds [32 x i8], ptr %1, i64 0, i64 0 | ||
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) | ||
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) | ||
ret i32 0 | ||
} | ||
|
||
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) | ||
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters