[PATCH] Constant Hoisting Pass

Hal Finkel hfinkel at anl.gov
Mon Jan 27 15:05:46 PST 2014


----- Original Message -----
> From: "Juergen Ributzka" <juergen at apple.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "LLVM Commits" <llvm-commits at cs.uiuc.edu>
> Sent: Monday, January 27, 2014 4:38:05 PM
> Subject: Re: [PATCH] Constant Hoisting Pass
> 
> Hi Hal,
> 
> 
> currently the “getIntImmCost" hook is only used in SelectionDAG
> (getMemsetStringVal) for simplifying a load of a string constant to
> a constant during memset optimization.
> There is already a TTI hook to calculate the cost of an memory
> operation, but that mostly counts the number of memory operations
> and can’t be directly compared to the cost of an immediate.
> 

Thanks for explaining.

> 
> I guess a new target hook might still be the easiest solution here.
> What about “bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
> Type *Ty) const”?

Sounds good to me.

Thanks again,
Hal

> 
> 
> -Juergen
> 
> 
> 
> 
> On Jan 23, 2014, at 4:12 PM, Juergen Ributzka < juergen at apple.com >
> wrote:
> 
> 
> 
> Great! I will try to add that feature in a followup patch in this
> case.
> 
> 
> Cheers,
> Juergen
> 
> 
> 
> 
> On Jan 23, 2014, at 4:06 PM, Hal Finkel < hfinkel at anl.gov > wrote:
> 
> 
> 
> ----- Original Message -----
> 
> 
> From: "Juergen Ributzka" < juergen at apple.com >
> To: "Hal Finkel" < hfinkel at anl.gov >
> Cc: "LLVM Commits" < llvm-commits at cs.uiuc.edu >, "Owen Anderson" <
> owen at apple.com >
> Sent: Thursday, January 23, 2014 5:58:47 PM
> Subject: Re: [PATCH] Constant Hoisting Pass
> 
> 
> That would be great.
> 
> 
> Yes, the TCC_LOAD part was and is still a little bit flaky. I think
> the only place where this is actually used is in the SelectionDAG.
> A targets definition of how expensive a load is also not well defined
> in this context, so maybe it would be better if we have a
> separate target hook to model this better?
> 
> 
> Makes sense to me.
> 
> Thanks again,
> Hal
> 
> 
> 
> 
> -Juergen
> 
> 
> On Jan 23, 2014, at 3:44 PM, Hal Finkel < hfinkel at anl.gov > wrote:
> 
> 
> Hi Juergen,
> 
> I think this looks useful, and I'd like to take advantage of this for
> PowerPC when it lands. One small request: I'd like to have some cost
> level in between "basic" and "load". There are constants on PPC that
> take a few add-cost instructions to materialize... hoisting these is
> likely useful, but loads of these constants should still be
> transformed into immediates (because the several integer
> instructions necessary are still cheaper than a load).
> 
> Thanks,
> Hal
> 
> 
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory




More information about the llvm-commits mailing list