[PATCH] D125746: [PowerPC] Treat llvm.fmuladd intrinsic as using CTR

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 20:21:34 PDT 2022


qiucf added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp:505
+              return true;
+            else
+              LLVM_FALLTHROUGH;
----------------
shchenz wrote:
> qiucf wrote:
> > shchenz wrote:
> > > no need for `else`. 
> > > And why we need `LLVM_FALLTHROUGH`, I don't see any handling for `Intrinsic::fmuladd` in the switch block below, will `break` work?
> > Here `FALLTHROUGH` sets `Opcode = ISD::FMA` for `fmuladd`. Code below checks whether `Opcode` is legal or custom, otherwise returns true.
> Oh, yes, right. Then should `case Intrinsic::fma` have the same issue handled in `case Intrinsic::fmuladd` for double double? Or on the other hand, do we need the specific handling in `case Intrinsic::fmuladd`, will Opcode leagl or custom cover the check for type double double?
We don't need it. The legal check already handles the special cases (SPE, ppcf128, etc.). All we need is to put `fmuladd` case here, otherwise `default` statement just `continue` and ignore it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125746



More information about the llvm-commits mailing list