Displaying 20 results from an estimated 550 matches for "uwtable".
2014 Mar 20
2
[LLVMdev] Unwind, exception handling, debuggers and profilers
...l (modulo the PR).
> No. The -g option should never change the set of optimizations that
> are run.
Bad wording. I meant fix the edge cases Logan reported on the LR
removal, which might have some effect (bigger frames by one word), but
that's discussion for another thread.
>> * uwtable
>> - Generated only when -g or -pg are specified
>
> No. Se above note about -g.
I don't see how not having unwinding information would change the
binary execution.
> What we do today then is that on x86-64 "clang -S" adds uwtable to all
> functions and "c...
2014 Mar 21
2
[LLVMdev] Unwind, exception handling, debuggers and profilers
On 21 March 2014 18:47, Logan Chien <tzuhsiang.chien at gmail.com> wrote:
> * There's the table for ARM target:
>
> - no attribute => emit unwind table
> - with nounwind => emit unwind table with cantunwind
> - with uwtable => emit unwind table
> - with uwtable+nounwind => emit unwind table WITHOUT the cantunwind
>
> The cantunwind record will stop the unwinder, and cantunwind will conflict
> with the stack unwind information according to EHABI. Thus, we should not
> emit cantunwind for the funct...
2014 Feb 10
2
[LLVMdev] [cfe-dev] Unwind behaviour in Clang/LLVM
...ctions or only when needed (e.g.
> exceptions are possible). As such, it makes perfect sense to me as a
> global flag.
It has to be an attribute because of LTO. You can LTO a file compiled
with -fasynchronous-unwind-tables and one with
-fno-asynchronous-unwind-tables. That is why we have the uwtable
attribute.
Cheers,
Rafael
2015 Jan 22
5
[LLVMdev] Why does "uwtable" prevent optimizing Invoke -> Call?
Hi,
in r176827 the optimization that turns invokes with empty landing pads
into plain calls was disabled for invocations of function with the
"uwtable" attribute.
But given this code:
struct S { ~S() {}; };
void blackbox();
__attribute__((__noinline__)) void inner() { blackbox(); }
int foo() {
S s;
inner();
return 0;
}
int bar() {
inner();
return 0;
}
clang directly em...
2014 Feb 17
3
[LLVMdev] [cfe-dev] Unwind behaviour in Clang/LLVM
...that there are two problems with the existing infrastructure:
* The nounwind attribute is ambiguous for (1) not throwing exceptions and
(2) not performing stack unwinding. I feel that it will be better to
separate this in two different attributes
* There is some problem when the function has both uwtable and nounwind.
Although, I think it fine to keep the current definition of nounwind,
however, the uwtable attribute will be much useless to its user. Besides,
even if we wish to keep the current definition, to avoid the undefined
behavior, we have to slightly change the code generator to emit [can...
2014 Feb 10
2
[LLVMdev] [cfe-dev] Unwind behaviour in Clang/LLVM
...ote:
> On 10 February 2014 02:59, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>> It has to be an attribute because of LTO. You can LTO a file compiled
>> with -fasynchronous-unwind-tables and one with
>> -fno-asynchronous-unwind-tables. That is why we have the uwtable
>> attribute.
>
> Hi Rafael,
>
> I've removed the -arm-disable-ehabi flag already, and I'm planning on
> using the uwtable attribute to determine if we need to emit the unwind
> tables or not, just like DwarfCFIException. What is the real semantics
> of uwtable?...
2014 Feb 06
7
[LLVMdev] Unwind behaviour in Clang/LLVM
...he
EHABI) and now we're seeing the results from it.
The problems below are assuming C vs. C++, but it actually apply to any
possibly-exceptional vs. never-exceptional cases.
1. C vs. C++
We have two unwind flags: nounwind, which flags functions that can't unwind
(leaf, nothrow, etc) and uwtable, which forces generation of the table
regardless of nounwind. It seems sensible that C++ code with exceptions
enabled should generate the tables for all functions, in case they're
called by (or call) external functions. In C we don't want any of that.
GCC seems to never emit tables, and G+...
2012 Jul 12
4
[LLVMdev] Documentation about converting GIMPLE IR to LLVM IR in LLVM-GCC/DragonEgg
Dear All,
I am trying to understand the process followed for converting GIMPLE IR to
LLVM IR in LLVM-GCC/DragonEgg - more importantly conversion of OpenMP
extended GIMPLE IR to LLVM IR. It would be great if anybody points me to
some documentation before I my-self delve into the understanding of related
source code.
--
Cheers
-mahesha
-------------- next part --------------
An HTML attachment
2015 May 15
2
[LLVMdev] RFC: ThinLTO Impementation Plan
...int bar(int i) { return foo(i); }
$ clang -S -emit-llvm -O1 available-externally.c -o -
; ModuleID = 'available-externally.c'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10.0"
; Function Attrs: nounwind readnone ssp uwtable
define i32 @bar(i32 %i) #0 {
%1 = tail call i32 @foo(i32 %i)
ret i32 %1
}
; Function Attrs: inlinehint nounwind readnone ssp uwtable
define available_externally i32 @foo(i32 %i) #1 {
ret i32 %i
}
attributes #0 = { nounwind readnone ssp uwtable "less-precise-fpmad"="false"...
2014 Mar 20
3
[LLVMdev] So what's the deal with debug_frame V eh_frame
...with -fno-exceptions -g.
The first two lines produce a global ctor.
Clang is generous enough to flag the LLVM IR function for this global
ctor ("__cxx_global_var_init") as nounwind
(tools/clang/lib/CodeGen/CGDeclCXX.cpp:246), though "func" gets
flagged as nounwind but also as uwtable (why? I don't really
understand these semantics & haven't tracked down where that attribute
gets applied)
Without 'func' in this translation unit, LLVM emits a debug_frame
section (because no functions actually need an unwind table, but we're
compiling with debug info (with...
2012 Jul 13
0
[LLVMdev] Fwd: Documentation about converting GIMPLE IR to LLVM IR in LLVM-GCC/DragonEgg
...120603 (prerelease) LLVM:
>> 3.2svn\22"
>>
>> %struct..omp_data_s.2 = type { i32* }
>> %struct..omp_data_s.1 = type { i32* }
>> %struct..omp_data_s.0 = type { i32 }
>>
>> define internal void @foo._omp_fn.2(i8* nocapture %.omp_data_i) nounwind
>> uwtable {
>> entry:
>> %0 = bitcast i8* %.omp_data_i to i32**
>> %1 = load i32** %0, align 8
>> %2 = load i32* %1, align 4
>> %3 = add i32 %2, 1
>> store i32 %3, i32* %1, align 4
>> ret void
>> }
>>
>> define internal void @foo._...
2014 Feb 06
0
[LLVMdev] Unwind behaviour in Clang/LLVM
...sults from it.
>
> The problems below are assuming C vs. C++, but it actually apply to any possibly-exceptional
> vs. never-exceptional cases.
>
>
> 1. C vs. C++
>
> We have two unwind flags: nounwind, which flags functions that can't unwind (leaf,
> nothrow, etc) and uwtable, which forces generation of the table regardless of
> nounwind. It seems sensible that C++ code with exceptions enabled should generate
> the tables for all functions, in case they're called by (or call) external functions.
> In C we don't want any of that.
>
> GCC seems to n...
2014 Mar 19
4
[LLVMdev] Unwind, exception handling, debuggers and profilers
...left with three EH types:
1. No tables (SjLj)
2. Dwarf tables (DwarfCFI)
3. Specific EH tables (ARM, Win64?)
** Debug & Profiling **
In debug/profile mode (-g, -pg), none of the optimizations that prune
unwind information should be allowed to run. I believe currently this
is informed via the uwtable/nothrow function attributes, but since
their use is controversial, we can reach situations where information
is indeed removed when it shouldn't happen. (see Logan's post).
** Function Attributes Proposal **
I still don't have a clear idea on what do we need, but being overly
conserva...
2014 Feb 15
2
[LLVMdev] [cfe-dev] Unwind behaviour in Clang/LLVM
I'd love to hear more details. Are you saying that this infinite loop
is a limitation of EHABI table format, and not something that can be
fixed in the compiler?
Meanwhile, please notice that gcc behavior matches current clang
behavior that I described above. We would not want to create an
incompatibility.
On Fri, Feb 14, 2014 at 8:42 PM, Logan Chien <tzuhsiang.chien at gmail.com>
2017 Oct 25
3
LLVM v6.0 Internalize and GlobalDCE PASS can not work together?
...ID = 'hello.c'
source_filename = "hello.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: noinline nounwind uwtable
define void @foo() #0 {
entry:
ret void
}
; Function Attrs: noinline nounwind uwtable
define i32 @main(i32 %argc, i8** %argv) #0 {
entry:
%retval = alloca i32, align 4
%argc.addr = alloca i32, align 4
%argv.addr = alloca i8**, align 8
%i = alloca i32, align 4
store i32 0, i32* %r...
2019 Dec 08
2
How to generate a .ll file with functions' parameter names
...emit-llvm sum.c -c
llvm-dis-7 sum.bc
The obtained .ll is:
cat sum.ll
; ModuleID = 'sum.bc'
source_filename = "sum.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
; Function Attrs: noinline nounwind optnone uwtable
define i32 @sum(i32, i32) #0 {
%3 = alloca i32, align 4
%4 = alloca i32, align 4
store i32 %0, i32* %3, align 4
store i32 %1, i32* %4, align 4
%5 = load i32, i32* %3, align 4
%6 = load i32, i32* %4, align 4
%7 = add nsw i32 %5, %6
ret i32 %7
}
; Function Attrs: noinline nounwind op...
2016 Dec 02
2
Is the instruction %4 = select i1 %tobool.i, metadata !12, metadata !10 legal?
...e { %struct.ordered_index_node*, i32 }
%struct.ordered_index_node = type { %struct.B, %struct.F }
%struct.B = type { i32 }
%struct.F = type { i32*, i32* }
$_ZN1G13final_insert_Ev = comdat any
$_ZN1G7insert_Ev = comdat any
$_ZN1F4leftEv = comdat any
$_ZN1F5rightEv = comdat any
; Function Attrs: uwtable
define void @_Z3fn1v() local_unnamed_addr #0 {
entry:
%t = alloca %struct.G, align 8
%0 = bitcast %struct.G* %t to i8*
call void @llvm.lifetime.start(i64 16, i8* %0) #5
call void @_ZN1G13final_insert_Ev(%struct.G* nonnull %t)
call void @llvm.lifetime.end(i64 16, i8* %0) #5
ret void
}
;...
2014 Mar 20
2
[LLVMdev] So what's the deal with debug_frame V eh_frame
...es produce a global ctor.
>>
>> Clang is generous enough to flag the LLVM IR function for this global
>> ctor ("__cxx_global_var_init") as nounwind
>> (tools/clang/lib/CodeGen/CGDeclCXX.cpp:246), though "func" gets
>> flagged as nounwind but also as uwtable (why? I don't really
>> understand these semantics & haven't tracked down where that attribute
>> gets applied)
>
> Is this x86-64? If so, uwtable is a abi requirement. It says that that
> function should have an entry in .eh_table.
Hmm, OK then - because I've...
2017 Oct 26
2
LLVM v6.0 Internalize and GlobalDCE PASS can not work together?
....c"
>> target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
>> target triple = "x86_64-unknown-linux-gnu"
>>
>> @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
>>
>> ; Function Attrs: noinline nounwind uwtable
>> define void @foo() #0 {
>> entry:
>> ret void
>> }
>>
>> ; Function Attrs: noinline nounwind uwtable
>> define i32 @main(i32 %argc, i8** %argv) #0 {
>> entry:
>> %retval = alloca i32, align 4
>> %argc.addr = alloca i32, align 4
&g...
2017 Mar 21
4
Resurrect Bug18710 (Only generate .ARM.exidx and ARM.extab when needed with EHABI)
...n handler (e.g) for debug infos or C unwind with attribute
cleanup, and this happened to be quite intrusive...
But simpler, when the exceptions are not enabled, we should be able to
remove them. Just passing this this bit of information through a new
disable-arm-cantunwind llvm option makes the uwtable and nounwind table
orthogonal with exception support.
This option is set in clang when no exception support allowing to have
the -f[no-]exceptions and -f[no-]unwind-tables match GCC for C and C++.
Thanks a lot for your feedbacks, questions and hints for getting on board !
https://reviews.llvm....