[PATCH] D31790: [PowerPC] Assume intrinsics with 128bit integer operands use CTR
Hal Finkel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 6 17:51:47 PDT 2017
hfinkel added a comment.
> A somewhat minified example IR which reproduces the assertion is attached to the linked bug report -- here I would also appreciate some guidance on in what form / where this can be integrated in the regression tests.
Just running llc on the resulting IR in the usual way should be fine.
================
Comment at: lib/Target/PowerPC/PPCCTRLoops.cpp:250
if (F->getIntrinsicID() != Intrinsic::not_intrinsic) {
+ // Preemtively assume intrinsics operating on 128 integers use CTR
+ for (unsigned OID = 0; OID < CI->getNumArgOperands(); OID++) {
----------------
It looks like we can have a more-targeted fix than this. The problem seems to be restricted to multiply. See below.
================
Comment at: lib/Target/PowerPC/PPCCTRLoops.cpp:317
case Intrinsic::maxnum: Opcode = ISD::FMAXNUM; break;
}
}
----------------
Here add:
case Intrinsic::umul_with_overflow: Opcode = ISD::UMULO; break;
case Intrinsic::smul_with_overflow: Opcode = ISD::SMULO; break;
and I think that should take care of it.
https://reviews.llvm.org/D31790
More information about the llvm-commits
mailing list