summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorZi Xuan Wu <wuzish@cn.ibm.com>2019-07-23 03:34:40 +0000
committerZi Xuan Wu <wuzish@cn.ibm.com>2019-07-23 03:34:40 +0000
commit57d17ec2e17b8100ecf592d961e85fa867e9af77 (patch)
treec76f80236dc937b06078bee12ea7280fab4dc14f /llvm/lib/Target
parent3a52c3857feb88712901c065672931297fd4ed9b (diff)
downloadbcm5719-llvm-57d17ec2e17b8100ecf592d961e85fa867e9af77.tar.gz
bcm5719-llvm-57d17ec2e17b8100ecf592d961e85fa867e9af77.zip
[PowerPC] Replace float load/store pair with integer load/store pair when it's only used in load/store
Replace float load/store pair with integer load/store pair when it's only used in load/store, because float load/store instructions cost more cycles then integer load/store. A typical scenario is when there is a call with more than 13 float arguments passing, we need pass them by stack. So we need a load/store pair to do such memory operation if the variable is global variable. Differential Revision: https://reviews.llvm.org/D64195 llvm-svn: 366775
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.h b/llvm/lib/Target/PowerPC/PPCISelLowering.h
index 97422c6eda3..ff9423aadee 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.h
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.h
@@ -834,6 +834,18 @@ namespace llvm {
return true;
}
+ bool isDesirableToTransformToIntegerOp(unsigned Opc,
+ EVT VT) const override {
+ // Only handle float load/store pair because float(fpr) load/store
+ // instruction has more cycles than integer(gpr) load/store in PPC.
+ if (Opc != ISD::LOAD && Opc != ISD::STORE)
+ return false;
+ if (VT != MVT::f32 && VT != MVT::f64)
+ return false;
+
+ return true;
+ }
+
// Returns true if the address of the global is stored in TOC entry.
bool isAccessedAsGotIndirect(SDValue N) const;
OpenPOWER on IntegriCloud