Skip to content

Commit 431ae7e

Browse files
committed
Don't generate vectors if no aligned vector access
Created using spr 1.3.6-beta.1
1 parent d876b41 commit 431ae7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2527,7 +2527,7 @@ RISCVTTIImpl::enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const {
25272527
Options.LoadSizes = {8, 4, 2, 1};
25282528
else
25292529
Options.LoadSizes = {4, 2, 1};
2530-
if (IsZeroCmp && ST->hasVInstructions()) {
2530+
if (IsZeroCmp && ST->hasVInstructions() && ST->enableUnalignedVectorMem()) {
25312531
unsigned RealMinVLen = ST->getRealMinVLen();
25322532
// Support Fractional LMULs if the lengths are larger than XLen.
25332533
// TODO: Support non-power-of-2 types.

0 commit comments

Comments
 (0)