[PATCH] Value soft float calls as more expensive in the inliner.
Tim Northover
t.p.northover at gmail.com
Mon Jan 19 13:06:05 PST 2015
Hi Cameron,
We could probably do with some tests for this, and I think the ARM logic needs a bit of work.
================
Comment at: lib/Target/ARM/ARMSubtarget.h:316-318
@@ -314,1 +315,5 @@
+
+ bool hasFloatingPoint() const {
+ return HasVFPv2 || HasVFPv3 || HasVFPv4 || HasFPARMv8;
+ }
----------------
I don't think this is quite right. The relevant code in ARMISelLowering is:
if (!TM.Options.UseSoftFloat && Subtarget->hasVFP2() &&
!Subtarget->isThumb1Only())
(notably: any CPU with float has VFP2; SoftFloat can be specified even if the hardware supports it; and Thumb1 didn't have access to VFP).
================
Comment at: lib/Target/ARM/ARMTargetTransformInfo.cpp:455
@@ +454,3 @@
+unsigned ARMTTI::getFPOpCost(Type *Ty) const {
+ if (ST->hasFloatingPoint()) {
+ if (Ty->isFloatTy()) {
----------------
I don't think this is quite right. The relevant code in ARMISelLowering is:
if (!TM.Options.UseSoftFloat && Subtarget->hasVFP2() &&
!Subtarget->isThumb1Only())
(notably: any CPU with float has VFP2; SoftFloat can be specified even if the hardware supports it; and Thumb1 didn't have access to VFP).
http://reviews.llvm.org/D6936
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list