From: Carl Ritson Date: Tue, 23 Mar 2021 01:56:56 +0000 (+0900) Subject: [AMDGPU] Only unbundle memory accesses in SIMemoryLegalizer X-Git-Tag: llvmorg-14-init~11599 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64db6b8d37554805d08a684c1735c27d7a94bf28;p=platform%2Fupstream%2Fllvm.git [AMDGPU] Only unbundle memory accesses in SIMemoryLegalizer This restores previous behaviour and is a step toward removing unbundling entirely. Reviewed By: foad, rampitec Differential Revision: https://reviews.llvm.org/D99061 --- diff --git a/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp b/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp index da14406..50d1894 100644 --- a/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp +++ b/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp @@ -1841,7 +1841,7 @@ bool SIMemoryLegalizer::runOnMachineFunction(MachineFunction &MF) { for (auto MI = MBB.begin(); MI != MBB.end(); ++MI) { // Unbundle instructions after the post-RA scheduler. - if (MI->isBundle()) { + if (MI->isBundle() && MI->mayLoadOrStore()) { MachineBasicBlock::instr_iterator II(MI->getIterator()); for (MachineBasicBlock::instr_iterator I = ++II, E = MBB.instr_end(); I != E && I->isBundledWithPred(); ++I) { diff --git a/llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.i128.ll b/llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.i128.ll index a57e681..a1b9c2c 100644 --- a/llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.i128.ll +++ b/llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.i128.ll @@ -26,8 +26,8 @@ define amdgpu_ps i128 @extractelement_vgpr_v4i128_sgpr_idx(<4 x i128> addrspace( ; GFX9-NEXT: global_load_dwordx4 v[14:17], v[0:1], off offset:48 ; GFX9-NEXT: s_lshl_b32 s0, s2, 1 ; GFX9-NEXT: s_lshl_b32 s2, s0, 1 -; GFX9-NEXT: s_set_gpr_idx_on s2, gpr_idx(SRC0) ; GFX9-NEXT: s_waitcnt vmcnt(0) +; GFX9-NEXT: s_set_gpr_idx_on s2, gpr_idx(SRC0) ; GFX9-NEXT: v_mov_b32_e32 v0, v2 ; GFX9-NEXT: v_mov_b32_e32 v1, v3 ; GFX9-NEXT: v_mov_b32_e32 v18, v2