diff options
author | Quentin Colombet <qcolombet@apple.com> | 2015-08-27 23:47:10 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2015-08-27 23:47:10 +0000 |
commit | fa4ecb4b9a951fc7cce3053bcb1a3e65abcb4472 (patch) | |
tree | 261419aec9c3ac20b51c0300fb0551cc339cf6e0 /llvm/lib/Target/AArch64/AArch64CollectLOH.cpp | |
parent | f0fa8a80a384a61ff2dbfdee028ec000e1b5c697 (diff) | |
download | bcm5719-llvm-fa4ecb4b9a951fc7cce3053bcb1a3e65abcb4472.tar.gz bcm5719-llvm-fa4ecb4b9a951fc7cce3053bcb1a3e65abcb4472.zip |
[AArch64][CollectLOH] Fix a regression that prevented us to detect chains of
more than 2 instructions.
I introduced this regression a while back and did not noticed it because I
somehow forgot to push the initial test cases for the pass!
Fix that as well!
llvm-svn: 246239
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64CollectLOH.cpp')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64CollectLOH.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp b/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp index 315aee76158..68d4a55fee4 100644 --- a/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp +++ b/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp @@ -523,6 +523,8 @@ static bool isCandidateStore(const MachineInstr *Instr) { switch (Instr->getOpcode()) { default: return false; + case AArch64::STRBBui: + case AArch64::STRHHui: case AArch64::STRBui: case AArch64::STRHui: case AArch64::STRWui: @@ -884,7 +886,8 @@ static void computeOthers(const InstrToInstrs &UseToDefs, bool IsL2Add = (ImmediateDefOpc == AArch64::ADDXri); // If the chain is three instructions long and ldr is the second element, // then this ldr must load form GOT, otherwise this is not a correct chain. - if (L2 && !IsL2Add && L2->getOperand(2).getTargetFlags() != AArch64II::MO_GOT) + if (L2 && !IsL2Add && + !(L2->getOperand(2).getTargetFlags() & AArch64II::MO_GOT)) continue; SmallVector<const MachineInstr *, 3> Args; MCLOHType Kind; @@ -1000,7 +1003,8 @@ static void collectInvolvedReg(const MachineFunction &MF, MapRegToId &RegToId, DEBUG(dbgs() << "** Collect Involved Register\n"); for (const auto &MBB : MF) { for (const MachineInstr &MI : MBB) { - if (!canDefBePartOfLOH(&MI)) + if (!canDefBePartOfLOH(&MI) && + !isCandidateLoad(&MI) && !isCandidateStore(&MI)) continue; // Process defs |