[PATCH] D60402: [PowerPC] Collapse RLDICL/RLDICR into RLDIC when possible

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 04:41:08 PDT 2019


nemanjai marked 3 inline comments as done.
nemanjai added inline comments.


================
Comment at: lib/Target/PowerPC/PPCMIPeephole.cpp:51
+STATISTIC(NumRotatesCollapsed,
+          "Number of pairs of rotate left, clear left/right colapsed");
 
----------------
stefanp wrote:
> nit:
> collapsed
Good catch, thanks.


================
Comment at: lib/Target/PowerPC/PPCMIPeephole.cpp:793
+        // The bits cleared with RLDIC are [0, NewMB) and (63-NewSH, 63].
+        if ((63 - NewSH) != MEMI)
+          break;
----------------
stefanp wrote:
> The value for `(63 - NewSH)` can also be negative and I think it needs to be a special case.
> Each shift has to be less than or equal to 63 but the sum of two shifts can be greater than 63.
These are very good points. I will add a check to bail out if either `NewMB` or `NewSH` are larger than 63.


================
Comment at: test/CodeGen/PowerPC/collapse-rotates.mir:53
+constants:       []
+machineFunctionInfo: {}
+body:             |
----------------
stefanp wrote:
> Had to delete this line on the machine I was running on to get this test to pass...
> The error is:
> ```
> error: YAML:53:23: unknown key 'machineFunctionInfo'
> machineFunctionInfo: {}
> ```
> I'm not sure what the issue is here but I feel like that line is not universally supported.
I am not sure what that's about. Perhaps you were on an older revision where that wasn't part of MIR?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60402/new/

https://reviews.llvm.org/D60402





More information about the llvm-commits mailing list