summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-03-28 13:29:47 +0000
committerHal Finkel <hfinkel@anl.gov>2013-03-28 13:29:47 +0000
commitc53ab4d77f4b3d2905cf9ad625c28ff6b1c04aff (patch)
treeb2fcb51be8d19be85b7154477017f83ee096e6da /lib/Target/PowerPC/PPCTargetTransformInfo.cpp
parentf464481db0c3b5404004b510921ca454803fd1d0 (diff)
downloadllvm-c53ab4d77f4b3d2905cf9ad625c28ff6b1c04aff.tar.gz
llvm-c53ab4d77f4b3d2905cf9ad625c28ff6b1c04aff.tar.bz2
llvm-c53ab4d77f4b3d2905cf9ad625c28ff6b1c04aff.tar.xz
Add the PPC64 popcntd instruction
PPC ISA 2.06 (P7, A2, etc.) has a popcntd instruction. Add this instruction and tell TTI about it so that popcount-loop recognition will know about it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178233 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCTargetTransformInfo.cpp')
-rw-r--r--lib/Target/PowerPC/PPCTargetTransformInfo.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
index 5e9ad347d3..00037edafc 100644
--- a/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
+++ b/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
@@ -122,9 +122,8 @@ llvm::createPPCTargetTransformInfoPass(const PPCTargetMachine *TM) {
PPCTTI::PopcntSupportKind PPCTTI::getPopcntSupport(unsigned TyWidth) const {
assert(isPowerOf2_32(TyWidth) && "Ty width must be power of 2");
- // FIXME: PPC currently does not have custom popcnt lowering even though
- // there is hardware support. Once this is fixed, update this function
- // to reflect the real capabilities of the hardware.
+ if (ST->hasPOPCNTD() && TyWidth <= 64)
+ return PSK_FastHardware;
return PSK_Software;
}