[PATCH] Check for all known bits on ret in InstCombine
Hal Finkel
hfinkel at anl.gov
Tue Jul 22 12:48:46 PDT 2014
----- Original Message -----
> From: "Chandler Carruth" <chandlerc at google.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: reviews+D4567+public+8b075aecf68909a0 at reviews.llvm.org, "Commit Messages and Patches for LLVM"
> <llvm-commits at cs.uiuc.edu>, "Philip Reames" <listmail at philipreames.com>
> Sent: Tuesday, July 22, 2014 2:41:56 PM
> Subject: Re: [PATCH] Check for all known bits on ret in InstCombine
>
>
>
>
>
> On Tue, Jul 22, 2014 at 12:18 PM, Hal Finkel < hfinkel at anl.gov >
> wrote:
>
>
>
> > And I think
> > that we should clearly DCE *completely dead* sub-graphs that are
> > being kept alive solely due to the assumption.
>
> I suppose the real question is: what does completely dead mean? If I
> have:
>
> int a;
> void foo() {
> __builtin_assume(a == 5);
> }
>
> is this completely dead? I would say no so long as foo() could be
> inlined anywhere.
>
>
> Only dead if 'a' has no other users.
Agreed.
>
>
> I'm defining dead as an SSA subgraph where the only sinks (uses which
> have "side-effects" or otherwise can't be removed) are the
> assumptions. I think this is sufficiently conservative to remove
> assumptions from true dead code regions and prevent them from
> keeping control flow alive without sacrificing optimization
> opportunities.
But we should already kill them in unreachable blocks.
-Hal
>
>
> -Chandler
--
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory
More information about the llvm-commits
mailing list