similar to: [LLVMdev] How to identify LLVM version?

Displaying 20 results from an estimated 100 matches similar to: "[LLVMdev] How to identify LLVM version?"

2011 May 31
0
[LLVMdev] How to identify LLVM version?
Kangkook Jee <aixer77 at gmail.com> writes: > Hi, all > > I'd like to write a code that can build different codes based on LLVM version. > Like code snippets in the below. > > #ifdef __LLVM_29__ > PHINode *PN = Builder.CreatePHI (Type::getDoubleTy(getGlobalContext()), 2, "iftmp"); > #elif __LLVM_28__ > PHINode *PN = Builder.CreatePHI
2017 May 26
2
Moving instructions from source Basic Block to dest Basic Block
Hi, I have been trying to move some instructions between basic blocks , After looking at the API , I found llvm::Instruction::clone() but there is no result value for this. For example- source Basic block : continuation: ; preds = %else, %then %iftmp = phi i32 [ 5, %then ], [ 9, %else ] store i32 %iftmp, i32* %datasize ; 3 instructions below
2011 Jul 06
1
[LLVMdev] Confusion with a Use of a getelementptr instruction being a Use of a select instruction instead
Hello, I'm doing some Def/Use analysis, and I'm hung up on one tricky spot. The BB in question is attached. Ignore the red. The issue is that '%13 = load...' instruction does not show up as a Use for the '%scevgep25' definition, and I feel like it should. Instead, it shows up as a Use for '%iftmp.55.0 = select...', though Operand(0) for this '%13 =
2017 Jun 16
2
simplify CFG Pass in llvm
I was trying to run the simplify CFG Pass in LLVM , and delete an unreachable basic block ("continuation" below ) after running one of my own IR transforms , but I keep getting the error - While deleting: i8* %g Use still stuck around after Def is destroyed: store i8 0, i8* %g I am well aware of what that means, but isn't the whole purpose of the "simplifyCFGPass" to
2013 Sep 05
2
[LLVMdev] Optimisation pass to move an alloca'd array to a global constant array
Hi All, I was wondering if there is an optimisation pass that moves a stack allocated array, initialised with constant values, to a global constant array. And if there is such a pass, what requirements are there for it to operate? My optimised IR is below. As you can see an array of 5 integers is created with alloca, then each element is stored to in turn. It would be nice if this array was
2008 Oct 08
0
[LLVMdev] [PATCH] Lost instcombine opportunity: "or"s of "icmp"s (commutability)
Here's an initial stab, but I'm not too happy about the temporarily adding new instructions then removing it because returning it will have it added back in to replace other uses. I also added a couple test cases pass with the new InstructionCombining changes (the old code only passes one of the added tests). Also, this change exposes some simplification for
2009 Mar 17
2
[LLVMdev] PHIs with Same Basic Block Listed Twice
Dear All, I have, in an LLVM bitcode program, the following phi node: %iftmp.225.0 = phi i8* [ getelementptr ([10 x i8]* @.str12597431, i32 0, i32 0), %bb114 ], [ getelementptr ([10 x i8]* @.str1258, i32 0, i32 0), %bb111 ], [ getelementptr ([10 x i8]* @.str1258, i32 0, i32 0), %bb111 ] This phi instruction has two arguments for the same incoming basic block. The only reason why it passes
2010 Sep 13
0
[LLVMdev] where are my phi-nodes?
On Sep 13, 2010, at 10:46 AM, John McCall wrote: > On Sep 13, 2010, at 1:15 AM, Duncan Sands wrote: >>> I compiled with "llvm-gcc -emit-llvm test.c -S -o test.ll". >>> Attached to this >>> message are the source and the resulting ll output. >> >> compile with optimization. The llvm-gcc front-end "cheats" and >> stores/loads
2016 Feb 16
4
[help] Kaleidoscope build fails after llvm-3.8
Hello , I have build llvm from release_38 branch ( only llvm and clang ) and install it. My DYLD_LIBRARY_PATH points to installation-directory/lib. I am compiling example files for Kaleidoscope with following command : clang++ -g toy.cpp -std=c++11 `llvm-config --cxxflags --ldflags --system-libs --libs core mcjit native` -O3 -o toy but it fails with following error: Undefined symbols for
2009 Mar 17
0
[LLVMdev] PHIs with Same Basic Block Listed Twice
On Mar 17, 2009, at 11:37 AMPDT, John Criswell wrote: > Dear All, > > I have, in an LLVM bitcode program, the following phi node: > > %iftmp.225.0 = phi i8* [ getelementptr ([10 x i8]* @.str12597431, > i32 0, > i32 0), %bb114 ], [ getelementptr ([10 x i8]* @.str1258, i32 0, i32 > 0), > %bb111 ], [ getelementptr ([10 x i8]* @.str1258, i32 0, i32 0), > %bb111 ]
2007 Aug 02
0
[LLVMdev] Debug info for conditionally defined variables?
Hi, I have this piece of code: tm = local ? localtime(&curr) : gmtime(&curr); if (!tm) return NULL; which translates into something like: ---------------------------------------------- entry: %iftmp.0 = alloca %struct.tm*, align 8 %tm = alloca %struct.tm*, align 8 ... // Declares iftmp.0 as iftmp.0 call void @llvm.dbg.declare( { }* %iftmp.0, { }* bitcast
2010 Jul 09
1
[LLVMdev] Preserving BBs of bitcode to target binary
Hi, all I wonder whether I can preserve basic blocks of llvm-bc when it is compiled to the target(x86) binary. for instance, #llc --march=x86 test1.bc -o test1.s #llvm-gcc -O0 -o test1 test1.s then, can BBs from output binary of 'test1' find their correspondents from 'test1.bc' and vice versa? What I eventually want to find out is 1-1 mapping of BBs between llvm-bc and
2008 May 27
2
[LLVMdev] Min and max
Hi all, I'm trying to implement a floating-point 'min' and 'max' operation using select. For 'min' I get the expected x86 assembly minss instruction, but for 'max' I get a branch instead of maxss. The corresponding C syntax code looks like this: float z = (x > y) ? x : y; Any clues? Could someone maybe explain to me the basics of
2008 Oct 08
3
[LLVMdev] Lost instcombine opportunity: "or"s of "icmp"s (commutability)
instcombine can handle certain orders of "icmp"s that are "or"ed together: x != 5 OR x > 10 OR x == 8 becomes.. x != 5 OR x == 8 becomes.. x != 5 However, a different ordering prevents the simplification: x == 8 OR x > 10 OR x != 5 becomes.. %or.eq8.gt10 OR x != 5 and that can't be simplified because we now have an "or" OR "icmp". What would I
2010 Sep 13
2
[LLVMdev] where are my phi-nodes?
On Sep 13, 2010, at 1:15 AM, Duncan Sands wrote: >> I compiled with "llvm-gcc -emit-llvm test.c -S -o test.ll". Attached to this >> message are the source and the resulting ll output. > > compile with optimization. The llvm-gcc front-end "cheats" and stores/loads all > values to/from memory, avoiding the need to construct phi nodes; instead it lets >
2011 May 31
2
[LLVMdev] How to identify LLVM version?
Hi Óscar, > To the developers: maybe it is a good idea to define something like > LLVM_MAJOR_VERSION and LLVM_MINOR_VERSION ? Preferably in llvm-config.h probably it's best to just go ahead and implement this (with PACKAGE_VERSION being auto-computed from these) and see if anyone objects :) Ciao, Duncan.
2008 Jan 12
1
[LLVMdev] Labels
I'm attempting to modify a parser generator to emit LLVM code instead of C. So far the experience has been trivial, but I am now running into an error regarding labels that I can't seem to solve. Situation 1: A label is used immediately after a void function call (l6 in this case): <snip> %tmp26 = load i32* @yybegin, align 4 %tmp27 = load i32* @yyend, align 4 call void
2010 Sep 13
2
[LLVMdev] where are my phi-nodes?
On Sep 13, 2010, at 10:58 AM, Fariborz Jahanian wrote: > On Sep 13, 2010, at 10:46 AM, John McCall wrote: >> On Sep 13, 2010, at 1:15 AM, Duncan Sands wrote: >>>> I compiled with "llvm-gcc -emit-llvm test.c -S -o test.ll". Attached to this >>>> message are the source and the resulting ll output. >>> >>> compile with optimization. The
2007 Jul 12
1
[LLVMdev] backend problem with LiveInterval::removeRange
Hi all, When compiling some programs using the Mips backend i'm getting this assert message on lib/CodeGen/LiveInterval.cpp:227: "Range is not entirely in interval!" I don't know yet if it's something that is missing on the backend code or why the range to be removed it outside the interval, does anyone have any clue? A more detailed output is attached. The program i tried
2013 Jun 22
0
[LLVMdev] Outputting constant char array from llvm pass
Hi, all I want to know how a llvm pass output constant char array defined from the input source. Here's an example that I want to do. == test input source == char* msg = "hello, world\n"; void msg_out(char * in) { printf("msg: %s \n", in); } main () { ... msg_out(msg); ... } == llvm pass snippet == ... const CallInst* ci =