[llvm-commits] [llvm] r81179 - /llvm/trunk/lib/VMCore/Verifier.cpp

Chris Lattner clattner at apple.com
Mon Sep 7 21:20:16 PDT 2009


On Sep 7, 2009, at 9:00 PM, Nick Lewycky wrote:

> Chris Lattner wrote:
>> On Sep 7, 2009, at 7:02 PM, Nick Lewycky wrote:
>>>>> +
>>>>> +  switch (Ty->getTypeID()) {
>>>>> +  case Type::FunctionTyID: {
>>>>> +    if (!CheckedTypes.insert(Ty)) return;
>>>> Why don't you do the insert before the switch?
>>>
>>> Because I don't want to insert the integers, double, labels, etc.  
>>> They all go through the default case.
>> Why not?
>
> It's a waste of ram and cycles. We know that those are always valid,  
> we never need to check them. We certainly don't need to store  
> PATypeHolders for them in CheckedTypes.
>
> While I wouldn't really mind doing this for non-derived types, what  
> made my mind up was IntegerType and the fact you could in theory  
> have 100,000 different integer types.
>
> Of course, the way it's written now is a jump-threading testcase. If  
> you want me to stop arguing and change it, just let me know. :)

Please just change it.  I'd rather have the verifier be simple and  
small than trying to optimize out a dozen insertions.

-chris



More information about the llvm-commits mailing list