-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LLParser: add an argument for overriding data layout and do not check…
… alloca addr space Sometimes users do not specify data layout in LLVM assembly and let llc set the data layout by target triple after loading the LLVM assembly. Currently the parser checks alloca address space no matter whether the LLVM assembly contains data layout definition, which causes false alarm since the default data layout does not contain the correct alloca address space. The parser also calls verifier to check debug info and updating invalid debug info. Currently there is no way to let the verifier to check debug info only. If the verifier finds non-debug-info issues the parser will fail. For llc, the fix is to remove the check of alloca addr space in the parser and disable updating debug info, and defer the updating of debug info and verification to be after setting data layout of the IR by target. For other llvm tools, since they do not override data layout by target but instead can override data layout by a command line option, an argument for overriding data layout is added to the parser. In cases where data layout overriding is necessary for the parser, the data layout can be provided by command line. Differential Revision: https://reviews.llvm.org/D41832 llvm-svn: 323826
- Loading branch information
Showing
18 changed files
with
179 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
; RUN: llvm-as < %s -o %t.bc -data-layout=A5 2>&1 | FileCheck -check-prefixes=COM,AS %s | ||
; RUN: llvm-dis < %t.bc | FileCheck -check-prefixes=COM,DIS %s | ||
; RUN: opt < %s -S -data-layout=A5 2>&1 | FileCheck -check-prefixes=COM,AS %s | ||
; RUN: opt < %t.bc -S | FileCheck -check-prefixes=COM,DIS %s | ||
|
||
define void @foo() { | ||
entry: | ||
; DIS: target datalayout = "A5" | ||
; DIS: %tmp = alloca i32, addrspace(5) | ||
%tmp = alloca i32, addrspace(5) | ||
call void @llvm.dbg.value( | ||
metadata i8* undef, | ||
metadata !DILocalVariable(scope: !1), | ||
metadata !DIExpression()) | ||
; COM-NOT: Allocation instruction pointer not in the stack address space! | ||
; AS: llvm.dbg.value intrinsic requires a !dbg attachment | ||
; AS: warning: ignoring invalid debug info in <stdin> | ||
ret void | ||
} | ||
|
||
declare void @llvm.dbg.value(metadata, metadata, metadata) | ||
|
||
!llvm.module.flags = !{!0} | ||
!0 = !{i32 2, !"Debug Info Version", i32 3} | ||
!1 = distinct !DISubprogram(name: "foo") |
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,12 @@ | ||
; RUN: llvm-as -data-layout=A5 < %s | llvm-dis | FileCheck %s | ||
; RUN: llc -mtriple amdgcn-amd-amdhsa-amdgiz < %s | ||
; RUN: llvm-as -data-layout=A5 < %s | llc -mtriple amdgcn-amd-amdhsa-amdgiz | ||
; RUN: opt -data-layout=A5 -S < %s | ||
; RUN: llvm-as -data-layout=A5 < %s | opt -S | ||
|
||
; CHECK: %tmp = alloca i32, addrspace(5) | ||
define amdgpu_kernel void @test() { | ||
%tmp = alloca i32, addrspace(5) | ||
ret void | ||
} | ||
|
Oops, something went wrong.