On Sep 28, 2012, at 9:45 AM, James Molloy <[email protected]> wrote:
> You can easily simplify this problem with a restriction in SPIR: disallow
> ConstantExpr casts - no ptrtoint constant expression. Because GlobalVariables
> have pointer type, if you disallow converting their type to non-pointer type
> in a constantexpr, the number of constantexpr subclasses you have to deal
> with is drastically reduced (to essentially just BitCast and GEP).
Wouldn't an easier solution just be not to represent them as constants in the
first place? For instance, you could have a built-in function to get the
address of local N, where N is taken as a parameter. You can call the builtins
at the beginning of the kernel, and then proceed to use them as you wish
without having to worry about reversing a constant folding later. Plus, if a
given vendor's backend wants the address to get constant folded, it's easy to
do replaceAllUsesWith of the call with a global, and run an appropriate
constant folding pass.
--Owen
------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel