@@ -1924,7 +1924,7 @@ bool RISCVTargetLowering::shouldConvertConstantLoadToIntImm(const APInt &Imm,
1924
1924
// replace. If we don't support unaligned scalar mem, prefer the constant
1925
1925
// pool.
1926
1926
// TODO: Can the caller pass down the alignment?
1927
- if (!Subtarget.hasFastUnalignedAccess ())
1927
+ if (!Subtarget.enableUnalignedScalarMem ())
1928
1928
return true;
1929
1929
1930
1930
// Prefer to keep the load if it would require many instructions.
@@ -15837,7 +15837,7 @@ static bool matchIndexAsWiderOp(EVT VT, SDValue Index, SDValue Mask,
15837
15837
if (WiderElementSize > ST.getELen()/8)
15838
15838
return false;
15839
15839
15840
- if (!ST.hasFastUnalignedAccess () && BaseAlign < WiderElementSize)
15840
+ if (!ST.enableUnalignedVectorMem () && BaseAlign < WiderElementSize)
15841
15841
return false;
15842
15842
15843
15843
for (unsigned i = 0; i < Index->getNumOperands(); i++) {
@@ -20663,8 +20663,8 @@ bool RISCVTargetLowering::allowsMisalignedMemoryAccesses(
20663
20663
unsigned *Fast) const {
20664
20664
if (!VT.isVector()) {
20665
20665
if (Fast)
20666
- *Fast = Subtarget.hasFastUnalignedAccess ();
20667
- return Subtarget.hasFastUnalignedAccess ();
20666
+ *Fast = Subtarget.enableUnalignedScalarMem ();
20667
+ return Subtarget.enableUnalignedScalarMem ();
20668
20668
}
20669
20669
20670
20670
// All vector implementations must support element alignment
@@ -20680,8 +20680,8 @@ bool RISCVTargetLowering::allowsMisalignedMemoryAccesses(
20680
20680
// misaligned accesses. TODO: Work through the codegen implications of
20681
20681
// allowing such accesses to be formed, and considered fast.
20682
20682
if (Fast)
20683
- *Fast = Subtarget.hasFastUnalignedAccess ();
20684
- return Subtarget.hasFastUnalignedAccess ();
20683
+ *Fast = Subtarget.enableUnalignedVectorMem ();
20684
+ return Subtarget.enableUnalignedVectorMem ();
20685
20685
}
20686
20686
20687
20687
@@ -20716,7 +20716,7 @@ EVT RISCVTargetLowering::getOptimalMemOpType(const MemOp &Op,
20716
20716
20717
20717
// Do we have sufficient alignment for our preferred VT? If not, revert
20718
20718
// to largest size allowed by our alignment criteria.
20719
- if (PreferredVT != MVT::i8 && !Subtarget.hasFastUnalignedAccess ()) {
20719
+ if (PreferredVT != MVT::i8 && !Subtarget.enableUnalignedVectorMem ()) {
20720
20720
Align RequiredAlign(PreferredVT.getStoreSize());
20721
20721
if (Op.isFixedDstAlign())
20722
20722
RequiredAlign = std::min(RequiredAlign, Op.getDstAlign());
@@ -20908,7 +20908,7 @@ bool RISCVTargetLowering::isLegalStridedLoadStore(EVT DataType,
20908
20908
if (!isLegalElementTypeForRVV(ScalarType))
20909
20909
return false;
20910
20910
20911
- if (!Subtarget.hasFastUnalignedAccess () &&
20911
+ if (!Subtarget.enableUnalignedVectorMem () &&
20912
20912
Alignment < ScalarType.getStoreSize())
20913
20913
return false;
20914
20914
0 commit comments