[LLVMdev] Do all user-written passes have to be run through a PassManager object (called from outside the LLVM infrastructure)?
jgai at illinois.edu
Thu Jan 16 16:21:17 PST 2014
Thanks John. Out of curiosity, I wonder if it's possible to summarize the LLVMpass-specific design patterns. I.e., the software engineering techniques that were used to design/implement the LLVM Pass Infrastructure. Equivalently, this may also answer the question "Why is the code this way". This visibility can improve understanding and that is likely to improve quality as more developers are better informed.
From: Criswell, John T
Sent: Thursday, January 16, 2014 1:29 PM
To: Gai, Jiading; llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Do all user-written passes have to be run through a PassManager object (called from outside the LLVM infrastructure)?
On 1/16/14 11:44 AM, Gai, Jiading wrote:
> I have written several passes that have no pre-requisites for any
> previous LLVM native passes prior to my own. For those passes, I have verified that at
> least the following two approaches are equivalent in terms of executing
> those self-written passes and getting the correct results:
I don't know if you *must* run all passes via a PassManager, but I think
you should. That's how passes are designed to work, and running them
through a PassManager provides some future-proofing benefits (e.g., if
you add a prerequisite analysis pass to one of your passes, it will
-- John T.
More information about the llvm-dev