[llvm-branch-commits] [llvm] 677e94c - [VE] Clean canRealignStack implementation

Kazushi Marukawa via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 23 04:13:46 PST 2020


Author: Kazushi (Jam) Marukawa
Date: 2020-11-23T21:09:03+09:00
New Revision: 677e94c0f09bf48d92b57a34ba7cf2e0d94016fb

URL: https://github.com/llvm/llvm-project/commit/677e94c0f09bf48d92b57a34ba7cf2e0d94016fb
DIFF: https://github.com/llvm/llvm-project/commit/677e94c0f09bf48d92b57a34ba7cf2e0d94016fb.diff

LOG: [VE] Clean canRealignStack implementation

Old canRealignStack calls TRI::canRealignStack and hasReservedCallFrame.
But, this hasReservedCallFrame return true whenever for VE since VE
allocates call frame all the time.  It means this canRealignStack is
identical to TRI::canRealignStack.  This patch removes VE's
canRealignStack and let caller call TRI::canRealignStack directly.

Reviewed By: simoll

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

Added: 
    

Modified: 
    llvm/lib/Target/VE/VERegisterInfo.cpp
    llvm/lib/Target/VE/VERegisterInfo.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/VE/VERegisterInfo.cpp b/llvm/lib/Target/VE/VERegisterInfo.cpp
index 0559c330368f..07249616c249 100644
--- a/llvm/lib/Target/VE/VERegisterInfo.cpp
+++ b/llvm/lib/Target/VE/VERegisterInfo.cpp
@@ -174,26 +174,3 @@ void VERegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
 Register VERegisterInfo::getFrameRegister(const MachineFunction &MF) const {
   return VE::SX9;
 }
-
-// VE has no architectural need for stack realignment support,
-// except that LLVM unfortunately currently implements overaligned
-// stack objects by depending upon stack realignment support.
-// If that ever changes, this can probably be deleted.
-bool VERegisterInfo::canRealignStack(const MachineFunction &MF) const {
-  if (!TargetRegisterInfo::canRealignStack(MF))
-    return false;
-
-  // VE always has a fixed frame pointer register, so don't need to
-  // worry about needing to reserve it. [even if we don't have a frame
-  // pointer for our frame, it still cannot be used for other things,
-  // or register window traps will be SADNESS.]
-
-  // If there's a reserved call frame, we can use VE to access locals.
-  if (getFrameLowering(MF)->hasReservedCallFrame(MF))
-    return true;
-
-  // Otherwise, we'd need a base pointer, but those aren't implemented
-  // for VE at the moment.
-
-  return false;
-}

diff  --git a/llvm/lib/Target/VE/VERegisterInfo.h b/llvm/lib/Target/VE/VERegisterInfo.h
index 9a32da16bea6..334fb965a986 100644
--- a/llvm/lib/Target/VE/VERegisterInfo.h
+++ b/llvm/lib/Target/VE/VERegisterInfo.h
@@ -40,8 +40,6 @@ struct VERegisterInfo : public VEGenRegisterInfo {
                            RegScavenger *RS = nullptr) const override;
 
   Register getFrameRegister(const MachineFunction &MF) const override;
-
-  bool canRealignStack(const MachineFunction &MF) const override;
 };
 
 } // namespace llvm


        


More information about the llvm-branch-commits mailing list