Based on comments from Hal (http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/292978.html), I've changed the interface to add a callback mechanism to the TargetFrameLowering class to query whether the specific target supports shrink wrapping. By default, shrink wrapping is disabled by default. Each target can override the default behaviour using the TargetFrameLowering::targetSupportsShrinkWrapping() method. Shrink wrapping can still be explicitly enabled or disabled from the command line, using the existing -enable-shrink-wrap=<true|false> option.
Diff Detail
Event Timeline
Pass the MachineFunction to the targetSupportsShrinkWrapping method, to allow function-specific decisions to be made about whether to shrink-wrap it. PPC needs to make this decision based on the ABI and 32/64 bit.
Hi Kit,
Small nitpicks inlined but LGTM otherwise.
Thanks,
-Quentin
include/llvm/Target/TargetFrameLowering.h | ||
---|---|---|
132 | Do not repeat the method name in the comment. | |
134 | Maybe enableShrinkWrapping? (Personally, I would not repeat target in the method name, but I see that are precedence :).) | |
lib/CodeGen/ShrinkWrap.cpp | ||
155 | Period at the end of the comment. | |
156 | Could be a static method. | |
332 | The formatting seems weird here. | |
332 | Maybe put this check with the previous condition, i.e., if MF.empty || !isShrinkWrapEnabled(MF). |
Please take care of Quentin's "nitpicks", otherwise, LGTM too. Thanks!
include/llvm/Target/TargetFrameLowering.h | ||
---|---|---|
134 | I agree, enableShrinkWrapping seems good. |
Addressed Quentin's comments. I"ll commit this shortly.
lib/CodeGen/ShrinkWrap.cpp | ||
---|---|---|
156 | I've made it static, and dropped the const qualifier as a result. |
Do not repeat the method name in the comment.