[PATCH] D36734: [PowerPC Peephole] Constants into a join add, use ADDI over LI/ADD.

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 05:45:55 PDT 2017


nemanjai accepted this revision.
nemanjai added a comment.
This revision is now accepted and ready to land.

LGTM. Just a request for a comment to be added to the code.



================
Comment at: lib/Target/PowerPC/PPCMIPeephole.cpp:366
+
+      case PPC::ADD4:
+      case PPC::ADD8: {
----------------
jtony wrote:
> inouehrs wrote:
> > Why specific to add?
> > Don't we have much optimization opportunity for arithmetic operations other than add?
> Discussed in our scrum, we don't want to do this for now.
It is fine to leave it as is for the time being. But please add a comment such as this:
```
// FIXME: Any instruction that has an immediate form fed only by
// a PHI whose operands are all load immediate can be folded away.
// We currently do this for ADD instructions, but should expand it to
// arithmetic and binary instructions with immediate forms in the future.
```


https://reviews.llvm.org/D36734





More information about the llvm-commits mailing list