Skip to content

Commit 34284dd

Browse files
committed
Nagisa's review
1 parent fae3111 commit 34284dd

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

llvm/lib/Target/SBF/SBFISelLowering.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@ SDValue SBFTargetLowering::LowerFormalArguments(
400400
int64_t Offset = static_cast<int64_t>(VA.getLocMemOffset() + Size);
401401
// Since the stack grows to the opposite direction in V3, the offset
402402
// is inverted.
403-
if (!Subtarget->getHasDynamicFramesV3())
403+
if (Subtarget->getFrameLowering()->getStackGrowthDirection() ==
404+
TargetFrameLowering::StackGrowsDown)
404405
Offset = -Offset;
405406

406407
const int FrameIndex =
@@ -527,7 +528,8 @@ SDValue SBFTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
527528

528529
// Since the stack grows to the opposite direction in V3, the offset
529530
// is inverted.
530-
if (Subtarget->getHasDynamicFramesV3())
531+
if (Subtarget->getFrameLowering()->getStackGrowthDirection() ==
532+
TargetFrameLowering::StackGrowsUp)
531533
Offset = -Offset;
532534

533535
int FrameIndex = MF.getFrameInfo().CreateFixedObject(

llvm/lib/Target/SBF/SBFSubtarget.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ void SBFSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
6666

6767
SBFSubtarget::SBFSubtarget(const Triple &TT, const std::string &CPU,
6868
const std::string &FS, const TargetMachine &TM)
69-
: SBFGenSubtargetInfo(TT, cpuFromSubArch(TT, CPU),
70-
/*TuneCPU*/ cpuFromSubArch(TT, CPU), FS),
71-
InstrInfo(), FrameLowering(initializeSubtargetDependencies(
72-
TT, cpuFromSubArch(TT, CPU), FS)
73-
.getHasDynamicFramesV3()),
69+
: SBFGenSubtargetInfo(TT, cpuFromSubArch(TT, CPU),
70+
/*TuneCPU*/ cpuFromSubArch(TT, CPU), FS),
71+
InstrInfo(), FrameLowering(initializeSubtargetDependencies(
72+
TT, cpuFromSubArch(TT, CPU), FS)
73+
.getHasDynamicFramesV3()),
7474
TLInfo(TM, *this) {
7575
assert(TT.getArch() == Triple::sbf && "expected Triple::sbf");
7676

0 commit comments

Comments
 (0)