[RISCV][NFC] Move variable down closer to its first use
authorFraser Cormack <fraser@codeplay.com>
Wed, 11 May 2022 11:32:24 +0000 (12:32 +0100)
committerFraser Cormack <fraser@codeplay.com>
Wed, 11 May 2022 11:33:01 +0000 (12:33 +0100)
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp

index e7673ea..87d13aa 100644 (file)
@@ -854,7 +854,6 @@ void RISCVFrameLowering::determineCalleeSaves(MachineFunction &MF,
 
 int64_t
 RISCVFrameLowering::assignRVVStackObjectOffsets(MachineFrameInfo &MFI) const {
-  int64_t Offset = 0;
   // Create a buffer of RVV objects to allocate.
   SmallVector<int, 8> ObjectsToAllocate;
   for (int I = 0, E = MFI.getObjectIndexEnd(); I != E; ++I) {
@@ -868,6 +867,7 @@ RISCVFrameLowering::assignRVVStackObjectOffsets(MachineFrameInfo &MFI) const {
   }
 
   // Allocate all RVV locals and spills
+  int64_t Offset = 0;
   for (int FI : ObjectsToAllocate) {
     // ObjectSize in bytes.
     int64_t ObjectSize = MFI.getObjectSize(FI);