summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2015-08-07 22:40:51 +0000
committerQuentin Colombet <qcolombet@apple.com>2015-08-07 22:40:51 +0000
commit7d8c74ff3f694369af49ce8fc134018bb720170d (patch)
tree2a18a5a974da7a8a33456f92f2de93eeca4369be /llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
parent237c8ff796b6f95d8dfcd05f0d74bbfafa49a3f7 (diff)
downloadbcm5719-llvm-7d8c74ff3f694369af49ce8fc134018bb720170d.tar.gz
bcm5719-llvm-7d8c74ff3f694369af49ce8fc134018bb720170d.zip
[AArch64][LoadStoreOptimizer] Turn a test into an assert. NFC.
At this point the given Opc must be valid, otherwise we should not look for a matching pair to form paired load or store. Thanks to Chad to point out this piece of code! llvm-svn: 244366
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
index fc65af3f66a..442abf81e87 100644
--- a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
+++ b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
@@ -589,8 +589,8 @@ AArch64LoadStoreOpt::findMatchingInsn(MachineBasicBlock::iterator I,
if (!CanMergeOpc) {
bool IsValidLdStrOpc;
unsigned NonSExtOpc = getMatchingNonSExtOpcode(Opc, &IsValidLdStrOpc);
- if (!IsValidLdStrOpc)
- continue;
+ assert(IsValidLdStrOpc &&
+ "Given Opc should be a Load or Store with an immediate");
// Opc will be the first instruction in the pair.
Flags.setSExtIdx(NonSExtOpc == (unsigned)Opc ? 1 : 0);
CanMergeOpc = NonSExtOpc == getMatchingNonSExtOpcode(MI->getOpcode());
OpenPOWER on IntegriCloud