[llvm] [RISCV] Add initial support of memcmp expansion (PR #107548)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 02:57:05 PDT 2024


================
@@ -2113,3 +2113,18 @@ bool RISCVTTIImpl::shouldConsiderAddressTypePromotion(
   }
   return Considerable;
 }
+
+RISCVTTIImpl::TTI::MemCmpExpansionOptions
+RISCVTTIImpl::enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const {
+  TTI::MemCmpExpansionOptions Options;
+  // FIXME: Vector haven't been tested.
+  Options.AllowOverlappingLoads =
+      (ST->enableUnalignedScalarMem() || ST->enableUnalignedScalarMem());
----------------
lukel97 wrote:

Is one supposed to be enableUnalignedVectorMem()?

https://github.com/llvm/llvm-project/pull/107548


More information about the llvm-commits mailing list