[PATCH] D98791: [PowerPC][NFC] Do not enter prefix selection if it cannot do better.
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 19 19:37:55 PDT 2021
nemanjai accepted this revision.
nemanjai added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1173
+ // trying to materialize using perfix instructions. If the non prefix
+ // selection used one instruction we cannot do better.
+ if (Subtarget.hasPrefixInstrs() && InstCntDirect != 1) {
----------------
I think you should simplify this comment to something like:
```
// If we have prefixed instructions and there is a chance we can
// materialize the constant with fewer prefixed instructions than
// non-prefixed, try that.
```
This clearly communicates that there is no point doing any further checks if we can materialize this with just a single non-prefixed instruction (i.e. we won't be able to materialize it with zero instructions).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98791/new/
https://reviews.llvm.org/D98791
More information about the llvm-commits
mailing list