[PATCH] D98791: [PowerPC][NFC] Do not enter prefix selection if it cannot do better.

Victor Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 19 14:00:12 PDT 2021


NeHuang added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1174
+  // selection used one instruction we cannot do better.
+  if (Subtarget.hasPrefixInstrs() && InstCntDirect != 1) {
     unsigned InstCntDirectP = 0;
----------------
Please correct me if I my understand is wrong here. It seems to me `InstCntDirect=1` case has been covered in the check below.
```   
 // If the prefix and non-prefix cases use the same number of instructions
// we will prefer the non-prefix case.
    if (ResultP && (!Result || InstCntDirectP < InstCntDirect))
```
Then intention of adding an early exit for `InstCntDirect == 1` case is to save the trial of calling `selectI64ImmDirectPrefix` and further checks below. 


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