Skip to content

Reland "[NFC][AMDGPU] Do not flush after printing every instruction" #95248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ void AMDGPUInstPrinter::printRegName(raw_ostream &OS, MCRegister Reg) const {
void AMDGPUInstPrinter::printInst(const MCInst *MI, uint64_t Address,
StringRef Annot, const MCSubtargetInfo &STI,
raw_ostream &OS) {
OS.flush();
printInstruction(MI, Address, STI, OS);
printAnnotation(OS, Annot);
}
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Target/AMDGPU/MCTargetDesc/R600InstPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ using namespace llvm;
void R600InstPrinter::printInst(const MCInst *MI, uint64_t Address,
StringRef Annot, const MCSubtargetInfo &STI,
raw_ostream &O) {
O.flush();
printInstruction(MI, Address, O);
printAnnotation(O, Annot);
}
Expand Down
72 changes: 17 additions & 55 deletions llvm/test/MC/AMDGPU/hsa-sym-expr-failure.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
// they don't depend on yet-unknown symbolic values.

.text
// ASM: .text

.amdhsa_code_object_version 4
// ASM: .amdhsa_code_object_version 4

.p2align 8
.type user_sgpr_count,@function
Expand All @@ -19,11 +17,10 @@ user_sgpr_count:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_user_sgpr_count defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_user_sgpr_count

.p2align 8
.type user_sgpr_private_segment_buffer,@function
Expand All @@ -34,12 +31,10 @@ user_sgpr_private_segment_buffer:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_user_sgpr_private_segment_buffer defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_user_sgpr_private_segment_buffer

.p2align 8
.type user_sgpr_kernarg_preload_length,@function
user_sgpr_kernarg_preload_length:
Expand All @@ -49,12 +44,10 @@ user_sgpr_kernarg_preload_length:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just precommit the unrelated test changes

.amdhsa_user_sgpr_kernarg_preload_length defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_user_sgpr_kernarg_preload_length defined_boolean

.p2align 8
.type user_sgpr_kernarg_preload_offset,@function
user_sgpr_kernarg_preload_offset:
Expand All @@ -64,12 +57,10 @@ user_sgpr_kernarg_preload_offset:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_user_sgpr_kernarg_preload_offset defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_user_sgpr_kernarg_preload_offset defined_boolean

.p2align 8
.type user_sgpr_dispatch_ptr,@function
user_sgpr_dispatch_ptr:
Expand All @@ -80,12 +71,10 @@ user_sgpr_dispatch_ptr:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_user_sgpr_dispatch_ptr defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_user_sgpr_dispatch_ptr

.p2align 8
.type user_sgpr_queue_ptr,@function
user_sgpr_queue_ptr:
Expand All @@ -96,12 +85,10 @@ user_sgpr_queue_ptr:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_user_sgpr_queue_ptr defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_user_sgpr_queue_ptr

.p2align 8
.type user_sgpr_kernarg_segment_ptr,@function
user_sgpr_kernarg_segment_ptr:
Expand All @@ -112,12 +99,10 @@ user_sgpr_kernarg_segment_ptr:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_user_sgpr_kernarg_segment_ptr defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_user_sgpr_kernarg_segment_ptr

.p2align 8
.type user_sgpr_dispatch_id,@function
user_sgpr_dispatch_id:
Expand All @@ -128,12 +113,10 @@ user_sgpr_dispatch_id:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_user_sgpr_dispatch_id defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_user_sgpr_dispatch_id

.p2align 8
.type user_sgpr_flat_scratch_init,@function
user_sgpr_flat_scratch_init:
Expand All @@ -144,12 +127,10 @@ user_sgpr_flat_scratch_init:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_user_sgpr_flat_scratch_init defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_user_sgpr_flat_scratch_init

.p2align 8
.type user_sgpr_private_segment_size,@function
user_sgpr_private_segment_size:
Expand All @@ -160,12 +141,10 @@ user_sgpr_private_segment_size:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_user_sgpr_private_segment_size defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_user_sgpr_private_segment_size

.p2align 8
.type wavefront_size32,@function
wavefront_size32:
Expand All @@ -176,27 +155,23 @@ wavefront_size32:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_wavefront_size32 defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_wavefront_size32

.p2align 8
.type next_free_vgpr,@function
next_free_vgpr:
s_endpgm

.p2align 6
.amdhsa_kernel next_free_vgpr
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_next_free_vgpr defined_boolean
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_next_free_vgpr

.p2align 8
.type next_free_sgpr,@function
next_free_sgpr:
Expand All @@ -205,13 +180,11 @@ next_free_sgpr:
.p2align 6
.amdhsa_kernel next_free_sgpr
.amdhsa_next_free_vgpr 0
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_next_free_sgpr defined_boolean
.amdhsa_accum_offset 4
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_next_free_sgpr

.p2align 8
.type accum_offset,@function
accum_offset:
Expand All @@ -221,12 +194,10 @@ accum_offset:
.amdhsa_kernel accum_offset
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_accum_offset defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_accum_offset

.p2align 8
.type reserve_vcc,@function
reserve_vcc:
Expand All @@ -237,12 +208,10 @@ reserve_vcc:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_reserve_vcc defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_reserve_vcc

.p2align 8
.type reserve_flat_scratch,@function
reserve_flat_scratch:
Expand All @@ -253,12 +222,10 @@ reserve_flat_scratch:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_reserve_flat_scratch defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_reserve_flat_scratch

.p2align 8
.type shared_vgpr_count,@function
shared_vgpr_count:
Expand All @@ -269,13 +236,8 @@ shared_vgpr_count:
.amdhsa_next_free_vgpr 0
.amdhsa_next_free_sgpr 0
.amdhsa_accum_offset 4
// ASM: :[[@LINE+1]]:{{[0-9]+}}: error: directive should have resolvable expression
.amdhsa_shared_vgpr_count defined_boolean
.end_amdhsa_kernel

// ASM: error: directive should have resolvable expression
// ASM-NEXT: .amdhsa_shared_vgpr_count

.set defined_boolean, 1

// ASM: .set defined_boolean, 1
// ASM-NEXT: .no_dead_strip defined_boolean
Loading