This is an archive of the discontinued LLVM Phabricator instance.

[Verifier] add test case for callbr
AbandonedPublic

Authored by nickdesaulniers on Jul 1 2019, 6:11 PM.

Details

Summary

Check the list of indirect targets; if there's an indirect target
that's not also listed in the operand list, we have a problem.

I'm seeing something funny going on in a particular transform. This
added check is helping me pinpoint it in opt.

Event Timeline

nickdesaulniers created this revision.Jul 1 2019, 6:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2019, 6:11 PM

Is this documented in LangRef somewhere? I'm not seeing anything that indicates the blockaddress has to be an operand of the callbr, and I'm not sure why it would be necessary.

nickdesaulniers abandoned this revision.Jul 2 2019, 2:25 PM

Good point; while I think this kind of invariant exists from asm goto C code that gets generated, I don't think LLVM IR in general requires such an invariant. This was mostly used to help me debug https://reviews.llvm.org/D64101.