[llvm] dd30aa8 - [RISCV][TTI] Simplify compound check for readability [nfc] (#121504)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 09:36:04 PST 2025


Author: Philip Reames
Date: 2025-01-02T09:36:01-08:00
New Revision: dd30aa83aa12e5b2b5e58cb72ec85070f725df34

URL: https://github.com/llvm/llvm-project/commit/dd30aa83aa12e5b2b5e58cb72ec85070f725df34
DIFF: https://github.com/llvm/llvm-project/commit/dd30aa83aa12e5b2b5e58cb72ec85070f725df34.diff

LOG: [RISCV][TTI] Simplify compound check for readability [nfc] (#121504)

I misread this check earlier today on a review, so restructure it to be
easier to quickly scan.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
index 0abb270edcabc8..909a64e9742554 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -2558,8 +2558,10 @@ RISCVTTIImpl::enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const {
   TTI::MemCmpExpansionOptions Options;
   // TODO: Enable expansion when unaligned access is not supported after we fix
   // issues in ExpandMemcmp.
-  if (!(ST->enableUnalignedScalarMem() &&
-        (ST->hasStdExtZbb() || ST->hasStdExtZbkb() || IsZeroCmp)))
+  if (!ST->enableUnalignedScalarMem())
+    return Options;
+
+  if (!ST->hasStdExtZbb() && !ST->hasStdExtZbkb() && !IsZeroCmp)
     return Options;
 
   Options.AllowOverlappingLoads = true;


        


More information about the llvm-commits mailing list