Comments (10)
Let me know if i can work in this one.
from cairo_native.
helper.init_block()
is the block at which the operation is appended. We want to append the init block (helper.init_block()
) instead of entry
(the default block for each libfunc), or any other block internally created within the libfunc (only present in complex libfuncs).
Basically, every .append_operation(llvm::alloca(...))
and its dependencies (the constant) should append to helper.init_block()
.
from cairo_native.
Hey, whats up! I'm a first time contributor and would love to introduce myself in the codebase. Let me know if I can grab this or any other issue :)
from cairo_native.
@azteca1998 Hello mate. When you say llvm.alloca
you mean llvm::alloca
? Do i have to check in libfuncs for those things?
All llvm::alloca
should be like this right?:
let stack_ptr = helper
.init_block()
.append_operation(llvm::alloca(
context,
value_len,
llvm::r#type::opaque_pointer(context),
location,
AllocaOptions::new()
.align(Some(IntegerAttribute::new(
IntegerType::new(context, 64).into(),
inner_layout.align() as i64,
)))
.elem_type(Some(TypeAttribute::new(inner_ty))),
))
.result(0)?
.into();
And i dont get the part that you say "and their dependencies".
from cairo_native.
Hello,
With llvm.alloca
I'm referring to the alloca
instructions in the llvm
dialect. In MLIR they're written as llvm.alloca
, but we have them available as llvm::alloca
in Rust.
The llvm.alloca
instruction accepts other values as arguments (which are dependencies). In your example, the argument would be value_len
. They also need to be on the init block, otherwise the generated MLIR would be invalid.
All llvm.alloca
operations must be in the init block instead of entry
or whatever other local block every libfunc has. I know there's at least one place where it's not in the init block.
from cairo_native.
Hello,
With
llvm.alloca
I'm referring to thealloca
instructions in thellvm
dialect. In MLIR they're written asllvm.alloca
, but we have them available asllvm::alloca
in Rust.The
llvm.alloca
instruction accepts other values as arguments (which are dependencies). In your example, the argument would bevalue_len
. They also need to be on the init block, otherwise the generated MLIR would be invalid.All
llvm.alloca
operations must be in the init block instead ofentry
or whatever other local block every libfunc has. I know there's at least one place where it's not in the init block.
In the previous example, llvm::alloca
and the dependencie, are in the init block right? Because I'm using the helper where is located the init function.
When you say entry
, is the variable we use to call init_block()
right? And we dont want that, we want the LibFuncHelper, am I right?
from cairo_native.
Ok. And i have to look through all the code of the project, not just the libfuncs directory?
from cairo_native.
Ideally yes, but outside the libfuncs (and a few helper functions I think) you won't have the helper
. If you find something outside libfuncs' implementations just letting us know is fine, we'll fix it later.
from cairo_native.
This is already done
from cairo_native.
This is already done
In my PR or someone else did this? @edg-l
from cairo_native.
Related Issues (20)
- nullable snapshot_take is incorrectly implemented
- Error in tx 0x6c51758aa1ae9506602fffb9194da427fe948314b74eb93cdc9570558d4a88d, Killed process HOT 3
- Returning snapshot of dict causes double free HOT 2
- [BUG][Block 626173]Bug Native execution error: SM_SUB_UF HOT 2
- [BUG][Block 657887] `Native execution error: high !> low\n"` HOT 1
- [BUG][Block 657887] `Native execution error: Native execution error: Native execution error: DIRECTION\n` HOT 2
- [BUG][Block 656398] `OGD: Invalid signature` HOT 2
- Add error handling to JitValueWithInfoWrapper::to_bytes HOT 1
- [2.7.0] Implement bounded int libfuncs
- [2.7.0] Implement circuit libfuncs
- Improve doctests HOT 9
- Add Garaga test HOT 4
- Add contract-specific Executor with improved API
- Add Workflow in CI to compare execution time in Native PR vs Main HOT 1
- Check Pedersen and Sqrt performance HOT 2
- Error tx 0x39d4503055bc390871c58e3d1d87b72eab2ac3ba652e71d04a268b3c81cdfd1
- Replay Error: expected 'LIMIT_DIRECTION', got 'Result::unwrap failed' HOT 2
- Check state diffs in tx `0x1cfb9cb96b0ec53785d71002c3bbb54b173fb2b72890394e222e2b9d42b7c98` HOT 2
- Support depending on arbitrary versions of LLVM HOT 1
- bug: malloc pointer being freed was not allocated HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cairo_native.