-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DebugInfo] Avoid data location of assumed shape array being optimize…
…d away Base address of assumed shape array is marked as 'dataLocation' field of array type, this is an artifical variable earlier mentioned as DW_TAG_variable. With below options this artificial variable is optimized out. %flang -g -S -emit-llvm test/debug_info/assumed_shape_noopt.f90 %llc -O0 -fast-isel=false -global-isel=false -filetype=obj assumed_shape_noopt.ll Marking this variable as DW_TAG_formal_parameter is a right thing to do and also avoids optimization.
- Loading branch information
1 parent
2e5eea6
commit 788459a
Showing
10 changed files
with
106 additions
and
20 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,32 @@ | ||
!RUN: %flang -g -S -emit-llvm %s -o - | llc -O0 -fast-isel=false -global-isel=false -filetype=obj -o %t | ||
!RUN: llvm-dwarfdump %t | FileCheck %s | ||
|
||
!CHECK-LABEL: DW_TAG_subprogram | ||
!COM: make sure DLOC's DW_AT_location is available | ||
!CHECK-LABEL: DW_TAG_subprogram | ||
!CHECK: DW_AT_name ("show") | ||
!CHECK:[[DLOC:0x[0-9a-f]+]]: DW_TAG_formal_parameter | ||
!CHECK: DW_AT_location | ||
!CHECK:[[ARRAY:0x[0-9a-f]+]]: DW_TAG_formal_parameter | ||
!CHECK: DW_AT_location | ||
!CHECK: DW_AT_type ([[TYPE:0x[0-9a-f]+]] | ||
!CHECK: [[TYPE]]: DW_TAG_array_type | ||
!CHECK: DW_AT_data_location ([[DLOC]]) | ||
|
||
subroutine show (array) | ||
integer :: array(:,:) | ||
|
||
print *, array | ||
end subroutine show | ||
|
||
program test | ||
interface | ||
subroutine show (array) | ||
integer :: array(:,:) | ||
end subroutine show | ||
end interface | ||
|
||
integer :: parray(4,4) = reshape((/1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16/),(/4,4/)) | ||
|
||
call show (parray(1:2,1:2)) | ||
end program test |
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