diff options
author | Chad Rosier <mcrosier@codeaurora.org> | 2016-02-10 15:52:46 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@codeaurora.org> | 2016-02-10 15:52:46 +0000 |
commit | fc3bf1f5267a3432ea50114960d16cedec0a3804 (patch) | |
tree | 79dfa0bdb3ae44c511a98dd8bc1d8de4b01dfe75 | |
parent | 79d4e2f3a5204a88490e061015f483df63797472 (diff) | |
download | bcm5719-llvm-fc3bf1f5267a3432ea50114960d16cedec0a3804.tar.gz bcm5719-llvm-fc3bf1f5267a3432ea50114960d16cedec0a3804.zip |
[AArch64] This bit of logic is specific to pairing. NFC.
llvm-svn: 260383
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp index 04fadf97609..285fcc2007f 100644 --- a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp +++ b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp @@ -1147,15 +1147,8 @@ AArch64LoadStoreOpt::findMatchingInsn(MachineBasicBlock::iterator I, unsigned Reg = getLdStRegOp(FirstMI).getReg(); unsigned BaseReg = getLdStBaseOp(FirstMI).getReg(); int Offset = getLdStOffsetOp(FirstMI).getImm(); - bool IsNarrowStore = isNarrowStore(Opc); - - // Early exit if the offset is not possible to match. (6 bits of positive - // range, plus allow an extra one in case we find a later insn that matches - // with Offset-1) int OffsetStride = IsUnscaled ? getMemScale(FirstMI) : 1; - if (!(isNarrowLoad(Opc) || IsNarrowStore) && - !inBoundsForPair(IsUnscaled, Offset, OffsetStride)) - return E; + bool IsNarrowStore = isNarrowStore(Opc); // Track which registers have been modified and used between the first insn // (inclusive) and the second insn. @@ -1608,6 +1601,15 @@ bool AArch64LoadStoreOpt::tryToPairLdStInst(MachineBasicBlock::iterator &MBBI) { if (!isCandidateToMergeOrPair(MI)) return false; + // Early exit if the offset is not possible to match. (6 bits of positive + // range, plus allow an extra one in case we find a later insn that matches + // with Offset-1) + bool IsUnscaled = isUnscaledLdSt(MI); + int Offset = getLdStOffsetOp(MI).getImm(); + int OffsetStride = IsUnscaled ? getMemScale(MI) : 1; + if (!inBoundsForPair(IsUnscaled, Offset, OffsetStride)) + return false; + // Look ahead up to LdStLimit instructions for a pairable instruction. LdStPairFlags Flags; MachineBasicBlock::iterator Paired = findMatchingInsn(MBBI, Flags, LdStLimit); |