Skip to content

Commit 2fe0d42

Browse files
committed
Apply suggestion to AllowOverlappingLoads
Created using spr 1.3.6-beta.1
1 parent 39816b2 commit 2fe0d42

File tree

3 files changed

+792
-2602
lines changed

3 files changed

+792
-2602
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,9 +2495,9 @@ bool RISCVTTIImpl::isProfitableToSinkOperands(
24952495
RISCVTTIImpl::TTI::MemCmpExpansionOptions
24962496
RISCVTTIImpl::enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const {
24972497
TTI::MemCmpExpansionOptions Options;
2498-
// FIXME: Vector haven't been tested.
24992498
Options.AllowOverlappingLoads =
2500-
(ST->enableUnalignedScalarMem() || ST->enableUnalignedVectorMem());
2499+
ST->enableUnalignedScalarMem() &&
2500+
(ST->hasStdExtZbb() || ST->hasStdExtZbkb() || IsZeroCmp);
25012501
Options.MaxNumLoads = TLI->getMaxExpandSizeMemcmp(OptSize);
25022502
Options.NumLoadsPerBlock = Options.MaxNumLoads;
25032503
if (ST->is64Bit())

0 commit comments

Comments
 (0)