[PATCH] D137423: [PowerPC] make expensive mflr be away from its user in the function prologue
ChenZheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 7 22:47:48 PST 2022
shchenz marked an inline comment as done.
shchenz added inline comments.
================
Comment at: llvm/lib/Target/PowerPC/PPCFrameLowering.cpp:621
+ // expensive. We need to consider the latency when backup lr in the prologue.
+ const bool IsCheapMFLR = Subtarget.isISA3_1();
+
----------------
RolandF wrote:
> The cost of an mflr is a characteristic of an implementation, not of the architecture. A future processor might have a slow mflr. I think a new subtarget feature is needed for this.
I added a new patch https://reviews.llvm.org/D137612 to add the subtarget feature. Seems for P10, the latency for mflr is only 2 cycles, so I only set the new feature for P10.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137423/new/
https://reviews.llvm.org/D137423
More information about the llvm-commits
mailing list