[LLVMdev] Changes between 2.6 and 2.7: SSA Verifier and visitFreeInst

Nick Lewycky nicholas at mxc.ca
Sat Mar 6 11:35:26 PST 2010


Jianzhou Zhao wrote:
> Hi llvm,
>
> 1) The lib/VMCore/Verifier.cpp in 2.7 implements Verifier::VerifyType,
> which is empty in 2.6. I noticed that it does not check all types,
> for example, UnionTyID, OpaqueTyID, LabelTyID, MetadataTyID
> and etc are ignored in the 'default' branch. Does it mean we dont
> need to check them?

We do need to check union. I'll add that. The others don't need a case 
because they don't contain subtypes; it's impossible to have an illegal 
label type. It's either a label type or it isn't. :)

> Another question is: How much does Verifier.cpp check statically?
> Can I take it as a type checker for SSA? Is there any static
> semantics that has not been checked yet?

There are things that it does not check yet. It doesn't verify constant 
expressions, so 'bitcast i32* @x to i32' will still escape detection, if 
you can manage to create one (ie., you're running with assertions off).

Further, there are semantics of the program that the verifier will never 
verify. It is undefined behaviour to shift beyond the width of an 
integer. It is undefined behaviour to call a function with mismatching 
calling conventions. http://llvm.org/docs/FAQ.html#callconvwrong

> 2) visitFreeInst has been removed from lib/ExecutionEngine/Interpreter in 2.7
> Will this have any back-compatible problem when interpreting any
> *.bc from 2.6?

The 'free' instruction has been removed from LLVM 2.7. Any .bc files 
using it will have a 'call @free' inserted in its place.

Nick



More information about the llvm-dev mailing list