similar to: [LLVMdev] Invalid code generated for on-stack class compares

Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] Invalid code generated for on-stack class compares"

2016 May 26
0
c++ programs type name changed in llvm ir after linking
Hi All, Recently I am using clang++ (3.8.0) to compile some c++ programs and find that some type names will be changed after linking different modules. Here is a simple example: I have two files: main.cpp and b.cpp main.cpp #include <iostream> using namespace std; class A { public: virtual void f() { cout << "A:\tf\n"; } }; int main () { A *p = new A;
2011 Nov 02
2
[LLVMdev] annotations preventing optimizations/cleanup?
I created a plugin to add simple Annotations to VarDecls and FieldDecls, and write this modified AST out to a file. I notice that when I use clang to compile this file I get different code then when I use the source directly. In both cases I'm compiling with -O4. Can anyone explain this? Thanks define i32 @somefunc(i32 (i32)* %ptr) nounwind uwtable { entry: %ptr.addr = alloca i32 (i32)*,
2011 Nov 02
0
[LLVMdev] annotations preventing optimizations/cleanup?
> I created a plugin to add simple Annotations to VarDecls and > FieldDecls, and write this modified AST out to a file. I notice that > when I use clang to compile this file I get different code then when I > use the source directly. In both cases I'm compiling with -O4. Can > anyone explain this? This is how clang implements annotations on local variables, that's all.
2012 Dec 12
2
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
On Wed, Dec 12, 2012 at 01:59:55PM -0800, Dan Gohman wrote: > On Wed, Dec 12, 2012 at 1:26 PM, Joerg Sonnenberger > > The original issue is that clang maps restrict on function arguments to > > NoAlias and that makes compares against the address of global variables > > false. Minimal test case: > > > > @y = external global i32 > > > > define zeroext i1
2013 Jan 18
0
[LLVMdev] simple optimization question
Hi Bjorn, > currently the following two lines of code with integer variables get compiled completely differently: > > if (d0<tmp) d0=tmp; there must be something else going on because this void bar(int); void foo(int d0, int tmp) { if (d0 < tmp) d0=tmp; bar(d0); } when compiled like this clang -S -O4 -o - sel.c gives this define void @foo(i32 %d0, i32 %tmp) nounwind
2012 Dec 13
0
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
On Wed, Dec 12, 2012 at 2:45 PM, Joerg Sonnenberger <joerg at britannica.bec.de> wrote: > On Wed, Dec 12, 2012 at 01:59:55PM -0800, Dan Gohman wrote: >> On Wed, Dec 12, 2012 at 1:26 PM, Joerg Sonnenberger >> > The original issue is that clang maps restrict on function arguments to >> > NoAlias and that makes compares against the address of global variables >>
2015 May 15
2
[LLVMdev] RFC: ThinLTO Impementation Plan
> On 2015-May-15, at 13:15, Teresa Johnson <tejohnson at google.com> wrote: > > What isn't clear to me is what all uses the available > externally linkage type currently - do you happen to know? It's used for the `inline` keyword in the C language. If you do a `git grep available_externally -- test/` inside a clang checkout you might find some other uses. $ cat
2011 Dec 09
1
[LLVMdev] Implementing devirtualization
On Thu, Dec 8, 2011 at 4:26 PM, Eli Friedman <eli.friedman at gmail.com> wrote: > On Thu, Dec 8, 2011 at 2:11 PM, Vitor Luis Menezes <vitor at utexas.edu> wrote: >> We've got the following test case: >> >> >> class A { >> public: >>   int x; >>   A(int x) : x(x) {} >>   int hoo() {return 4;} >>   virtual int foo() {return x;}
2019 Sep 26
2
Optimizing functions using logical operators
Hi, I’m looking at what the LLVM compilation chain does to optimize the following functions using logical operators. The one using integer type (t1 and t3) are optimized, but not the ones using float type (t2 and t4), even when using -O3 or -Ofast. Why is that ? Thera are those kind of optimizations done in the LLVM source code? Thanks. bool t1(int v1) { return (2 + v1) == 7; } bool
2012 Jan 03
1
[LLVMdev] Current LLVM/CLANG build failure.
I did an update about 1/2 hr ago, and instead of failing to link with -O4, I'm getting an error elsewhere in the compile. I think I need to stop chasing the bleeding edge. pandora 142% svn update At revision 147455. pandora 143% uname -a Darwin pandora.psychiatry.uiowa.edu 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 pandora 144%
2013 Jun 08
0
[LLVMdev] Canonicalization of select vs shift
I decided to pump some IR through the optimizers and was surprised to find that we don't choose to canonicalize any of the following functions to the other even though they are all roughly the same. define i32 @f1(i32 %x, i32 %m) #0 { entry: %and = and i32 %m, 32896 %tobool = icmp ne i32 %and, 0 %cond = select i1 %tobool, i32 8, i32 0 %shr = lshr i32 %x, %cond ret i32 %shr } ;
2017 Mar 09
5
What is ConstantExpr?
Hi, All. Does anybody know about ConstantExpr in llvm? What's it? Since it always appears after llvm optimization such as -O2 level, what is it supposed to be to codegen? I am wondering it represents constant value which can be determined or computed at compile-time(actually is link-time) to improve performance. Although we do not know the actual constant value util the object file is linked.
2014 Jan 29
2
[LLVMdev] getelementptr on static const struct
Hi, I found a mysterious behavior of LLVM optimizer. I compiled the following code by clang -emit-llvm -S: #include <stddef.h> static const struct t {char t[4]; char s;} p = {{}, 'a'}; char f() { return ((char*)&p)[offsetof(struct t, s)]; } then I obtained the following LLVM IR: %struct.t = type { [4 x i8], i8 } @p = constant %struct.t { [4 x i8] zeroinitializer, i8 97
2012 May 01
2
[LLVMdev] Gold plugin and LLVM tools documentation
Hi, I've been following the instructions on how to use the LLVM Gold plugin at http://llvm.org/docs/GoldPlugin.html while building an multiple versions of WebKit. The documentation hasn't been updated since 2010 and hasn't really matched my experiences, so I'd like to ask if I'm doing these steps incorrectly. What I'm trying to do is force all compilation steps to
2012 May 01
0
[LLVMdev] Gold plugin and LLVM tools documentation
> First, I create libjscore.a with ar, where I've changed the command > line to load the plugin: > ar cqs --plugin > /home/tmjackso/multicompiler/llvm-3.0/release/lib/LLVMgold.so > libjscore.a <list of object files> Note that you shouldn't need to pass --plugin to ar, it searches bfd-plugins. > Then I link jsc against libjscore.a: >
2020 May 31
2
LLC crash while handling DEBUG info
Hi- Here is the simple C++ function: ----------- void foo() { } ----------- Let's say, above function is compiled to generate LLVM IR with -g flag using the command line `clang++ -g -O0 -S -emit-llvm foo.cpp`, we get below IR ----------- ; ModuleID = 'foo.cpp' source_filename = "foo.cpp" target datalayout =
2013 Mar 18
2
[LLVMdev] UNREACHABLE executed! error while trying to generate PTX
I am trying to generate PTX code for 'nbody' sample program's kernel (nbody_kernel.cu) using clang/LLVM version 3.2. The nbody CUDA program is available in Nvidia's SDK. I am referring to https://github.com/jholewinski/llvm-ptx-samples project. Following are my commands, clang++ -O4 -S -I/usr/local/cuda/include -emit-llvm -target nvptx64 nbody_kernel.cu -o nbody_kernel.ll
2015 Aug 31
2
alloca combining, not (yet) possible ?
Hello since my broad RFC request didn't catch any responses, let me get a bit more into the nitty-gritty: I tried to get llvm (3.7) to optimize superflous allocas away, but so far I haven't figured out how. Is there no optimizer for this ? Should I adorn something with some attributes ? As far as I can tell no, but I am no llvm expert... For what I want to do, i will probably have a
2011 Jul 07
1
[LLVMdev] Does also-emit-llvm plugin option in gold plugin still work?
I installed LLVM gold plugin and can ran the example in http://llvm.org/docs/GoldPlugin.html#example1. Then I tried to use it to build a big project. I set the environment variables like: export CC="/usr/local/bin/clang -use-gold-plugin -Wl, -plugin-opt=also-emit-llvm" export CXX="/usr/local/bin/clang++ -use-gold-plugin -Wl, -plugin-opt=also-emit-llvm" export
2014 May 23
2
[LLVMdev] GVN incorrectly handling readnone parameter attribute?
Confirmed, this is a bug. This define i32* @get_pntr(i32* %p) nounwind uwtable { entry: ret i32* %p } define void @store(i32* %p) noinline nounwind uwtable { entry: %call = call i32* @get_pntr(i32* %p) store i32 10, i32* %call, align 4 ret void } run through opt -functionattrs gets a 'readnone' on @store's %p. That's wrong, it clearly stores to it. The bug is due to