From c5f0fbcb1abcce851a6da14db9583674373bd78b Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Fri, 7 Aug 2015 22:40:51 +0000 Subject: [PATCH] [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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244366 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp b/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp index fc65af3f66a..442abf81e87 100644 --- a/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp +++ b/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()); -- 2.34.1