[all-commits] [llvm/llvm-project] 0138cc: PowerPC: Treat llvm.fma.f* intrinsic as using CTR ...

Justin Hibbits via All-commits all-commits at lists.llvm.org
Tue May 12 15:21:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0138cc012506d5195ba2a3cf8a98ceb84c5aeffa
      https://github.com/llvm/llvm-project/commit/0138cc012506d5195ba2a3cf8a98ceb84c5aeffa
  Author: Justin Hibbits <jrh29 at alumni.cwru.edu>
  Date:   2020-05-12 (Tue, 12 May 2020)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
    M llvm/test/CodeGen/PowerPC/spe.ll

  Log Message:
  -----------
  PowerPC: Treat llvm.fma.f* intrinsic as using CTR with SPE

Summary:
The SPE doesn't have a 'fma' instruction, so the intrinsic becomes a
libcall.  It really should become an expansion to two instructions, but
for some reason the compiler doesn't think that's as optimal as a
branch.  Since this lowering is done after CTR is allocated for loops,
tell the optimizer that CTR may be used in this case.  This prevents a
"Invalid PPC CTR loop!" assertion in the case that a fma() function call
is used in a C/C++ file, and clang converts it into an intrinsic.

Reviewed By: shchenz
Differential Revision: https://reviews.llvm.org/D78668




More information about the All-commits mailing list