From: Duncan Sands Date: Mon, 1 Feb 2010 20:57:35 +0000 (+0000) Subject: Do an early exit when the result is known cheaply. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=aec0081fac5406aeff3dfb91090d6472d14f8ca6;p=oota-llvm.git Do an early exit when the result is known cheaply. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95002 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h index 0125190e37e..a7aafc03006 100644 --- a/include/llvm/CodeGen/ValueTypes.h +++ b/include/llvm/CodeGen/ValueTypes.h @@ -492,26 +492,31 @@ namespace llvm { /// bitsEq - Return true if this has the same number of bits as VT. bool bitsEq(EVT VT) const { + if (EVT::operator==(VT)) return true; return getSizeInBits() == VT.getSizeInBits(); } /// bitsGT - Return true if this has more bits than VT. bool bitsGT(EVT VT) const { + if (EVT::operator==(VT)) return false; return getSizeInBits() > VT.getSizeInBits(); } /// bitsGE - Return true if this has no less bits than VT. bool bitsGE(EVT VT) const { + if (EVT::operator==(VT)) return true; return getSizeInBits() >= VT.getSizeInBits(); } /// bitsLT - Return true if this has less bits than VT. bool bitsLT(EVT VT) const { + if (EVT::operator==(VT)) return false; return getSizeInBits() < VT.getSizeInBits(); } /// bitsLE - Return true if this has no more bits than VT. bool bitsLE(EVT VT) const { + if (EVT::operator==(VT)) return true; return getSizeInBits() <= VT.getSizeInBits(); }