mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Turn MipsOptimizeMathLibCalls into a target-independent scalar transform
...so that it can be used for z too. Most of the code is the same. The only real change is to use TargetTransformInfo to test when a sqrt instruction is available. The pass is opt-in because at the moment it only handles sqrt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189097 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -83,6 +83,7 @@ public:
|
||||
virtual unsigned getJumpBufAlignment() const;
|
||||
virtual unsigned getJumpBufSize() const;
|
||||
virtual bool shouldBuildLookupTables() const;
|
||||
virtual bool haveFastSqrt(Type *Ty) const;
|
||||
|
||||
/// @}
|
||||
|
||||
@ -182,6 +183,12 @@ bool BasicTTI::shouldBuildLookupTables() const {
|
||||
TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other));
|
||||
}
|
||||
|
||||
bool BasicTTI::haveFastSqrt(Type *Ty) const {
|
||||
const TargetLoweringBase *TLI = getTLI();
|
||||
EVT VT = TLI->getValueType(Ty);
|
||||
return TLI->isTypeLegal(VT) && TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Calls used by the vectorizers.
|
||||
|
Reference in New Issue
Block a user