similar to: Must string literals be declared as a global variable in LLVM IR?

Displaying 20 results from an estimated 30000 matches similar to: "Must string literals be declared as a global variable in LLVM IR?"

2019 Jun 30
2
Information Loss of Array Type in Function Interface in IR Generated by Clang
Dear all, Hi! Recently, I notice a situation where I cannot infer the size of the outermost dimension of array in the function interface. To concretely depict the problem, I show the C source code and the generated IR code at the end. The array size of A[] is 51 but this information is lost in the generated IR. How can I maintain such information in IR? Should I set some argument for
2019 Jun 30
2
Information Loss of Array Type in Function Interface in IR Generated by Clang
Dear David, Thanks for your prompt reply! Sure, I can implement a AST visitor to go through the AST to get the information but I just wonder whether there is any other way to let Clang do so. What I am considering is how to let the generated IR looks like below, which some tools realize: define dso_local i32 @_Z1fPii([51 x i32]* %A, i32 %x) local_unnamed_addr #0 !dbg !7 { entry: ...
2019 Jan 19
2
What does "preds" mean in a .ll file?
Hi, I see things like this. What does it mean? Is it documented somewhere? Thanks. ; preds = %for.body https://llvm.org/docs/LangRef.html ; <label>:91: ; preds = %88 %92 = load i8**, i8*** @glob_complete_word.matches, align 8, !dbg !99798 %93 = load i32, i32* @glob_complete_word.ind, align 4, !dbg !99799 %94 = sext i32 %93 to i64, !dbg !99798
2019 Jan 20
3
DIGlobalVariableExpression doc in langref
Hi, I don't find DIGlobalVariableExpression in langref. Should it be documented? Could anybody explain what it is? https://llvm.org/docs/LangRef.html In one ll file converted from bitcode, I mostly see something like this. !8273 = !DIGlobalVariableExpression(var: !8274, expr: !DIExpression()) Only one looks like this. !8945 = !DIGlobalVariableExpression(var: !8946, expr:
2020 Sep 10
2
LSR breaks debug info
The Loop Strength Reduction pass appears to break debug information even for the most basic input. I believe this is a well known issue already (see https://bugs.llvm.org/show_bug.cgi?id=38815) but I also believe that it deserve some extra attention. Consider the following input compiled with 'clang -g -O3 foo.c -mllvm -print-after-all' --- void foo(unsigned char *p) { #pragma clang loop
2018 Jun 27
2
can debug info for coroutines be improved?
I'm going to show the same function, first normally, and then as a coroutine, and show how gdb can see the variable when it's a normal function, but not when it's a coroutine. I'd like to understand if this can be improved. I'm trying to debug a real world problem, but the lack of debug info on variables in coroutines is making it difficult. Should I file a bug? Is this a
2018 Nov 23
2
is this a bug in an optimization pass?
The frontend code is a pretty simple for loop, that counts from i = 0; i != 10; i += 1 It gets optimized into and endless loop. export fn entry() void { var array: [10]Bar = undefined; var x = for (array) |elem, i| { if (i == 1) break elem; } else bar2(); } Here's the generated IR: ; ModuleID = 'test' source_filename = "test" target datalayout =
2016 Jan 05
2
Proposal for multi location debug info support in LLVM IR
On Tue, Jan 5, 2016 at 6:59 PM, Adrian Prantl <aprantl at apple.com> wrote: > Thanks for the clarification, Paul! > Keno, just a few more questions for my understanding: > > > - Indicating that a value changed at source level (e.g. because an > > assignment occurred) > > This is done by a key call. Correct > > - Indicating that the same
2018 Apr 26
0
windows ABI problem with i128?
Most probably you need to properly specify the calling convention the backend is using for calling the runtime functions. Or implement the stub for udivti3 that performs the necessary argument lifting. I guess there is no standard ABI document describing the intended calling convention here, so I'd just do what mingw64 does here and make everything here compatible. On Thu, Apr 26, 2018 at
2018 Apr 26
1
windows ABI problem with i128?
On Thu, Apr 26, 2018 at 3:44 AM, Anton Korobeynikov <anton at korobeynikov.info > wrote: > Most probably you need to properly specify the calling convention the > backend is using for calling the runtime functions. Thanks for the tip. Can you be more specific? Are you suggesting there is some config parameter I can set before running TargetMachineEmitToFile? Do you know what
2016 Jan 06
2
Proposal for multi location debug info support in LLVM IR
I will be out of the office on January 7th and will return on January 19th. I will not have access to email during this time. Please contact Karen Lavelle at klavelle at rice.edu or 713-348-2062 if you have any questions or concerns. Best regards, Annepha On Jan 6, 2016, at 3:58 PM, Adrian Prantl via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > On Jan 5, 2016, at 10:37 AM,
2019 Feb 06
2
Not to consolidate two structs with the same data types (but different names) in configure/make tool chain
Hi, I have the following C code. #define PTR_T char * typedef struct objcache { PTR_T data; int cs; /* cache size, number of objects */ int nc; /* number of cache entries */ } sh_obj_cache_t; struct dstack { char *delimiters; int delimiter_depth; int delimiter_space; }; When it is configured/made to generate IR with the following environment variables, CC=clang CXX=clang++
2016 Jan 15
2
Proposal for multi location debug info support in LLVM IR
Adrian had proposed the following staging: 1. Remove offset argument from dbg.value 2. Unify dbg.value and dbg.declare 3. Full implementation I'm not yet sure what to do about the difference in dbg.declare semantics. For example, i think the following currently works ``` top: %x = alloca br else if: dbg.declare(%x... unreachable else: # dbg.declare still applies here ``` I think it would
2015 Jun 01
2
[LLVMdev] Debug info for lazy variables triggers SROA assertion
Hi! I created a bug report (https://llvm.org/bugs/show_bug.cgi?id=23712) for this failure but then I realized that my approach may be wrong. The following D source contains a lazy variable: void bar(lazy bool val) { val(); } The lazy variable val is translated to a delegate. The signature and the first IR lines are: define void @_D7opover23barFLbZv({ i8*, i1 (i8*)* } %val_arg) #0 {
2018 Apr 26
2
windows ABI problem with i128?
I'm trying to use LLVM to create compiler-rt.o on Windows. I use this command from the compiler-rt project: [nix-shell:~/downloads/llvm-project/compiler-rt]$ clang -nostdlib -S -emit-llvm lib/builtins/udivti3.c -g -target x86_64-windows -DCRT_HAS_128BIT The resulting LLVM IR is: ================================================================= ; ModuleID = 'lib/builtins/udivti3.c'
2018 Feb 26
0
problem with moveSpillUsesAfterCoroBegin
Here's what this function is supposed to do: // Move early uses of spilled variable after CoroBegin. // For example, if a parameter had address taken, we may end up with the code // like: // define @f(i32 %n) { // %n.addr = alloca i32 // store %n, %n.addr // ... // call @coro.begin // we need to move the store after coro.begin in the
2020 Aug 25
3
[Debuginfo] Changing llvm.dbg.value and DBG_VALUE to support multiple location operands
Currently there is a series of patches undergoing review[0] that seek to enable the use of multiple IR/MIR values when describing a source variable's location. The current plan for the MIR is to add a new instruction, DBG_VALUE_LIST, that supports this functionality by having a variable number of operands. It may be better however to simply replace the existing DBG_VALUE behaviour entirely
2020 Sep 02
2
[Debuginfo] Changing llvm.dbg.value and DBG_VALUE to support multiple location operands
> I'm not sure this will work as stated here. Indirectness is (mostly) orthogonal to DW_OP_stack_value. DW_OP_stack_value denotes that we reconstructed the value of the variable, but it doesn't exist in the program ("The DW_OP_stack_value operation specifies that the object does not exist in memory but its value is nonetheless known"), for example, a constant value. I think we
2018 Aug 20
2
Windows "0xC00001A5: An invalid exception handler routine has been detected" with LLVM win32 (i386) SEH code
Hi, I'm getting: Unhandled exception at 0x00C211F0 in ConsoleApplication830.exe: 0xC00001A5: An invalid exception handler routine has been detected (parameters: 0x00000001). With some fairly simple SEH enabled routine: define i32 @__elements_entry_point_main(%._gt2a_RemObjects_d_Elements_d_System_d_Array_t_1s*) #0 personality i8* bitcast (i32 ()* @_elements_exception_handler to i8*) !dbg
2019 Jul 08
4
Question on Aliasing and invariant load hoisting
Hi, I have the below test case. --snip-- struct st { int a; int b; }; int * ptr; int x,y; void bar(int *x); void foo() { struct st obj; bar(&obj.b); if(x) obj.a =x; else obj.a =y; for (int i=0; i<obj.a;i++) ptr[i]=i; } --snip-- LLVM IR produced at -O3 is shown below. ref: https://godbolt.org/z/WPlmfr --Snip-- %8 = getelementptr inbounds %struct.st,