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

Nick Lewycky nicholas at mxc.ca
Mon Sep 7 21:00:41 PDT 2009


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. :)

Nick




More information about the llvm-commits mailing list