forked from CTSRD-CHERI/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.
reland [IR] make -stack-alignment= into a module attr
Relands commit 433c8d9 with fixes for MIPS. Similar to D102742, specifying the stack alignment via CodegenOpts means that this flag gets dropped during LTO, unless the command line is re-specified as a plugin opt. Instead, encode this information as a module level attribute so that we don't have to expose this llvm internal flag when linking the Linux kernel with LTO. Looks like external dependencies might need a fix: * llvm-hs/llvm-hs#345 * halide/Halide#6079 Link: ClangBuiltLinux/linux#1377 Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D103048
- Loading branch information
Showing
26 changed files
with
211 additions
and
137 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
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
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
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,46 @@ | ||
; RUN: llc < %s -stack-symbol-ordering=0 -mcpu=generic -stackrealign -mattr=+avx -mtriple=x86_64-apple-darwin10 | FileCheck %s | ||
; rdar://11496434 | ||
declare void @t1_helper(i32*) | ||
declare void @t3_helper(i32*, i32*) | ||
|
||
; Test when forcing stack alignment | ||
define i32 @t8() nounwind uwtable { | ||
entry: | ||
%a = alloca i32, align 4 | ||
call void @t1_helper(i32* %a) nounwind | ||
%0 = load i32, i32* %a, align 4 | ||
%add = add nsw i32 %0, 13 | ||
ret i32 %add | ||
|
||
; CHECK: _t8 | ||
; CHECK: movq %rsp, %rbp | ||
; CHECK: andq $-32, %rsp | ||
; CHECK-NEXT: subq $32, %rsp | ||
; CHECK: movq %rbp, %rsp | ||
; CHECK: popq %rbp | ||
} | ||
|
||
; VLAs | ||
define i32 @t9(i64 %sz) nounwind uwtable { | ||
entry: | ||
%a = alloca i32, align 4 | ||
%vla = alloca i32, i64 %sz, align 16 | ||
call void @t3_helper(i32* %a, i32* %vla) nounwind | ||
%0 = load i32, i32* %a, align 4 | ||
%add = add nsw i32 %0, 13 | ||
ret i32 %add | ||
|
||
; CHECK: _t9 | ||
; CHECK: pushq %rbp | ||
; CHECK: movq %rsp, %rbp | ||
; CHECK: pushq %rbx | ||
; CHECK: andq $-32, %rsp | ||
; CHECK: subq $32, %rsp | ||
; CHECK: movq %rsp, %rbx | ||
|
||
; CHECK: leaq -8(%rbp), %rsp | ||
; CHECK: popq %rbx | ||
; CHECK: popq %rbp | ||
} | ||
!llvm.module.flags = !{!0} | ||
!0 = !{i32 2, !"override-stack-alignment", i32 32} |
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
Oops, something went wrong.