[PATCH] D34337: [PPC] Fix two bugs in frame lowering.

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 18:27:01 PDT 2017


inouehrs added inline comments.


================
Comment at: lib/Target/PowerPC/PPCFrameLowering.cpp:457
+
+  bool FitsInRedZone = FitsInRedZonePPC32 || FitsInRedZonePPC64;
+
----------------
jtony wrote:
> inouehrs wrote:
> > How about adding a function `Subtarget.getAvailableRedZoneSize()`, which returns  288 only when icPPC64 && isSVR4ABI and 224 otherwise?
> I understand why you want to add that function, but if you look at the logic (!Subtarget.isPPC64()) && (FrameSize == 0) can not nicely fit into that refactor. If everything can be fit into the getAvailableRedZoneSize() function and we just use
> bool FitsInRedZone = FrameSize  <= Subtarget.getAvailableRedZoneSize(), the refactoring you mentioned would be more useful.
```
isSVR4ABI && isPPC64 -> return 288
isSVR4ABI && !isPPC64 -> return 0
other -> return  224
```
Is this representing the above conditions? (since FrameSize is unsigned FrameSize == 0 and FrameSize <= 0 is same.)



https://reviews.llvm.org/D34337





More information about the llvm-commits mailing list