Skip to content

Commit d695c49

Browse files
committed
unaligned only
Created using spr 1.3.6-beta.1
1 parent 2fe0d42 commit d695c49

File tree

3 files changed

+3843
-29749
lines changed

3 files changed

+3843
-29749
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,9 +2495,13 @@ bool RISCVTTIImpl::isProfitableToSinkOperands(
24952495
RISCVTTIImpl::TTI::MemCmpExpansionOptions
24962496
RISCVTTIImpl::enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const {
24972497
TTI::MemCmpExpansionOptions Options;
2498-
Options.AllowOverlappingLoads =
2499-
ST->enableUnalignedScalarMem() &&
2500-
(ST->hasStdExtZbb() || ST->hasStdExtZbkb() || IsZeroCmp);
2498+
// TODO: Enable expansion when unaligned access is not supported after we fix
2499+
// issues in ExpandMemcmp.
2500+
if (!(ST->enableUnalignedScalarMem() &&
2501+
(ST->hasStdExtZbb() || ST->hasStdExtZbkb() || IsZeroCmp)))
2502+
return Options;
2503+
2504+
Options.AllowOverlappingLoads = true;
25012505
Options.MaxNumLoads = TLI->getMaxExpandSizeMemcmp(OptSize);
25022506
Options.NumLoadsPerBlock = Options.MaxNumLoads;
25032507
if (ST->is64Bit())

0 commit comments

Comments
 (0)