[llvm] r260383 - [AArch64] This bit of logic is specific to pairing. NFC.
Chad Rosier via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 10 07:52:46 PST 2016
Author: mcrosier
Date: Wed Feb 10 09:52:46 2016
New Revision: 260383
URL: http://llvm.org/viewvc/llvm-project?rev=260383&view=rev
Log:
[AArch64] This bit of logic is specific to pairing. NFC.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp?rev=260383&r1=260382&r2=260383&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp Wed Feb 10 09:52:46 2016
@@ -1147,15 +1147,8 @@ AArch64LoadStoreOpt::findMatchingInsn(Ma
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::tryToPairLdStI
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);
More information about the llvm-commits
mailing list