On Tue, Aug 06, 2013 at 12:26:51PM +0200, Michel Dänzer wrote: > On Mon, 2013-08-05 at 14:58 -0400, Tom Stellard wrote: > > From: Tom Stellard <thomas.stell...@amd.com> > > > > The TGSI->LLVM pass for radeonsi preloads constants and relies on LLVM's > > sinking pass to reduce SGPR usage by lowering constant reads to an > > optimal place in the code. However, LLVM's machine sink pass will not > > lower instructions that have been selected from llvm.SI.load.const > > intrinsics, because these instructions do not have a MachineMemOperand, > > which LLVM needs in order to determine whether or not it is safe to sink > > a load. Replacing this intrinsic with a real load instruction will > > enable the sinking optimization and probably a few others. > > > > The other advantages of using pointers are: > > + Reduced register usage (pointers take 2 registers, descriptors take 4) > > + More code sharing with compute > > OTOH, one advantage of using descriptors is more graceful behaviour if > the shader tries to access beyond the constant buffer's extents. Would > it be possible to get the benefits of the machine sink pass with a > descriptor based solution as well? >
I think this is possible, I will give it a try. -Tom > > > diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c > > b/src/gallium/drivers/radeonsi/radeonsi_shader.c > > index 4d8a479..d251252 100644 > > --- a/src/gallium/drivers/radeonsi/radeonsi_shader.c > > +++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c > > @@ -115,20 +115,31 @@ static LLVMValueRef build_indexed_load( > > return result; > > } > > > > -static LLVMValueRef build_constant_load( > > +static LLVMValueRef build_load_constant( > > Any particular reason for changing the helper function name in this > patch? The patch could be smaller and cleaner otherwise. > > > -- > Earthling Michel Dänzer | http://www.amd.com > Libre software enthusiast | Debian, X and DRI developer _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev