[PATCH] D18576: Initial implementation of optimization bisect
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 14 12:34:30 PDT 2016
> On Apr 14, 2016, at 12:09 PM, Andy Kaylor <andrew.kaylor at intel.com> wrote:
>
> andrew.w.kaylor added a comment.
>
> The new pass manager design also presents a problem in terms of creating a single, simple check function that goes through the LLVMContext. Right now, I'm testing with the global singleton like this:
>
> if (!getOptBisect().shouldRunPass(name(), &F))
> return PreservedAnalyses::all();
>
> Trying to move that into the context yields something like this:
>
> if (!F.getContext().getOptBisect().shouldRunPass(name(), &F))
> return PreservedAnalyses::all();
I'd rather write:
if (!shouldRunPass(name(), F))
return PreservedAnalyses::all();
"shouldRunPass" can forward to the context F is attached to.
--
Mehdi
>
> That's not terrible, but for loop passes it becomes this:
>
> if (auto *F = L->getHeader()->getParent()) {
> LLVMContext &Context = F->getContext();
> if (!Context.getOptBisect().shouldRunPass(this, L))
> return PreservedAnalyses::all();
> }
>
> I could provide global helper functions that perform this check, but that has the feel of false encapsulation.
>
>
> Repository:
> rL LLVM
>
> http://reviews.llvm.org/D18576
>
>
>
More information about the llvm-commits
mailing list