[PATCH] D23929: GVN-hoist: only hoist relevant scalar instructions

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 13:39:46 PDT 2016


LGTM

On Mon, Sep 19, 2016 at 3:37 PM, Sebastian Pop <sebpop at gmail.com> wrote:

> sebpop updated this revision to Diff 71873.
> sebpop added a comment.
>
> Updated patch to only filter out TerminatorInst.
> As I was mentioning, the other instructions are rare, and we would spend
> more time in isa<>() than allowing these instructions to be discarded after
> computing a VN.
>
>
> https://reviews.llvm.org/D23929
>
> Files:
>   llvm/lib/Transforms/Scalar/GVNHoist.cpp
>
> Index: llvm/lib/Transforms/Scalar/GVNHoist.cpp
> ===================================================================
> --- llvm/lib/Transforms/Scalar/GVNHoist.cpp
> +++ llvm/lib/Transforms/Scalar/GVNHoist.cpp
> @@ -913,7 +913,8 @@
>              break;
>
>            CI.insert(Call, VN);
> -        } else if (HoistingGeps || !isa<GetElementPtrInst>(&I1))
> +        } else if (!isa<TerminatorInst>(&I1) &&
> +                   (HoistingGeps || !isa<GetElementPtrInst>(&I1)))
>            // Do not hoist scalars past calls that may write to memory
> because
>            // that could result in spills later. geps are handled
> separately.
>            // TODO: We can relax this for targets like AArch64 as they
> have more
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160919/0952e24a/attachment.html>


More information about the llvm-commits mailing list