[llvm] cf736e2 - [AMDGPU] Avoid else-after-return in isLegalAddressingMode. NFC.
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 13 08:56:20 PDT 2023
Author: Jay Foad
Date: 2023-04-13T16:55:58+01:00
New Revision: cf736e232573c772f96ced4dd45f5d7340c644a1
URL: https://github.com/llvm/llvm-project/commit/cf736e232573c772f96ced4dd45f5d7340c644a1
DIFF: https://github.com/llvm/llvm-project/commit/cf736e232573c772f96ced4dd45f5d7340c644a1.diff
LOG: [AMDGPU] Avoid else-after-return in isLegalAddressingMode. NFC.
Added:
Modified:
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
Removed:
################################################################################
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
More information about the llvm-commits
mailing list