[llvm-commits] [llvm] r95002 - /llvm/trunk/include/llvm/CodeGen/ValueTypes.h
Duncan Sands
baldrick at free.fr
Mon Feb 1 12:57:35 PST 2010
Author: baldrick
Date: Mon Feb 1 14:57:35 2010
New Revision: 95002
URL: http://llvm.org/viewvc/llvm-project?rev=95002&view=rev
Log:
Do an early exit when the result is known cheaply.
Modified:
llvm/trunk/include/llvm/CodeGen/ValueTypes.h
Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=95002&r1=95001&r2=95002&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Mon Feb 1 14:57:35 2010
@@ -492,26 +492,31 @@
/// 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();
}
More information about the llvm-commits
mailing list