diff options
| author | Duncan Sands <baldrick@free.fr> | 2010-02-01 20:57:35 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2010-02-01 20:57:35 +0000 |
| commit | 180334e13fe8b81b950be7e84e42e4ec4d9c2481 (patch) | |
| tree | 34f4014c2e25d50bdf54c5d758656de9b0764bfd /llvm/include | |
| parent | f5edeebd8c18e1231e617ba168180f1995752611 (diff) | |
| download | bcm5719-llvm-180334e13fe8b81b950be7e84e42e4ec4d9c2481.tar.gz bcm5719-llvm-180334e13fe8b81b950be7e84e42e4ec4d9c2481.zip | |
Do an early exit when the result is known cheaply.
llvm-svn: 95002
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/CodeGen/ValueTypes.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/ValueTypes.h b/llvm/include/llvm/CodeGen/ValueTypes.h index 0125190e37e..a7aafc03006 100644 --- a/llvm/include/llvm/CodeGen/ValueTypes.h +++ b/llvm/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(); } |

