diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp index a0200690c0c1b..a2f04d235c793 100644 --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -1362,11 +1362,12 @@ bool SITargetLowering::isLegalAddressingMode(const DataLayout &DL, return true; return false; + } - } else if (AS == AMDGPUAS::PRIVATE_ADDRESS) { + if (AS == AMDGPUAS::PRIVATE_ADDRESS) return isLegalMUBUFAddressingMode(AM); - } else if (AS == AMDGPUAS::LOCAL_ADDRESS || - AS == AMDGPUAS::REGION_ADDRESS) { + + if (AS == AMDGPUAS::LOCAL_ADDRESS || AS == AMDGPUAS::REGION_ADDRESS) { // Basic, single offset DS instructions allow a 16-bit unsigned immediate // field. // XXX - If doing a 4-byte aligned 8-byte type access, we effectively have @@ -1381,8 +1382,9 @@ bool SITargetLowering::isLegalAddressingMode(const DataLayout &DL, return true; return false; - } else if (AS == AMDGPUAS::FLAT_ADDRESS || - AS == AMDGPUAS::UNKNOWN_ADDRESS_SPACE) { + } + + if (AS == AMDGPUAS::FLAT_ADDRESS || AS == AMDGPUAS::UNKNOWN_ADDRESS_SPACE) { // For an unknown address space, this usually means that this is for some // reason being used for pure arithmetic, and not based on some addressing // computation. We don't have instructions that compute pointers with any