mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 00:20:11 +00:00
Add a new pass FunctionTargetTransformInfo. This pass serves as a
shim between the TargetTransformInfo immutable pass and the Subtarget via the TargetMachine and Function. Migrate a single call from BasicTargetTransformInfo as an example and provide shims where TargetMachine begins taking a Function to determine the subtarget. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218004 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -92,7 +92,7 @@ public:
|
||||
unsigned getJumpBufSize() const override;
|
||||
bool shouldBuildLookupTables() const override;
|
||||
bool haveFastSqrt(Type *Ty) const override;
|
||||
void getUnrollingPreferences(Loop *L,
|
||||
void getUnrollingPreferences(const Function *F, Loop *L,
|
||||
UnrollingPreferences &UP) const override;
|
||||
|
||||
/// @}
|
||||
@@ -199,7 +199,7 @@ bool BasicTTI::haveFastSqrt(Type *Ty) const {
|
||||
return TLI->isTypeLegal(VT) && TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
|
||||
}
|
||||
|
||||
void BasicTTI::getUnrollingPreferences(Loop *L,
|
||||
void BasicTTI::getUnrollingPreferences(const Function *F, Loop *L,
|
||||
UnrollingPreferences &UP) const {
|
||||
// This unrolling functionality is target independent, but to provide some
|
||||
// motivation for its intended use, for x86:
|
||||
@@ -225,7 +225,7 @@ void BasicTTI::getUnrollingPreferences(Loop *L,
|
||||
// until someone finds a case where it matters in practice.
|
||||
|
||||
unsigned MaxOps;
|
||||
const TargetSubtargetInfo *ST = &TM->getSubtarget<TargetSubtargetInfo>();
|
||||
const TargetSubtargetInfo *ST = &TM->getSubtarget<TargetSubtargetInfo>(F);
|
||||
if (PartialUnrollingThreshold.getNumOccurrences() > 0)
|
||||
MaxOps = PartialUnrollingThreshold;
|
||||
else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
|
||||
|
||||
Reference in New Issue
Block a user