[RISCV] Correct alignment settings for vector registers.
authorHsiangkai Wang <kai.wang@sifive.com>
Fri, 15 Jan 2021 03:27:11 +0000 (11:27 +0800)
committerHsiangkai Wang <kai.wang@sifive.com>
Sat, 16 Jan 2021 15:21:29 +0000 (23:21 +0800)
According to "9. Vector Memory Alignment Constraints" in V
specification, the alignment of vector memory access is aligned to the
size of the element. In our current implementation, we support ELEN up
to 64. We could assume the alignment of vector registers is 64 under the
assumption.

Differential Revision: https://reviews.llvm.org/D94751

llvm/lib/Target/RISCV/RISCVRegisterInfo.td

index 99f74bf..75615fd 100644 (file)
@@ -386,11 +386,10 @@ let RegAltNameIndices = [ABIRegAltName] in {
 class VReg<list<ValueType> regTypes, dag regList, int Vlmul>
   : RegisterClass<"RISCV",
                   regTypes,
-                  // FIXME: Spill alignment set to 16 bytes.
-                  128,
+                  64, // The maximum supported ELEN is 64.
                   regList> {
   int VLMul = Vlmul;
-  int Size = !mul(Vlmul, 64); // FIXME: assuming ELEN=64
+  int Size = !mul(Vlmul, 64);
 }
 
 def VR : VReg<[vint8mf2_t, vint8mf4_t, vint8mf8_t,