llvm.org GIT mirror llvm / 83f2acb
Revert "AMDGPU: enable 128-bit for local addr space under an option" This reverts commit r329591. It breaks various bots: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/16516 http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/17374 http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/15992 http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/11251 ... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329610 91177308-0d34-0410-b5e6-96231b3b80d8 Alex Shlyapnikov 1 year, 10 months ago
11 changed file(s) with 26 addition(s) and 31 deletion(s). Raw diff Collapse all Expand all
423423 "EnableSIScheduler",
424424 "true",
425425 "Enable SI Machine Scheduler"
426 >;
427
428 def FeatureEnableDS128 : SubtargetFeature<"enable-ds128",
429 "EnableDS128",
430 "true",
431 "Use ds_{read|write}_b128"
432426 >;
433427
434428 // Unless +-flat-for-global is specified, turn on FlatForGlobal for
131131 EnableLoadStoreOpt(false),
132132 EnableUnsafeDSOffsetFolding(false),
133133 EnableSIScheduler(false),
134 EnableDS128(false),
135134 DumpCode(false),
136135
137136 FP64(false),
132132 bool EnableLoadStoreOpt;
133133 bool EnableUnsafeDSOffsetFolding;
134134 bool EnableSIScheduler;
135 bool EnableDS128;
136135 bool DumpCode;
137136
138137 // Subtarget statically properties set by tablegen
412411
413412 /// \returns If target supports ds_read/write_b128 and user enables generation
414413 /// of ds_read/write_b128.
415 bool useDS128() const {
416 return CIInsts && EnableDS128;
414 bool useDS128(bool UserEnable) const {
415 return CIInsts && UserEnable;
417416 }
418417
419418 /// \returns If MUBUF instructions always perform range checking, even for
264264 return 512;
265265 }
266266
267 if (AddrSpace == AS.FLAT_ADDRESS)
267 if (AddrSpace == AS.FLAT_ADDRESS ||
268 AddrSpace == AS.LOCAL_ADDRESS ||
269 AddrSpace == AS.REGION_ADDRESS)
268270 return 128;
269
270 if (AddrSpace == AS.LOCAL_ADDRESS ||
271 AddrSpace == AS.REGION_ADDRESS)
272 return ST->useDS128() ? 128 : 64;
273271
274272 if (AddrSpace == AS.PRIVATE_ADDRESS)
275273 return 8 * ST->getMaxPrivateElementSize();
9393 cl::desc("Use GPR indexing mode instead of movrel for vector indexing"),
9494 cl::init(false));
9595
96 static cl::opt EnableDS128(
97 "amdgpu-ds128",
98 cl::desc("Use DS_read/write_b128"),
99 cl::init(false));
100
96101 static cl::opt AssumeFrameIndexHighZeroBits(
97102 "amdgpu-frame-index-zero-bits",
98103 cl::desc("High bits of frame index assumed to be zero"),
52945299 }
52955300 } else if (AS == AMDGPUASI.LOCAL_ADDRESS) {
52965301 // Use ds_read_b128 if possible.
5297 if (Subtarget->useDS128() && Load->getAlignment() >= 16 &&
5302 if (Subtarget->useDS128(EnableDS128) && Load->getAlignment() >= 16 &&
52985303 MemVT.getStoreSize() == 16)
52995304 return SDValue();
53005305
56975702 }
56985703 } else if (AS == AMDGPUASI.LOCAL_ADDRESS) {
56995704 // Use ds_write_b128 if possible.
5700 if (Subtarget->useDS128() && Store->getAlignment() >= 16 &&
5705 if (Subtarget->useDS128(EnableDS128) && Store->getAlignment() >= 16 &&
57015706 VT.getStoreSize() == 16)
57025707 return SDValue();
57035708
22 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefixes=EG,FUNC %s
33
44 ; Testing for ds_read/write_128
5 ; RUN: llc -march=amdgcn -mcpu=tahiti -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=SI,FUNC %s
6 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
7 ; RUN: llc -march=amdgcn -mcpu=gfx900 -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
5 ; RUN: llc -march=amdgcn -mcpu=tahiti -amdgpu-ds128 < %s | FileCheck -check-prefixes=SI,FUNC %s
6 ; RUN: llc -march=amdgcn -mcpu=tonga -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
7 ; RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
88
99 ; FUNC-LABEL: {{^}}load_f32_local:
1010 ; SICIVI: s_mov_b32 m0
44 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefixes=EG,FUNC %s
55
66 ; Testing for ds_read_b128
7 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
8 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
7 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
8 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
99
1010 ; FUNC-LABEL: {{^}}local_load_f64:
1111 ; SICIV: s_mov_b32 m0
33 ; RUN: llc -march=r600 -mcpu=redwood -verify-machineinstrs < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
44
55 ; Testing for ds_read/write_b128
6 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
7 ; RUN: llc -march=amdgcn -mcpu=gfx900 -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
6 ; RUN: llc -march=amdgcn -mcpu=tonga -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
7 ; RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
88
99 ; FUNC-LABEL: {{^}}local_load_i16:
1010 ; GFX9-NOT: m0
33 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
44
55 ; Testing for ds_read/write_128
6 ; RUN: llc -march=amdgcn -mcpu=tahiti -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=SI,FUNC %s
7 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
8 ; RUN: llc -march=amdgcn -mcpu=gfx900 -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
6 ; RUN: llc -march=amdgcn -mcpu=tahiti -amdgpu-ds128 < %s | FileCheck -check-prefixes=SI,FUNC %s
7 ; RUN: llc -march=amdgcn -mcpu=tonga -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
8 ; RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
99
1010 ; FUNC-LABEL: {{^}}local_load_i32:
1111 ; GCN-NOT: s_wqm_b64
44 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefixes=EG,FUNC %s
55
66 ; Testing for ds_read/write_b128
7 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
8 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
7 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
8 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
99
1010 ; FUNC-LABEL: {{^}}local_load_i64:
1111 ; SICIVI: s_mov_b32 m0
33 ; RUN: llc -march=r600 -mtriple=r600---amdgiz -mcpu=redwood -verify-machineinstrs < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
44
55 ; Testing for ds_read/write_b128
6 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
7 ; RUN: llc -march=amdgcn -mcpu=gfx900 -mattr=+enable-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
6 ; RUN: llc -march=amdgcn -mcpu=tonga -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
7 ; RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-ds128 < %s | FileCheck -check-prefixes=CIVI,FUNC %s
88
99 ; FUNC-LABEL: {{^}}local_load_i8:
1010 ; GCN-NOT: s_wqm_b64