weld icon indicating copy to clipboard operation
weld copied to clipboard

Illegal instruction (core dumped)

Open mihai-varga opened this issue 7 years ago • 2 comments

The following code results in Illegal instruction (core dumped): https://pastebin.com/DM7U6qDV . I've taken this out of a larger Weld program so ignore the logic as the code doesn't make any sense.

|v92:vec[i8], v58:i8, v108:vec[i64], v173:i64, i8nil:i8|
let v95 = result(
	for(v92, appender[i8], |b, i, x|
		if(x == i8nil,
			merge(b, 0c),
			merge(b, 1c)
		)
	));
let v106 = result(
	for (v95, appender[?], |b, i, x|
		if(x == i8nil,
			merge(b, i8nil),
			if(x != 0c,
				merge(b, v58),
				merge(b, lookup(v92, i))
			)
		)
	));
let v114 = result(
	for (v106, appender[?], |b, i, x|
		if(x == i8nil,
			merge(b, -100L),
			if(x != 0c,
				merge(b, lookup(v108, i)),
				merge(b, v173)
			)
		)
	));
let v119 = result(
	for (v114, merger[i64, +], |b, i , x|
		merge(b, x)
	));
{v119}

mihai-varga avatar Apr 03 '18 09:04 mihai-varga

Hey Mihai,

Can you send me the dumps you get when you set the weld.compile.dumpCode configuration option to true? It should dump the LLVM, optimized Weld code, and assembly.

One other thing to try is to turn the weld.compile.traceExecution option to true: this prints the internal IR instruction before executing it, so it'll narrow down where the issue is (I'd pipe the output of the run with that option to a file because it produces a bunch of prints).

Thanks!

On Tue, Apr 3, 2018 at 2:46 AM, Mihai Varga [email protected] wrote:

The following code results in Illegal instruction (core dumped): https://pastebin.com/DM7U6qDV . I've taken this out of a larger Weld program so ignore the logic as the code doesn't make any sense.

|v92:vec[i8], v58:i8, v108:vec[i64], v173:i64, i8nil:i8| let v95 = result( for(v92, appender[i8], |b, i, x| if(x == i8nil, merge(b, 0c), merge(b, 1c) ) )); let v106 = result( for (v95, appender[?], |b, i, x| if(x == i8nil, merge(b, i8nil), if(x != 0c, merge(b, v58), merge(b, lookup(v92, i)) ) ) )); let v114 = result( for (v106, appender[?], |b, i, x| if(x == i8nil, merge(b, -100L), if(x != 0c, merge(b, lookup(v108, i)), merge(b, v173) ) ) )); let v119 = result( for (v114, merger[i64, +], |b, i , x| merge(b, x) )); {v119}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/weld-project/weld/issues/335, or mute the thread https://github.com/notifications/unsubscribe-auth/ABTCY25M4EFTVXfQsLnDHNvm0mSXI6J7ks5tk0T9gaJpZM4TEw-G .

-- Shoumik

sppalkia avatar Apr 03 '18 17:04 sppalkia

Sure, hope those help trace: https://pastebin.com/5njzP1Gf .sir: https://pastebin.com/FHgLP0P7 .ll: https://pastebin.com/sesfhKSc -opt.ll: https://pastebin.com/kjhbPEXz -opt.S: https://pastebin.com/9Efi654c

mihai-varga avatar Apr 03 '18 19:04 mihai-varga