[PATCH] D23798: [Instruction] Introduce a predicate mustOperandBeConstant()

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 26 02:13:04 PDT 2016


jmolloy added a comment.

Hi David,

Thanks for your comments. I'm a little wary of creating an all-singing-all-dancing version of this predicate for the same reason I don't like this patch very much - duplicating logic in the Verifier. It seems to me that such a predicate "isValueAppropriateForUser()" would replicate a lot of the Verifier logic. The Verifier would need to keep its own logic in place too as it does more stringent checks, for example recursing into dbgIntrinsics and validating metadata.

A very heavy hammer would possibly be to change the verifier to, instead of asserting on a failure, call a callback so we could call it as a predicate. But the verifier isn't really written for speed or to be used in production code.

My rationale with this patch was that, by keeping the scope of the predicate small, I could avoid duplicating as much of the verifier code as possible. I'd appreciate any advice here.

Cheers,

James


Repository:
  rL LLVM

https://reviews.llvm.org/D23798





More information about the llvm-commits mailing list