• Joined on 2021-03-29
ychenfo commented on pull request M-Labs/nac3#140 2022-01-06 19:20:03 +08:00
List Slice Support (#72)

Simple way to reduce the code size: check for common pattern...

Ah thanks for pointing this out! Indeed I should have noticed this one.

ychenfo pushed to list_slice at M-Labs/nac3 2022-01-06 19:17:39 +08:00
7b9da1835c nac3core: use select for condition in list slice
9971d3216a nac3core: rename nac3 internal functions to be __nac3_irrt (ir runtime library); make IrrtSymbolTable prettier
c5b5661d76 nac3core: manually remove unwanted information in slice assignment llvm ir
23fd30adda nac3core: optimized slice assignment support with fast paths
Compare 4 commits »
ychenfo commented on pull request M-Labs/nac3#140 2022-01-06 17:14:40 +08:00
List Slice Support (#72)

The reason I do this is because python allows slice indecies to be out-of-bound:

Python 3.9.6 (default, Jun 28 2021, 08:57:49)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits"
ychenfo commented on pull request M-Labs/nac3#140 2022-01-06 17:10:55 +08:00
List Slice Support (#72)

I just have a quick look at this. One problem I see is the use of conditions, zext it and do multiplication to implement something like c if cond else 0. Please use the…

ychenfo commented on pull request M-Labs/nac3#140 2022-01-05 23:39:41 +08:00
List Slice Support (#72)

This fast path handles this 2 cases:

  1. a[::] = b[::](both lhs and rhs are list slices)
  2. a[::] = [..](lhs is list slice and rhs is a new list).

Without this fast path, all the list slice…

ychenfo pushed to list_slice at M-Labs/nac3 2022-01-05 20:21:57 +08:00
0bb799a72b nac3core: rename nac3 internal functions to be __nac3_irrt (ir runtime library); make IrrtSymbolTable prettier
a915be0283 nac3core: manually remove unwanted information in slice assignment llvm ir
357b3576ab nac3core: optimized slice assignment support with fast paths
Compare 3 commits »
ychenfo pushed to list_slice at M-Labs/nac3 2022-01-05 19:04:10 +08:00
1cbddebc6d nac3core: rename nac3 internal functions to be __nac3_irrt (ir runtime library); make IrrtSymbolTable prettier
cfc0f38330 nac3core: manually remove unwanted information in slice assignment llvm ir
7871631c0e nac3core: optimized slice assignment support with fast paths
Compare 3 commits »
ychenfo pushed to list_slice at M-Labs/nac3 2022-01-05 17:55:00 +08:00
d4969d2ee2 nac3core: rename nac3 internal functions to be __nac3_irrt (ir runtime library); make IrrtSymbolTable prettier
d827649813 nac3core: manually remove unwanted information in slice assignment llvm ir
Compare 2 commits »
ychenfo commented on pull request M-Labs/nac3#140 2022-01-05 16:24:16 +08:00
List Slice Support (#72)

tbh do we really need 700+ lines for this feature? it doesn't make sense to me... I thought it would be relatively simple to implement those functions in (multiple) memmove.

Sure, the core is…

ychenfo commented on pull request M-Labs/nac3#140 2022-01-05 15:54:52 +08:00
List Slice Support (#72)

Since there are metadata and attributes inside the function body

Even with wasm32 target?

Yes, the attached file is the output from running unwrapped clang:

clang --target=wasm32…
ychenfo commented on pull request M-Labs/nac3#140 2022-01-05 15:50:56 +08:00
List Slice Support (#72)

Ok I will change to const int

ychenfo commented on pull request M-Labs/nac3#140 2022-01-05 15:47:58 +08:00
List Slice Support (#72)

Yes this gets a bit ugly.. I just found that the enum in rust can be numeric, so I can write the indecies like this. But I…

ychenfo commented on pull request M-Labs/nac3#140 2022-01-05 15:43:43 +08:00
List Slice Support (#72)

Ok I will do the renaming.

ychenfo commented on pull request M-Labs/nac3#140 2022-01-05 15:42:55 +08:00
List Slice Support (#72)

Oh sure I can delete this. But I think this should be ok since cargo will just ignore all the printed out lines that are not started with cargo: in build scripts.

ychenfo commented on pull request M-Labs/nac3#140 2022-01-05 07:16:11 +08:00
List Slice Support (#72)

I think including only the parts we want (the function definitions) instead of removing the others might be more robust. That awk command does that. Later LLVM versions could add other unwanted…

ychenfo pushed to list_slice at M-Labs/nac3 2022-01-05 07:12:38 +08:00
cebf5b16a2 nac3core: change the prefix of internal functions to be __nac3_irrt (ir runtime library)
ychenfo pushed to list_slice at M-Labs/nac3 2022-01-05 06:52:21 +08:00
b1635c7ab9 nac3core: build.rs retain only functions in llvm ir runtime lib
0893e8652b nac3core: manually remove target information in slice assignment llvm ir
21f1d40e77 nac3core: optimized slice assignment support with fast paths
52ccf31bb1 update dependencies
4904610dc6 flake: provide mimalloc-enabled Python
Compare 5 commits »
ychenfo commented on pull request M-Labs/nac3#140 2022-01-04 18:02:54 +08:00
List Slice Support (#72)

In fact we really just want the functions...

clang --target=wasm32 ./slice_assign.c -emit-llvm -S -o - 
ychenfo pushed to list_slice at M-Labs/nac3 2022-01-04 17:55:39 +08:00
52581a213b nac3core: manually remove target information in slice assignment llvm ir
ychenfo commented on pull request M-Labs/nac3#140 2022-01-04 14:36:58 +08:00
List Slice Support (#72)

Oh I see, you mean that it doesn't like the included raw bitcode when targeting rv32.

Yes.