Skip to content

Commit 45bf9ac

Browse files
committed
[SOL] Reduce cost of floating point expansion (#167)
1 parent 0ab789a commit 45bf9ac

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

llvm/lib/Target/SBF/SBFTargetTransformInfo.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ class SBFTTIImpl : public BasicTTIImplBase<SBFTTIImpl> {
7171
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
7272
ArrayRef<const Value *> Args = ArrayRef<const Value *>(),
7373
const Instruction *CxtI = nullptr) {
74-
int ISD = TLI->InstructionOpcodeToISD(Opcode);
75-
if (ISD == ISD::ADD && CostKind == TTI::TCK_RecipThroughput)
76-
return SCEVCheapExpansionBudget.getValue() + 1;
77-
78-
return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info,
79-
Op2Info);
74+
int ISDOpcode = TLI->InstructionOpcodeToISD(Opcode);
75+
76+
if ((ISDOpcode == ISD::ADD && CostKind == TTI::TCK_RecipThroughput) ||
77+
!Ty->isIntOrPtrTy())
78+
return SCEVCheapExpansionBudget.getValue() + 1;
79+
80+
return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Op1Info,
81+
Op2Info);
8082
}
8183

8284
TTI::MemCmpExpansionOptions enableMemCmpExpansion(bool OptSize,

0 commit comments

Comments
 (0)