[LLVMdev] Intrinsic parameters verification

Pete Cooper peter_cooper at apple.com
Wed Jul 1 16:51:47 PDT 2015


> On Jul 1, 2015, at 2:02 PM, Renato Golin <renato.golin at linaro.org> wrote:
> 
> On 28 June 2015 at 08:07, Demikhovsky, Elena
> <elena.demikhovsky at intel.com> wrote:
>> I’m looking at Verifier::visitIntrinsicFunctionCall()
>> but I see only common intrinsics here, not target specific.
> 
> Hey, that's a nice project! A target-specific verifier that scans for
> all builtins and makes sure they conform to what the back-end accepts.
+1.

This is also something the IR optimizers have had to take in to consideration.  For example, see SimplifyCFG SinkThenElseCodeToEnd which won’t sink intrinsic calls in if/else blocks to the end block if it would replace a constant parameter with a non-constant.  Having some way to at least verify after that this has happened would be great.  Having a way to annotate the intrinsic so that this code can check when its valid or not would be even better.
> 
> Not sure how they would stay relevant with back-end changes, though...
> Maybe table-gen’ed?
Tagging the intrinsics with(for example) which parameters must be constants is ideal I think, as then we could even verify that the backend patterns don’t try to match a constant intrinsic parameter with a register.  Then we know that the backend is consistent with the intrinsic definitions.

Cheers,
Pete
> 
> Surely interesting to try next GSOC.
> 
> --renato
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list