Do an early exit when the result is known cheaply.
authorDuncan Sands <baldrick@free.fr>
Mon, 1 Feb 2010 20:57:35 +0000 (20:57 +0000)
committerDuncan Sands <baldrick@free.fr>
Mon, 1 Feb 2010 20:57:35 +0000 (20:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95002 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/ValueTypes.h

index 0125190e37e5385fb2b38bf44aaff826a3a1a97d..a7aafc0300684251d76a0c513f5cedadc6a87b6c 100644 (file)
@@ -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();
     }