[llvm] r196604 - micro optimization: isSizedDerivedType is only called with arrays, vectors and structs.
Rafael Espindola
rafael.espindola at gmail.com
Fri Dec 6 12:12:19 PST 2013
Author: rafael
Date: Fri Dec 6 14:12:19 2013
New Revision: 196604
URL: http://llvm.org/viewvc/llvm-project?rev=196604&view=rev
Log:
micro optimization: isSizedDerivedType is only called with arrays, vectors and structs.
Modified:
llvm/trunk/lib/IR/Type.cpp
Modified: llvm/trunk/lib/IR/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Type.cpp?rev=196604&r1=196603&r2=196604&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Type.cpp (original)
+++ llvm/trunk/lib/IR/Type.cpp Fri Dec 6 14:12:19 2013
@@ -156,18 +156,12 @@ int Type::getFPMantissaWidth() const {
/// iff all of the members of the type are sized as well. Since asking for
/// their size is relatively uncommon, move this operation out of line.
bool Type::isSizedDerivedType() const {
- if (this->isIntegerTy())
- return true;
-
if (const ArrayType *ATy = dyn_cast<ArrayType>(this))
return ATy->getElementType()->isSized();
if (const VectorType *VTy = dyn_cast<VectorType>(this))
return VTy->getElementType()->isSized();
- if (!this->isStructTy())
- return false;
-
return cast<StructType>(this)->isSized();
}
More information about the llvm-commits
mailing list