[LLVMdev] Implementing platform specific library call simplification

Frits van Bommel fvbommel at gmail.com
Thu Feb 24 10:57:57 PST 2011


On Thu, Feb 24, 2011 at 7:32 PM, Chris Lattner <clattner at apple.com> wrote:
> On Feb 24, 2011, at 12:41 AM, John Criswell wrote:
>> Sorry to jump into something midstream, but I just happened to read the
>> above paragraph and thought I should comment.  Adding a boolean argument
>> to a pass's constructor method is one of the things I have learned not
>> to do.  If I ever give a "How Not to Write an LLVM Pass" talk, this will
>> be one of the things in the list.
>
> FWIW, the patch didn't do that.  SimplifyLibcalls depends on TargetLibraryInfo, which is an analysis pass.

However, TargetLibraryInfo does take a target triple (not a bool
though) as constructor argument, defaulting to all-unknown.
Maybe instead of being an ImmutablePass it should be a ModulePass so
it can use Module::getTargetTriple() in runOnModule()?
That should make it more compatible with opt & bugpoint.




More information about the llvm-dev mailing list