diff options
author | Chad Rosier <mcrosier@codeaurora.org> | 2016-02-09 21:20:12 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@codeaurora.org> | 2016-02-09 21:20:12 +0000 |
commit | f7cd8ea71fc433467e3459dd5e30b5d6234c913e (patch) | |
tree | 94bfd2829507cc2f353eb914da7d9d441d5c9d06 | |
parent | e0bd048547c9a68e728eaa1b7e744c29695f0bb9 (diff) |
[AArch64] This check is specific to merging instructions. NFC.
llvm-svn: 260283
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp index 9d5098c6db55..04fadf976095 100644 --- a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp +++ b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp @@ -1149,10 +1149,6 @@ AArch64LoadStoreOpt::findMatchingInsn(MachineBasicBlock::iterator I, int Offset = getLdStOffsetOp(FirstMI).getImm(); bool IsNarrowStore = isNarrowStore(Opc); - // For narrow stores, find only the case where the stored value is WZR. - if (IsNarrowStore && Reg != AArch64::WZR) - return E; - // 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) @@ -1582,6 +1578,10 @@ bool AArch64LoadStoreOpt::tryToMergeLdStInst( if (!isCandidateToMergeOrPair(MI)) return false; + // For narrow stores, find only the case where the stored value is WZR. + if (isNarrowStore(MI) && getLdStRegOp(MI).getReg() != AArch64::WZR) + return false; + // Look ahead up to LdStLimit instructions for a mergable instruction. LdStPairFlags Flags; MachineBasicBlock::iterator MergeMI = findMatchingInsn(MBBI, Flags, LdStLimit); |