[LLVMdev] ConstantExpr refactoring

Hal Finkel hfinkel at anl.gov
Sat Jun 30 08:01:13 PDT 2012


On Sat, 30 Jun 2012 13:10:47 +0100
Renato Golin <rengolin at systemcall.org> wrote:

> On 29 June 2012 23:40, Hal Finkel <hfinkel at anl.gov> wrote:
> > This seems like yet-another place where target-information
> > integration would be helpful (and, indeed, should be used).
> 
> Indeed! And it's part of the plan, to make sure we get it right.
> However, since all folding will eventually be moved to the function
> pass, that's gotta be coded (if not there yet) on the pass. I haven't
> looked all of ti yet, but I guess there is already some support for
> it, like other passes.

I think this depends on when you want this pass to execute. The only
IR-level pass for which this is true is LSR -- even though it is an
IR-level pass, it takes a TLI instance, and lives in llc.
Alternatively, you could make it into a CodeGen-level (SelectionDAG)
pass.

> 
> I think that's the whole point. Instead of coding traps and target
> info on constant folding, we should keep them original until the
> proper pass comes and does it right.

So the general idea here is to rely on SCEV to allow passes to evaluate
constant values but otherwise leave them uncollapsed?

Thanks again,
Hal

> 



-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list