search for: noinline

Displaying 20 results from an estimated 694 matches for "noinline".

2017 Jun 22
3
How to prevent optimizing away a call + its arguments
On Thu, Jun 22, 2017 at 05:35:51PM +0000, David Blaikie wrote: > optnone should work, but really noinline should probably (Chandler: Can you > confirm: is it reasonable to model noinline as "no interprocedural analysis > across this function boundary" (so FunctionAttrs should do the same thing > for noinline as it does for optnone, for example? ie: not derive any new > attributes)...
2017 Jun 22
8
How to prevent optimizing away a call + its arguments
On Wed, Jun 21, 2017 at 05:25:04PM -0700, Mehdi AMINI via llvm-dev wrote: > Hi Kuba, > > Try: > > __attribute__(optnone) > > See > https://clang.llvm.org/docs/AttributeReference.html#optnone-clang-optnone Actually, it should be enough to use: __attribute__((noinline)) void please_do_not_optimize_me_away(int arg1, void *arg2) { asm volatile("":::"memory"); } Creating a real barrier is important. Joerg
2013 May 07
2
[PATCH] Btrfs: fix passing wrong arg gfp_t to decide the correct allocation mode
...locks to something different, we should * honor the flags parameter here. */ - tm = *tm_ret = kzalloc(sizeof(*tm), GFP_ATOMIC); + tm = *tm_ret = kzalloc(sizeof(*tm), flags); if (!tm) return -ENOMEM; @@ -591,14 +591,14 @@ __tree_mod_log_insert_key(struct btrfs_fs_info *fs_info, static noinline int tree_mod_log_insert_key_mask(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, int slot, - enum mod_log_op op, gfp_t flags) + enum mod_log_op op) { int ret; if (tree_mod_dont_log(fs_info, eb)) return 0; - ret = __tree_mod_log_insert_key(fs_info, eb, sl...
2007 Sep 30
1
[LLVMdev] noinline
Hi, I was interested in telling the compiler not to inline a given function, and discovered that the __attribute__((noinline)) implements this using a global variable @llvm.noinline. It did not work for me initially. I noticed that @ llvm.noinline was being internalized by -internalize, dead-code-eliminated by -constmerge, causing this information not to reach the -inline pass. I am not sure if this is a bug, or I am ju...
2013 Jan 01
3
[LLVMdev] [RFC] Overhauling Attributes
...e case? I'm sure you explained but I've completely > forgotten... > Hi Duncan, There are a couple of reasons why I don't think it's a good idea to use metadata (or more specifically, the module-level flags). Firstly, everything would have to be specified as a strings: "noinline", "ssp", etc., because a metadata object can hold only a Value type. Secondly, I don't want to have a "loop" in the attributes: !1 = metadata !{ !"noinline", !2 } !2 = metadata !{ !1, !"ssp" } This makes uniquifying the attributes that much har...
2013 Apr 25
0
[PATCH] Btrfs: remove almost all of the BUG()'s from tree-log.c
...-- fs/btrfs/tree-log.c | 151 +++++++++++++++++++++++++++++++++------------------ 1 files changed, 98 insertions(+), 53 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index aebfb2d..705aee6 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -589,7 +589,8 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, /* drop any overlapping extents */ ret = btrfs_drop_extents(trans, root, inode, start, extent_end, 1); - BUG_ON(ret); + if (ret) + goto out; if (found_type == BTRFS_FILE_EXTENT_REG || found_type == BTRFS_FILE_EXTENT_PREALLOC)...
2013 May 14
2
[LLVMdev] Queue implementation is being trapped
...al with the C++ weird function renaming. So, to easily wrapper the class, I wrote a queue_wrapper.h library, which, basically, has the following code (where Q is a reference to my queue, and the channel is not really important): *extern "C" { * *#ifdef INT_TYPE* * void __attribute__((noinline))* * TYPED_NAME(produceValue)(int channel, TYPE elem)* * {Q->addElement (channel, (long)elem);}* * * * TYPE __attribute__((noinline))* * TYPED_NAME(consumeValue)(int channel)* * {return (TYPE) Q->removeElement (channel);}* *#endif* * * * void __attribute__((noinline))* * TYPE...
2012 Jul 31
0
[PATCH V2 1/2] Btrfs: fix error path in create_pending_snapshot()
...fs/btrfs/transaction.c | 37 ++++++++++++++++--------------------- 1 files changed, 16 insertions(+), 21 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index b72b068..4d579fe 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -932,18 +932,16 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, u64 objectid; u64 root_flags; - rsv = trans->block_rsv; - new_root_item = kmalloc(sizeof(*new_root_item), GFP_NOFS); if (!new_root_item) { ret = pending->error = -ENOMEM; - goto fail; + goto root_item_alloc_fail; }...
2013 Dec 20
3
[LLVMdev] [PATCH] Don't optimize out GDB JIT registrar
Thanks Joerg. I've made the change you suggested and verified that it still works. I think the noinline is still required though as this function can be called from a couple of places and gdb will want to set its breakpoint on the single function address. Let me know if you think otherwise though. Cheers, Andrew On Fri, Dec 20, 2013 at 11:52 AM, Joerg Sonnenberger < joerg at britannica.bec.de&g...
2019 Nov 04
3
Fix clang's 'flatten' function attribute: add depth to always_inline?
Hi everyone, clang currently implements the 'flatten' function attribute by marking all calls to not 'noinline' functions with 'always_inline'. In effect, only the first level of calls is inlined, not all calls recursively (like gcc does). We briefly discussed possible solutions on IRC: We could add an equivalent LLVM attribute for functions (e.g. 'flatten'). The main problem with this...
2012 Jan 30
3
[PATCH] Btrfs: allow cloning ranges within the same file
...by: Li Zefan <lizf@cn.fujitsu.com> --- fs/btrfs/ioctl.c | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 0b06a5c..8fcd671 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2223,8 +2223,6 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, * decompress into destination''s address_space (the file offset * may change, so source mapping won''t do), then recompress (or * otherwise reinsert) a subrange. - * - allow ranges within the same file to...
2014 Jan 15
3
[LLVMdev] [PATCH] Don't optimize out GDB JIT registrar
...wrote: > LGTM with a comment explaining the issue. > > On 20 December 2013 03:50, Andrew MacPherson <andrew.macp at gmail.com> > wrote: > > Thanks Joerg. > > > > I've made the change you suggested and verified that it still works. I > think > > the noinline is still required though as this function can be called > from a > > couple of places and gdb will want to set its breakpoint on the single > > function address. Let me know if you think otherwise though. > > > > Cheers, > > Andrew > > > > > > >...
2014 Feb 25
2
[LLVMdev] noinline attribute problem
Hello, I have the following simple C code below. It should return '8' as a result. But the returned result is false as it returns '1'. When I remove the line of '__attribute__((noinline))' , the returned results are correct '8'. Any idea? Please advice as I need to get the assembly code of the 'getTexSize' function alone. Note: I compile using the following commands clang -O2 -emit-llvm test.cpp -c -o test.bc lli -use-mcjit test.bc Thanks in...
2011 Aug 26
0
[PATCH] Btrfs: make some functions return void
...iles changed, 118 insertions(+), 176 deletions(-) diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 7ec1409..5e9998a 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c @@ -177,11 +177,11 @@ out: spin_unlock_irqrestore(&workers->lock, flags); } -static noinline int run_ordered_completions(struct btrfs_workers *workers, - struct btrfs_work *work) +static noinline void run_ordered_completions(struct btrfs_workers *workers, + struct btrfs_work *work) { if (!workers->ordered) - return 0; + return; set_bit(WORK_DONE_BIT, &work-...
2012 Sep 06
2
[PATCH V4 01/12] Btrfs: fix error path in create_pending_snapshot()
...trfs/transaction.c | 40 +++++++++++++++++----------------------- 1 files changed, 17 insertions(+), 23 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 3ee8d58..b259d22f2 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -962,18 +962,16 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, u64 root_flags; uuid_le new_uuid; - rsv = trans->block_rsv; - new_root_item = kmalloc(sizeof(*new_root_item), GFP_NOFS); if (!new_root_item) { ret = pending->error = -ENOMEM; - goto fail; + goto root_item_alloc_fail;...
2013 May 14
0
[LLVMdev] Queue implementation is being trapped
...code below generates completely reasonable output for me, with... struct q { void addElement(int, char); char removeElement(int); void addPtrElement(int, void*); void *removePtrElement(int); } *Q; > *extern "C" { * > > *#ifdef INT_TYPE* > > * void __attribute__((noinline))* > > * TYPED_NAME(produceValue)(int channel, TYPE elem)* > > * {Q->addElement (channel, (long)elem);}* > > * > * > > * TYPE __attribute__((noinline))* > > * TYPED_NAME(consumeValue)(int channel)* > > * {return (TYPE) Q->removeElement (channel);}*...
2007 Jun 04
1
[LLVMdev] support for __attribute__((noinline))
Hi, I would like to know if there is any plan in the next future to support The GCC noinline attribute? Since LLVM does quiet a lot of inlining, these feature is interesting for us to do some function profiling. Thanks, Lionel. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070604/6477298...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...sums); ret = btrfs_map_bio(root, READ, comp_bio, mirror_num, 0); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); bio_put(comp_bio); return 0; diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index c3df14c..781b4ae 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -309,7 +309,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans, if (btrfs_block_can_be_shared(root, buf)) { ret = btrfs_lookup_extent_info(trans, root, buf->start, buf->len, &refs, &flags); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); BUG_ON(refs == 0); } else { re...
2017 May 19
2
noinline changes between 3.8 and 4.0?
...now() noexcept; }; void f(long &elapsed_time) { auto start = ticking_clock::now(); this_thread::sleep_for(tick_duration(71)); auto finish = ticking_clock::now(); auto dur = finish - start; elapsed_time = dur.count(); } The functions defined in the resultant IR are marked `noinline` in 4.0 but do not have that same attribute in 3.8. Running the unoptimized IR through `opt -O2 <chrono.ll -S >chrono.opt.ll` produces the expected 6 line function in 3.8 but does no inlining in 4.0 (respecting the attribute). This appears to be a large change from where `clang++ -O2` was ro...
2015 May 15
2
[LLVMdev] DSA / poolalloc: incorrect callgraph for indirect call
Hello, I am trying to apply DSA (from the poolalloc project - I'm on LLVM 3.2) on the following C program and found that the generated callgraph over-approximates the callees for the simple indirect call. #include <stdio.h> __attribute__((noinline)) static int f1(int arg1, int arg2) { return arg1 + arg2; } __attribute__((noinline)) static int run_func(int (*fptr)(int, int), int arg1, int arg2) { return (*fptr)(arg1, arg2); } __attribute__((noinline)) static int foo() { return run_func(&f1, 1, 2); } int main(int argc, char *ar...