[PATCH] D76207: [PowerPC] implement target hook isProfitableToHoist

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 18 07:02:56 PDT 2020


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

LGTM aside from a nit from me and a couple from `clang-format`. I'm sure you can address those on the commit.



================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:15337
+
+  if (User && !(User->getOpcode() == Instruction::FSub ||
+                User->getOpcode() == Instruction::FAdd))
----------------
I think we can omit the check for `nullptr` here since you have already checked the instruction has a use. Perhaps just change it to:
`assert(User && "A single use instruction with no uses?");`

Also, I think it is more common to De-Morgan-ize these conditions to something like
```
if (User->getOpcode() != Instruction::FSub &&
    User->getOpcode() != Instruction::FAdd)
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76207





More information about the llvm-commits mailing list