search for: may_throw

Displaying 9 results from an estimated 9 matches for "may_throw".

Did you mean: maybe_throw
2015 Apr 16
2
[LLVMdev] Exception filter IR model
...the same model for CLR filters). In particular, when an outer filter is invoked before entering an inner finally, which piece of IR reflects the filter's side-effects? To take a concrete example, consider this C code: void foo() { int x; __try { x = 0; __try { x = 2; may_throw(); } __finally { if (x == 1) { printf("correct\n"); } else { printf("incorrect\n"); } } } __except (x = 1) { } } The IR for the path from "x = 2" to the load of x in the __finally (via the exception edge) loo...
2016 Jul 16
2
RFC: Strong GC References in LLVM
...that > you just need to think of LLVM as modeling speculative code barriers as > memory dependence. In LLVM, it makes no sense to have a readonly > may-throw call. The problem is that that model breaks down with aggressive aliasing like: void foo(int* restrict ptr) { *ptr = 40; may_throw(); // read/write call *ptr = 50; } Now it is tempting to CSE the store of 40 to *ptr. If we can't do that then what does restrict/noalias even mean? -- Sanjoy
2020 Jan 13
2
Incorrect code generation when using -fprofile-generate on code which contains exception handling (Windows target)
...problem shown here which will lead to incorrect code on the method test::run(). In this example, the virtual function called from within the exception handler triggers the bug when using -fprofile-generate. #include <stdexcept> #include <iostream> extern void may_throw(int); class base { public: base() : x(0) {}; int get_x() const { return x; } virtual void update() { x++; } int x; }; class derived : public base { public: derived() {} virtual void update() { x--; } };...
2020 Jan 14
2
Incorrect code generation when using -fprofile-generate on code which contains exception handling (Windows target)
...lead to > incorrect code on the method test::run(). In this example, the virtual > function called from within the exception handler triggers the bug when > using -fprofile-generate. > > #include <stdexcept> > #include <iostream> > > extern void may_throw(int); > > class base { > public: > base() : x(0) {}; > int get_x() const { return x; } > virtual void update() { x++; } > int x; > }; > > class derived : public base { > public: > derived() {}...
2018 May 24
0
LLVM SEH docs -- enregistration of locals in nonvolatile registers?
Is this example what you had in mind? void f() { int *p = get_p(); use_p(p); try { may_throw(p); } catch (int) { // don't need p } use_p(p); } The idea is that because p is not modified or used within the catch region (the funclet), it can live in a callee-saved register across the whole function. That is true, it is possible, but I don't think it fits very well in our...
2018 May 22
2
LLVM SEH docs -- enregistration of locals in nonvolatile registers?
https://llvm.org/docs/ExceptionHandling.html#wineh > No variables live in to or out of the funclet can be allocated in registers. I don't think this is quite true. though it might be a useful simplification. Obviously it is true for volatile registers, but I believe the funclet receives a CONTEXT with the nonvolatiles restored. Obviously cumbersome to access, but it lets you enregister
2016 Jul 16
3
RFC: Strong GC References in LLVM
> > > LLVM's design decision is one where everything has to explicitly care > about implicit early exits to get correct answers (and not to harp too > much, but "not everything does", years later). If they don't, they will > get wrong answers. > > So, ironically, while looking at this, i noticed it turns out LLVM's PRE in GVN is another place that
2016 Jul 16
3
RFC: Strong GC References in LLVM
...> > > memory dependence. In LLVM, it makes no sense to have a readonly > > > may-throw call. > > > > The problem is that that model breaks down with aggressive aliasing > > like: > > > > void foo(int* restrict ptr) { > > *ptr = 40; > > may_throw(); // read/write call > > *ptr = 50; > > } > > > > Now it is tempting to CSE the store of 40 to *ptr. If we can't do > > that then what does restrict/noalias even mean? > > I thought it meant ‘ptr’ doesn’t alias with other ‘restrict’ pointer > args. No...
2016 Jul 21
4
RFC: Strong GC References in LLVM
Okay, so it sounds like it might actually be better to be even more low level, call it "ExtendedBBInfo" or something, and rename what it provides to be more clearly structural: A. Inst * FirstIsGuaranteedToTransferExecutionToSuccessor(BB) (naming bikeshed open on this one :P) B. Inst * LastIsGuaranteedToTransferExecutionToSuccessor(BB) C. Inst *FirstMayThrow(BB) D. Inst