[PATCH] D15271: Split functions to create shrink wrapping opportunities

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 06:29:02 PST 2015


hfinkel added a comment.

Before we move forward with this, an alternate strategy for this has seemingly presented itself (yesterday) which we should investigate: Enabling saving callee-saved registers by copying.

Please see http://reviews.llvm.org/D15340 (and http://reviews.llvm.org/D15341). Can we build on this somehow to avoid the need to split the functions early, but rather avoid the need for saving the registers in the prologue thus enabling us to shrink wrap the original function?


================
Comment at: lib/Target/PowerPC/PPCEnableShrinkWrap.cpp:84
@@ +83,3 @@
+    if (IntrinsicInst *I = dyn_cast<IntrinsicInst>(V))
+      return I->getIntrinsicID() == Intrinsic::lifetime_end ||
+             I->getIntrinsicID() == Intrinsic::lifetime_start;
----------------
Debug intrinsics also need skipping.

================
Comment at: lib/Target/PowerPC/PPCEnableShrinkWrap.cpp:102
@@ +101,3 @@
+
+    return true;
+  }
----------------
There are many other things that use the stack, at least <= `P7`. int <->  fp conversions, for example, and vector insert/extracts (except with QPX).

================
Comment at: lib/Target/PowerPC/PPCTargetMachine.cpp:242
@@ -238,1 +241,3 @@
 void PPCPassConfig::addIRPasses() {
+  if (TM->getOptLevel() > CodeGenOpt::Default)
+    addPass(createPPCEnableShrinkWrapPass());
----------------
Please don't reformat this whole section of code; please make a minimal change.


http://reviews.llvm.org/D15271





More information about the llvm-commits mailing list