diff options
author | Hiroshi Yamauchi <yamauchi@google.com> | 2019-11-11 10:59:36 -0800 |
---|---|---|
committer | Hiroshi Yamauchi <yamauchi@google.com> | 2019-11-21 14:16:00 -0800 |
commit | 52e377497ddc3aa7178d4fd4c0cda096df4d8a72 (patch) | |
tree | 86b84d9ff3012c4c5984b748c99650babd8aabcb /llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | |
parent | 844d97f650a2d716e63e3be903c32a82f2f817b1 (diff) | |
download | bcm5719-llvm-52e377497ddc3aa7178d4fd4c0cda096df4d8a72.tar.gz bcm5719-llvm-52e377497ddc3aa7178d4fd4c0cda096df4d8a72.zip |
[PGO][PGSO] DAG.shouldOptForSize part.
Summary:
(Split of off D67120)
SelectionDAG::shouldOptForSize changes for profile guided size optimization.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70095
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp index 4d4f76e8e91..ae6c1429e56 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp @@ -39,20 +39,16 @@ class AArch64DAGToDAGISel : public SelectionDAGISel { /// make the right decision when generating code for different targets. const AArch64Subtarget *Subtarget; - bool ForCodeSize; - public: explicit AArch64DAGToDAGISel(AArch64TargetMachine &tm, CodeGenOpt::Level OptLevel) - : SelectionDAGISel(tm, OptLevel), Subtarget(nullptr), - ForCodeSize(false) {} + : SelectionDAGISel(tm, OptLevel), Subtarget(nullptr) {} StringRef getPassName() const override { return "AArch64 Instruction Selection"; } bool runOnMachineFunction(MachineFunction &MF) override { - ForCodeSize = MF.getFunction().hasOptSize(); Subtarget = &MF.getSubtarget<AArch64Subtarget>(); return SelectionDAGISel::runOnMachineFunction(MF); } @@ -399,7 +395,7 @@ static bool isWorthFoldingSHL(SDValue V) { bool AArch64DAGToDAGISel::isWorthFolding(SDValue V) const { // Trivial if we are optimizing for code size or if there is only // one use of the value. - if (ForCodeSize || V.hasOneUse()) + if (CurDAG->shouldOptForSize() || V.hasOneUse()) return true; // If a subtarget has a fastpath LSL we can fold a logical shift into // the addressing mode and save a cycle. |