[LLVMdev] Passes dependencies?

Devang Patel devang.patel at gmail.com
Mon Nov 16 13:22:45 PST 2009


On Mon, Nov 16, 2009 at 11:43 AM, Renato Golin <rengolin at systemcall.org> wrote:
> 2009/11/16 Devang Patel <devang.patel at gmail.com>:
>>    A pass can request these requirements explicitly and pass manager
>> will sequence appropriate passes to meet the requirement.
>
> So if two different passes request a third one independently, that
> third is going to run twice?

If the two users do not destroy the info collected by the third pass.

>>    In such cases, these passes should be added in pass queue by the
>> driver (clang, or opt, or llvm-gcc) before your pass. However, your
>> pass should be able to gracefully handle (and skip code) if the
>> incoming IR is not in suitable form.
>
> This way, it's the caller responsibility to assure consistency, right?
> It could be possible that some required passes are not run if the
> caller doesn't do it properly.

Yes. You can write your own 'opt' tool (it is very simple) and
sequence the transformation passes the way you want. And it should
work.
-
Devang




More information about the llvm-dev mailing list