typedef long long T;
T foo(T a, T b)
{
    return a*b+a;
}on Power8 we get:
0000000000000000 <foo>: 0: d2 19 84 7c mulld r4,r4,r3 4: 14 1a 64 7c add r3,r4,r3 8: 20 00 80 4e blr
On power9 we can fold add + mulld to maddld
| Paths 
 |  Differential  D58364  
[PowerPC] exploit P9 new instruction maddld ClosedPublic Authored by shchenz on Feb 18 2019, 6:40 PM. 
Details Summary typedef long long T;
T foo(T a, T b)
{
    return a*b+a;
}on Power8 we get: 0000000000000000 <foo>: 0: d2 19 84 7c mulld r4,r4,r3 4: 14 1a 64 7c add r3,r4,r3 8: 20 00 80 4e blr On power9 we can fold add + mulld to maddld 
Diff Detail 
 Event TimelineComment Actions LGTM once the minor nits are addressed. 
 This revision is now accepted and ready to land.Feb 19 2019, 10:19 AM Closed by commit rL354427: [PowerPC] exploit P9 instruction maddld. (authored by shchenz).  ·  Explain WhyFeb 19 2019, 6:30 PM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
Diff 187487 llvm/trunk/lib/Target/PowerPC/P9InstrResources.td
 llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td
 llvm/trunk/test/CodeGen/PowerPC/maddld.ll
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||