[PowerPC] Map max/minnum intrinsics and fmax/fmin to ISD nodes for CTR-based loop...
authorHal Finkel <hfinkel@anl.gov>
Sun, 27 Mar 2016 05:40:56 +0000 (05:40 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 27 Mar 2016 05:40:56 +0000 (05:40 +0000)
commit0b37175ca6822aafdbf5352cbbf469f2bf0bf1bd
treea00c230c7a1fd11def9099f07bc1cc84fdf94ef5
parentf95aa56c79b6e0706be737e8f5d3f50fb7553c5c
[PowerPC] Map max/minnum intrinsics and fmax/fmin to ISD nodes for CTR-based loop legality

Intrinsic::maxnum and Intrinsic::minnum, along with the associated libc
function calls (fmax[f], etc.) generally map to function calls after lowering.
For some vector types with QPX at least, however, we can legally lower these,
and we don't need to prohibit CTR-based loops on their account.

It turned out, however, that the logic that checked the opcodes associated with
intrinsics was broken (it would set the Opcode variable, but that variable was
later checked only if set for some otherwise-external function call.

This fixes the latter problem and adds the FMAX/MINNUM mappings.

llvm-svn: 264532
llvm/lib/Target/PowerPC/PPCCTRLoops.cpp
llvm/test/CodeGen/PowerPC/ctr-minmaxnum.ll