[PATCH] D54827: [simplifycfg] Handle 3 sequential branches while the first two can infer the third one.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 2 09:27:17 PST 2018


spatel added a comment.

I've been looking at this:
rL347868 <https://reviews.llvm.org/rL347868>
rL347896 <https://reviews.llvm.org/rL347896>
rL348088 <https://reviews.llvm.org/rL348088>
...and I'm still not exactly sure how we should fix it, but I'm confident that what this patch is proposing is not the right answer. We don't want to create a dummy instruction only to analyze and delete it.
My best guess is that we can handle this case using a small enhancement to ValueTracking plus a minimal change to the callers in InstCombine and/or SimplifyCFG. These are hacks vs. a proper solution that uses a dominator tree and a more significant fix to CVP, but it's what we already do in both InstCombine and SimplifyCFG, so there's really no additional cost for optimizing simple cases like this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54827/new/

https://reviews.llvm.org/D54827





More information about the llvm-commits mailing list