[PATCH] D71883: [PowerPC] Use PredictableSelectIsExpensive to enable select to branch in CGP
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 3 05:29:19 PST 2020
nemanjai added inline comments.
================
Comment at: llvm/lib/Target/PowerPC/PPC.td:288
+ FeatureISA3_0,
+ FeaturePredictableSelectIsExpensive
+ ];
----------------
This should certainly be set for Power8 as well.
================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1261
+ // Select is more expensive than a branch if the feature
+ // FeaturePredictableSelectIsExpensive has been set.
+ PredictableSelectIsExpensive = Subtarget.isPredictableSelectIsExpensive();
----------------
I think that having the same name `PredictableSelectIsExpensive` as members of both the TLI and the Subtarget is a bit confusing. At the very least, the comment should be a bit more descriptive. Perhaps:
```
// Let the subtarget (CPU) decide if a predictable select is more
// expensive than the corresponding branch. This information is used
// in CGP to decide when to convert selects into branches.
```
================
Comment at: llvm/lib/Target/PowerPC/PPCSubtarget.h:142
bool UsePPCPostRASchedStrategy;
+ bool PredictableSelectIsExpensive = false;
----------------
For the sake of convention, leave this uninitialized here and initialize it in `PPCSubtarget::initializeEnvironment()` just like all the rest of these.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71883/new/
https://reviews.llvm.org/D71883
More information about the llvm-commits
mailing list