[PATCH] D11817: Enable Shrink Wrapping for PPC64.
hfinkel@anl.gov via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 12 02:01:08 PDT 2015
hfinkel added inline comments.
================
Comment at: lib/Target/PowerPC/PPCFrameLowering.cpp:1002
@@ -1011,20 +1001,3 @@
- bool UsesTCRet = RetOpcode == PPC::TCRETURNri ||
- RetOpcode == PPC::TCRETURNdi ||
- RetOpcode == PPC::TCRETURNai ||
- RetOpcode == PPC::TCRETURNri8 ||
- RetOpcode == PPC::TCRETURNdi8 ||
- RetOpcode == PPC::TCRETURNai8;
-
- if (UsesTCRet) {
- int MaxTCRetDelta = FI->getTailCallSPDelta();
- MachineOperand &StackAdjust = MBBI->getOperand(1);
- assert(StackAdjust.isImm() && "Expecting immediate value.");
- // Adjust stack pointer.
- int StackAdj = StackAdjust.getImm();
- int Delta = StackAdj - MaxTCRetDelta;
- assert((Delta >= 0) && "Delta must be positive");
- if (MaxTCRetDelta>0)
- FrameSize += (StackAdj +Delta);
- else
- FrameSize += StackAdj;
+ bool IsRB = MBBI->isReturn();
+
----------------
Does RB stand for Return Block? Please use a more verbose name.
================
Comment at: lib/Target/PowerPC/PPCTargetMachine.cpp:388
@@ +387,3 @@
+bool PPCPassConfig::runShrinkWrap(const MachineFunction &Fn) const {
+ return (EnableShrinkWrapOpt != cl::BOU_FALSE &&
+ Fn.getSubtarget<PPCSubtarget>().isSVR4ABI() &&
----------------
Don't add a dependency on EnableShrinkWrapOpt here. We would need to duplicate this checking logic in every target, and that's not a good design. (and the command-line argument itself is an internal detail of ShrinkWrap.cpp). Please have the code in ShrinkWrap.cpp (or Passes.cpp) check this before calling the target specific callback.
http://reviews.llvm.org/D11817
More information about the llvm-commits
mailing list