# REQUIRES: amdgpu-registered-target # RUN: llc -mtriple=amdgcn --passes='regallocfast,regallocfast,regallocfast' --print-pipeline-passes --filetype=null %s | FileCheck %s --check-prefix=PASS # RUN: not llc -mtriple=amdgcn --passes='regallocfast' --print-pipeline-passes --filetype=null %s 2>&1 | FileCheck %s --check-prefix=BAD-FILTER # Test default behavior at -O0: uses fast allocator # RUN: llc -mtriple=amdgcn -enable-new-pm -O0 -print-pipeline-passes -filetype=null %s 2>&1 | FileCheck %s --check-prefix=DEFAULT-O0 # Test default behavior at -O2: uses greedy allocator # RUN: llc -mtriple=amdgcn -enable-new-pm -O2 -print-pipeline-passes -filetype=null %s 2>&1 | FileCheck %s --check-prefix=DEFAULT-O2 # Test AMDGPU-specific NPM regalloc options # RUN: llc -mtriple=amdgcn -enable-new-pm -sgpr-regalloc-npm=fast -wwm-regalloc-npm=fast -vgpr-regalloc-npm=fast -print-pipeline-passes -filetype=null %s 2>&1 | FileCheck %s --check-prefix=NPM-FAST # RUN: llc -mtriple=amdgcn -enable-new-pm -O3 -sgpr-regalloc-npm=greedy -wwm-regalloc-npm=greedy -vgpr-regalloc-npm=greedy -print-pipeline-passes -filetype=null %s 2>&1 | FileCheck %s --check-prefix=NPM-GREEDY # RUN: llc -mtriple=amdgcn -enable-new-pm -O3 -sgpr-regalloc-npm=fast -print-pipeline-passes -filetype=null %s 2>&1 | FileCheck %s --check-prefix=NPM-MIXED # Test error cases for unsupported allocators # RUN: not llc -mtriple=amdgcn -enable-new-pm -sgpr-regalloc-npm=basic -filetype=null %s 2>&1 | FileCheck %s --check-prefix=ERR-BASIC # RUN: not llc -mtriple=amdgcn -enable-new-pm -vgpr-regalloc-npm=pbqp -filetype=null %s 2>&1 | FileCheck %s --check-prefix=ERR-PBQP # Test error when legacy PM options are used with NPM # RUN: not llc -mtriple=amdgcn -enable-new-pm -sgpr-regalloc=greedy -filetype=null %s 2>&1 | FileCheck %s --check-prefix=ERR-LEGACY # Test error when generic --regalloc-npm is used with AMDGPU # RUN: not llc -mtriple=amdgcn -enable-new-pm -regalloc-npm=fast -filetype=null %s 2>&1 | FileCheck %s --check-prefix=ERR-GENERIC # PASS: regallocfast # PASS: regallocfast # PASS: regallocfast # BAD-FILTER: invalid regallocfast register filter 'bad-filter' # At -O0, default uses fast allocator for all register classes. # DEFAULT-O0: regallocfast # DEFAULT-O2: greedy # DEFAULT-O2: greedy # NPM-FAST: regallocfast # NPM-GREEDY: greedy # NPM-GREEDY: greedy # At -O3, default is greedy. With -sgpr-regalloc-npm=fast, SGPR uses fast, # but WWM and VGPR still use greedy. # NPM-MIXED: regallocfast # NPM-MIXED: greedy # Error messages for unsupported allocators. # ERR-BASIC: unsupported register allocator 'basic' for SGPR registers # ERR-PBQP: unsupported register allocator 'pbqp' for VGPR registers # Error message for legacy PM options with NPM. # ERR-LEGACY: -sgpr-regalloc, -vgpr-regalloc, and -wwm-regalloc are legacy PM options # Error message for generic --regalloc-npm with AMDGPU. # ERR-GENERIC: -regalloc-npm not supported for amdgcn --- name: f ...