linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] assorted LLVM fixes
@ 2017-08-14 19:41 Luc Van Oostenryck
  2017-08-14 19:41 ` [PATCH 1/2] llvm: warn instead of assert on global inits Luc Van Oostenryck
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Luc Van Oostenryck @ 2017-08-14 19:41 UTC (permalink / raw)
  To: linux-sparse; +Cc: Dibyendu Majumdar, Luc Van Oostenryck

This series contains two fixes for sparse-llvm.
It is supposed to be applied on top of all others
LLVM fixes.

Luc Van Oostenryck (3):
  llvm: warn instead of assert on global inits
  llvm: add support for float initializer
  llvm: only compare void pointers

 sparse-llvm.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

-- 
2.14.0


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

* [PATCH 1/2] llvm: warn instead of assert on global inits
  2017-08-14 19:41 [PATCH 0/3] assorted LLVM fixes Luc Van Oostenryck
@ 2017-08-14 19:41 ` Luc Van Oostenryck
  2017-08-14 19:41 ` [PATCH 2/2] llvm: add support for float initializer Luc Van Oostenryck
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Luc Van Oostenryck @ 2017-08-14 19:41 UTC (permalink / raw)
  To: linux-sparse; +Cc: Dibyendu Majumdar, Luc Van Oostenryck

Currently, sparse-llvm can't emit the needed code for
all initializers and when it's the case it stop abruptly
with an assert(0).

This is kinda useless.

Somehow fix this by issuing a warning instead and try to
continue gracefully.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 sparse-llvm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sparse-llvm.c b/sparse-llvm.c
index 3a68d09d9..9a32efe36 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -1212,7 +1212,9 @@ static LLVMValueRef output_data(LLVMModuleRef module, struct symbol *sym)
 			break;
 		}
 		default:
-			assert(0);
+			warning(initializer->pos, "can't initialize type: %s", show_typename(sym));
+			initial_value = NULL;
+			break;
 		}
 	} else {
 		LLVMTypeRef type = symbol_type(sym);
@@ -1220,6 +1222,9 @@ static LLVMValueRef output_data(LLVMModuleRef module, struct symbol *sym)
 		initial_value = LLVMConstNull(type);
 	}
 
+	if (!initial_value)
+		return NULL;
+
 	name = sym->ident ? show_ident(sym->ident) : "" ;
 
 	data = LLVMAddGlobal(module, LLVMTypeOf(initial_value), name);
-- 
2.14.0


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

* [PATCH 2/2] llvm: add support for float initializer
  2017-08-14 19:41 [PATCH 0/3] assorted LLVM fixes Luc Van Oostenryck
  2017-08-14 19:41 ` [PATCH 1/2] llvm: warn instead of assert on global inits Luc Van Oostenryck
@ 2017-08-14 19:41 ` Luc Van Oostenryck
  2017-08-14 19:41 ` [PATCH 3/3] llvm: only compare void pointers Luc Van Oostenryck
  2017-08-14 20:21 ` [PATCH 0/3] assorted LLVM fixes Christopher Li
  3 siblings, 0 replies; 11+ messages in thread
From: Luc Van Oostenryck @ 2017-08-14 19:41 UTC (permalink / raw)
  To: linux-sparse; +Cc: Dibyendu Majumdar, Luc Van Oostenryck

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 sparse-llvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sparse-llvm.c b/sparse-llvm.c
index 9a32efe36..206fac227 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -1197,6 +1197,9 @@ static LLVMValueRef output_data(LLVMModuleRef module, struct symbol *sym)
 		case EXPR_VALUE:
 			initial_value = LLVMConstInt(symbol_type(sym), initializer->value, 1);
 			break;
+		case EXPR_FVALUE:
+			initial_value = LLVMConstReal(symbol_type(sym), initializer->fvalue);
+			break;
 		case EXPR_SYMBOL: {
 			struct symbol *sym = initializer->symbol;
 
-- 
2.14.0


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

* [PATCH 3/3] llvm: only compare void pointers
  2017-08-14 19:41 [PATCH 0/3] assorted LLVM fixes Luc Van Oostenryck
  2017-08-14 19:41 ` [PATCH 1/2] llvm: warn instead of assert on global inits Luc Van Oostenryck
  2017-08-14 19:41 ` [PATCH 2/2] llvm: add support for float initializer Luc Van Oostenryck
@ 2017-08-14 19:41 ` Luc Van Oostenryck
  2017-08-14 20:21 ` [PATCH 0/3] assorted LLVM fixes Christopher Li
  3 siblings, 0 replies; 11+ messages in thread
From: Luc Van Oostenryck @ 2017-08-14 19:41 UTC (permalink / raw)
  To: linux-sparse; +Cc: Dibyendu Majumdar, Luc Van Oostenryck

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 sparse-llvm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sparse-llvm.c b/sparse-llvm.c
index 3a68d09d9..9a0a76096 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -654,6 +654,10 @@ static void output_op_compare(struct function *fn, struct instruction *insn)
 
 	switch  (LLVMGetTypeKind(LLVMTypeOf(lhs))) {
 	case LLVMPointerTypeKind:
+		lhs = value_to_pvalue(fn, &ptr_ctype, lhs);
+		rhs = value_to_pvalue(fn, &ptr_ctype, rhs);
+		/* fall through */
+
 	case LLVMIntegerTypeKind: {
 		LLVMIntPredicate op = translate_op(insn->opcode);
 
-- 
2.14.0


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

* Re: [PATCH 0/3] assorted LLVM fixes
  2017-08-14 19:41 [PATCH 0/3] assorted LLVM fixes Luc Van Oostenryck
                   ` (2 preceding siblings ...)
  2017-08-14 19:41 ` [PATCH 3/3] llvm: only compare void pointers Luc Van Oostenryck
@ 2017-08-14 20:21 ` Christopher Li
  2017-08-14 20:29   ` Luc Van Oostenryck
  2017-08-14 21:23   ` Ramsay Jones
  3 siblings, 2 replies; 11+ messages in thread
From: Christopher Li @ 2017-08-14 20:21 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: Linux-Sparse, Dibyendu Majumdar

On Mon, Aug 14, 2017 at 3:41 PM, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
> This series contains two fixes for sparse-llvm.
> It is supposed to be applied on top of all others
> LLVM fixes.
>

I think we are going to have the finial release of 0.5.1 this
Wednesday if no show stoppers.

Can you resend your other LLVM fixes (this patches are depend
on) after the release? I can even have a temporary branch
to merge those right now.

We can do a quick fix up of 0.5.2 the problem we know so
far.

Make it reasonable stable and cut another release.

Chris

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

* Re: [PATCH 0/3] assorted LLVM fixes
  2017-08-14 20:21 ` [PATCH 0/3] assorted LLVM fixes Christopher Li
@ 2017-08-14 20:29   ` Luc Van Oostenryck
  2017-08-14 20:31     ` Christopher Li
  2017-08-14 21:23   ` Ramsay Jones
  1 sibling, 1 reply; 11+ messages in thread
From: Luc Van Oostenryck @ 2017-08-14 20:29 UTC (permalink / raw)
  To: Christopher Li; +Cc: Linux-Sparse, Dibyendu Majumdar

On Mon, Aug 14, 2017 at 10:21 PM, Christopher Li <sparse@chrisli.org> wrote:
> On Mon, Aug 14, 2017 at 3:41 PM, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
>> This series contains two fixes for sparse-llvm.
>> It is supposed to be applied on top of all others
>> LLVM fixes.
>
> Can you resend your other LLVM fixes (this patches are depend
> on) after the release? I can even have a temporary branch
> to merge those right now.

These patches were for Dibyendu as they are the last fixes
needed for the problmes he showed yesterday.

They make no sense to be applied alone. As written here above
they are "supposed to be applied on top of all others LLVM fixes".

-- Luc

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

* Re: [PATCH 0/3] assorted LLVM fixes
  2017-08-14 20:29   ` Luc Van Oostenryck
@ 2017-08-14 20:31     ` Christopher Li
  2017-08-14 23:56       ` Dibyendu Majumdar
  0 siblings, 1 reply; 11+ messages in thread
From: Christopher Li @ 2017-08-14 20:31 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: Linux-Sparse, Dibyendu Majumdar

On Mon, Aug 14, 2017 at 4:29 PM, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
>
> They make no sense to be applied alone. As written here above
> they are "supposed to be applied on top of all others LLVM fixes".
>
Yes, I know.

That is what I am saying, after the this release. Hopefully this
Wednesday. We can start merging the your base patches for
the LLVM fix. Not this one.

Chris

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

* Re: [PATCH 0/3] assorted LLVM fixes
  2017-08-14 20:21 ` [PATCH 0/3] assorted LLVM fixes Christopher Li
  2017-08-14 20:29   ` Luc Van Oostenryck
@ 2017-08-14 21:23   ` Ramsay Jones
  2017-08-15  0:39     ` Christopher Li
  1 sibling, 1 reply; 11+ messages in thread
From: Ramsay Jones @ 2017-08-14 21:23 UTC (permalink / raw)
  To: Christopher Li, Luc Van Oostenryck; +Cc: Linux-Sparse, Dibyendu Majumdar



On 14/08/17 21:21, Christopher Li wrote:
> On Mon, Aug 14, 2017 at 3:41 PM, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
>> This series contains two fixes for sparse-llvm.
>> It is supposed to be applied on top of all others
>> LLVM fixes.
>>
> 
> I think we are going to have the finial release of 0.5.1 this

Err ... can we have a _final_ release. ;-)

ATB,
Ramsay Jones


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

* Re: [PATCH 0/3] assorted LLVM fixes
  2017-08-14 20:31     ` Christopher Li
@ 2017-08-14 23:56       ` Dibyendu Majumdar
  2017-08-15  0:42         ` Christopher Li
  0 siblings, 1 reply; 11+ messages in thread
From: Dibyendu Majumdar @ 2017-08-14 23:56 UTC (permalink / raw)
  To: Christopher Li; +Cc: Luc Van Oostenryck, Linux-Sparse

Hi Chris,

On 14 August 2017 at 21:31, Christopher Li <sparse@chrisli.org> wrote:
> On Mon, Aug 14, 2017 at 4:29 PM, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
>>
>> They make no sense to be applied alone. As written here above
>> they are "supposed to be applied on top of all others LLVM fixes".
>>
> Yes, I know.
>
> That is what I am saying, after the this release. Hopefully this
> Wednesday. We can start merging the your base patches for
> the LLVM fix. Not this one.
>

I suggest that immediately after the release as a priority please
could you merge Luc's SSA work. I merged this today into my repository
- and it is looking good. I think LLVM changes / and all else should
follow only after the new SSA construction is in place.

Regards
Dibyendu

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

* Re: [PATCH 0/3] assorted LLVM fixes
  2017-08-14 21:23   ` Ramsay Jones
@ 2017-08-15  0:39     ` Christopher Li
  0 siblings, 0 replies; 11+ messages in thread
From: Christopher Li @ 2017-08-15  0:39 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Luc Van Oostenryck, Linux-Sparse, Dibyendu Majumdar

On Mon, Aug 14, 2017 at 5:23 PM, Ramsay Jones
<ramsay@ramsayjones.plus.com> wrote:
>
>
> Err ... can we have a _final_ release. ;-)
>
Yes, yes. The _final_ release.

Thanks for the correction. LOL.

Chris

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

* Re: [PATCH 0/3] assorted LLVM fixes
  2017-08-14 23:56       ` Dibyendu Majumdar
@ 2017-08-15  0:42         ` Christopher Li
  0 siblings, 0 replies; 11+ messages in thread
From: Christopher Li @ 2017-08-15  0:42 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: Luc Van Oostenryck, Linux-Sparse

On Mon, Aug 14, 2017 at 7:56 PM, Dibyendu Majumdar
<mobile@majumdar.org.uk> wrote:
>
> I suggest that immediately after the release as a priority please
> could you merge Luc's SSA work. I merged this today into my repository
> - and it is looking good. I think LLVM changes / and all else should
> follow only after the new SSA construction is in place.
>
Still need to properly reviewed. It will spend some time on this in
these two days. If you already have it in your tree and tested.
That is good. It can buy me some time to review it.

I do want to get the SSA form properly. There is no question about it.

Chris

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

end of thread, other threads:[~2017-08-15  0:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-14 19:41 [PATCH 0/3] assorted LLVM fixes Luc Van Oostenryck
2017-08-14 19:41 ` [PATCH 1/2] llvm: warn instead of assert on global inits Luc Van Oostenryck
2017-08-14 19:41 ` [PATCH 2/2] llvm: add support for float initializer Luc Van Oostenryck
2017-08-14 19:41 ` [PATCH 3/3] llvm: only compare void pointers Luc Van Oostenryck
2017-08-14 20:21 ` [PATCH 0/3] assorted LLVM fixes Christopher Li
2017-08-14 20:29   ` Luc Van Oostenryck
2017-08-14 20:31     ` Christopher Li
2017-08-14 23:56       ` Dibyendu Majumdar
2017-08-15  0:42         ` Christopher Li
2017-08-14 21:23   ` Ramsay Jones
2017-08-15  0:39     ` Christopher Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).