[PATCH] D71883: [PowerPC] Use PredictableSelectIsExpensive to enable select to branch in CGP
Zhang Kang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 25 18:23:28 PST 2019
ZhangKang created this revision.
Herald added subscribers: llvm-commits, shchenz, jsji, kbarton, hiraditya, kristof.beyls, nemanjai.
Herald added a project: LLVM.
There is a patch D19488 <https://reviews.llvm.org/D19488>: [CodeGenPrepare] use branch weight metadata to decide if a select should be turned into a branch, this patch is for CGP, it will try to convert `SELECT` to branch based on the `BranchProbability`, when the `BranchProbability` more than `MinPercentageForPredictableBranch`(default value is 99%).
The variable `PredictableSelectExpensive` can be set whether we will do this `SELECT to branch` optimization, the default value is false. Now only ARM and X86 has set this variable like this:
For PPC, we should also set the variable `PredictableSelectIsExpensive` to do the `select to if` based on `BranchProbability` in CodeGenPrepare.
https://reviews.llvm.org/D71883
Files:
llvm/lib/Target/PowerPC/PPC.td
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCSubtarget.h
llvm/test/CodeGen/PowerPC/select-to-branch.mir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71883.235308.patch
Type: text/x-patch
Size: 7199 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191226/5fd53713/attachment.bin>
More information about the llvm-commits
mailing list