diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h index d2414b72a00..812d305da18 100644 --- a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h +++ b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h @@ -49,6 +49,18 @@ public: return AddressSpace::ADDRESS_SPACE_GENERIC; } + // NVPTX has infinite registers of all kinds, but the actual machine doesn't. + // We conservatively return 1 here which is just enough to enable the + // vectorizers but disables heuristics based on the number of registers. + // FIXME: Return a more reasonable number, while keeping an eye on + // LoopVectorizer's unrolling heuristics. + unsigned getNumberOfRegisters(bool Vector) const { return 1; } + + // Only <2 x half> should be vectorized, so always return 32 for the vector + // register size. + unsigned getRegisterBitWidth(bool Vector) const { return 32; } + unsigned getMinVectorRegisterBitWidth() const { return 32; } + // Increase the inlining cost threshold by a factor of 5, reflecting that // calls are particularly expensive in NVPTX. unsigned getInliningThresholdMultiplier() { return 5; } |

