[llvm] r242255 - Change conditional to assert. NFC.

Pete Cooper peter_cooper at apple.com
Tue Jul 14 17:07:58 PDT 2015


Author: pete
Date: Tue Jul 14 19:07:57 2015
New Revision: 242255

URL: http://llvm.org/viewvc/llvm-project?rev=242255&view=rev
Log:
Change conditional to assert.  NFC.

This code was breaking from the case statement if the getStoreSizeInBits()
value was not a multiple of 0.  Given that the implementation returns
getStoreSize() * 8, it can only be a multiple of 8.

Modified:
    llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp

Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=242255&r1=242254&r2=242255&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Tue Jul 14 19:07:57 2015
@@ -1828,9 +1828,8 @@ SDValue XCoreTargetLowering::PerformDAGC
     SDValue Chain = ST->getChain();
 
     unsigned StoreBits = ST->getMemoryVT().getStoreSizeInBits();
-    if (StoreBits % 8) {
-      break;
-    }
+    assert((StoreBits % 8) == 0 &&
+           "Store size in bits must be a multiple of 8");
     unsigned ABIAlignment = DAG.getDataLayout().getABITypeAlignment(
         ST->getMemoryVT().getTypeForEVT(*DCI.DAG.getContext()));
     unsigned Alignment = ST->getAlignment();





More information about the llvm-commits mailing list