[llvm] r242254 - Use getStoreSize() instead of getStoreSizeInBits()/8. NFC.

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


Author: pete
Date: Tue Jul 14 19:07:55 2015
New Revision: 242254

URL: http://llvm.org/viewvc/llvm-project?rev=242254&view=rev
Log:
Use getStoreSize() instead of getStoreSizeInBits()/8.  NFC.

The calls here were both to getStoreSizeInBits() which multiplies by 8.
We then immediately divided by 8.  Calling getStoreSize() returns the
values we need without the extra arithmetic.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=242254&r1=242253&r2=242254&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jul 14 19:07:55 2015
@@ -1872,8 +1872,7 @@ SDValue SelectionDAG::CreateStackTempora
 /// CreateStackTemporary - Create a stack temporary suitable for holding
 /// either of the specified value types.
 SDValue SelectionDAG::CreateStackTemporary(EVT VT1, EVT VT2) {
-  unsigned Bytes = std::max(VT1.getStoreSizeInBits(),
-                            VT2.getStoreSizeInBits())/8;
+  unsigned Bytes = std::max(VT1.getStoreSize(), VT2.getStoreSize());
   Type *Ty1 = VT1.getTypeForEVT(*getContext());
   Type *Ty2 = VT2.getTypeForEVT(*getContext());
   const DataLayout &DL = getDataLayout();





More information about the llvm-commits mailing list