Skip to content

Commit

Permalink
PowerPC: Don't hoist float multiply + add to fused operation on SPE
Browse files Browse the repository at this point in the history
SPE doesn't have a fmadd instruction, so don't bother hoisting a
multiply and add sequence to this, as it'd become just a library call.
Hoisting happens too late for the CTR usability test to veto using the
CTR in a loop, and results in an assert "Invalid PPC CTR loop!".
  • Loading branch information
Justin Hibbits committed Aug 10, 2022
1 parent 30abc1a commit f43b228
Show file tree
Hide file tree
Showing 3 changed files with 421 additions and 31 deletions.
2 changes: 2 additions & 0 deletions llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16676,6 +16676,8 @@ bool PPCTargetLowering::isFMAFasterThanFMulAndFAdd(const MachineFunction &MF,

bool PPCTargetLowering::isFMAFasterThanFMulAndFAdd(const Function &F,
Type *Ty) const {
if (Subtarget.hasSPE())
return false;
switch (Ty->getScalarType()->getTypeID()) {
case Type::FloatTyID:
case Type::DoubleTyID:
Expand Down
Loading

0 comments on commit f43b228

Please sign in to comment.