All of lore.kernel.org
 help / color / mirror / Atom feed
* sparse-llvm casts needed on function call arguments and returns
@ 2017-03-14 10:48 Dibyendu Majumdar
  2017-03-19 15:32 ` Luc Van Oostenryck
  0 siblings, 1 reply; 2+ messages in thread
From: Dibyendu Majumdar @ 2017-03-14 10:48 UTC (permalink / raw)
  To: Linux-Sparse

It appears that both function call arguments and returns from
functions need to be cast to the expected type in sparse-llvm. This
may be because the linearizer is eliminating casts - I am not sure.
From LLVM perspective two pointers to different base types are not the
same - similarly various integer types and floating types are not
interchangeable.

By adding casts to store operations (both op_store and op_phisrc) as
well as in function call arguments the number of errors I am getting
when compiling 'minilua' has reduced significantly. However still 192
errors remain (but hopefully many will go with the next fix!).

Of course even with all errors being fixed it doesn't mean that the
generated code is right. Only when I run the program on Lua test suite
it will become apparent whether the generated code is correct or not.

Regards
Dibyendu

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sparse-llvm casts needed on function call arguments and returns
  2017-03-14 10:48 sparse-llvm casts needed on function call arguments and returns Dibyendu Majumdar
@ 2017-03-19 15:32 ` Luc Van Oostenryck
  0 siblings, 0 replies; 2+ messages in thread
From: Luc Van Oostenryck @ 2017-03-19 15:32 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: Linux-Sparse

On Tue, Mar 14, 2017 at 10:48:53AM +0000, Dibyendu Majumdar wrote:
> It appears that both function call arguments and returns from
> functions need to be cast to the expected type in sparse-llvm. This
> may be because the linearizer is eliminating casts - I am not sure.

It's one of the cause, yes.
But again, in sparse the type are in the instructions, not in the values.

> From LLVM perspective two pointers to different base types are not the
> same - similarly various integer types and floating types are not
> interchangeable.
> 
> By adding casts to store operations (both op_store and op_phisrc) as
> well as in function call arguments the number of errors I am getting
> when compiling 'minilua' has reduced significantly. However still 192
> errors remain (but hopefully many will go with the next fix!).
> 
> Of course even with all errors being fixed it doesn't mean that the
> generated code is right. Only when I run the program on Lua test suite
> it will become apparent whether the generated code is correct or not.

Things should be greatly improved in the llvm-fixes-v3 serie
I submitted yesterday.

-- Luc

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-19 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 10:48 sparse-llvm casts needed on function call arguments and returns Dibyendu Majumdar
2017-03-19 15:32 ` Luc Van Oostenryck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.