similar to: Break nested instructions?

Displaying 20 results from an estimated 3000 matches similar to: "Break nested instructions?"

2015 Oct 16
2
Break nested instructions?
On 16/10/15 12:59, David Chisnall wrote: > On 16 Oct 2015, at 10:44, Irini Stavrakantonaki via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> Following call instruction contains a GEP instruction as its first operand > No it doesn’t. It contains a GEP constant expression. This is a bit confusing at first, especially when working with IRBuilder, which can sometimes give you
2015 Dec 15
4
Line number without -Debug ?
Hi Eric and thanks for your answer, What I mean is that I want to find the number of line on the IR code of a specific instruction. I found out that I can use: DebugLoc Loc = CurrentInstruction->getDebugLoc(); unsigned Line = Loc.getLine(); But this works only if DEBUGFLAG is True. I'd like to be able to get the Line number without being on a 'Debug' mode. Is
2015 Oct 16
2
Break nested instructions?
On 16/10/15 14:09, mats petersson wrote: > I think it's important to understand that this is not ALWAYS the case. > The operands can be either a constant expression or an instruction. > > For example: > > char *a; > int x; > > if(cond) a = "%d"; > else a = "%x"; > printf(a, x); > > In this case, the compiler
2015 Oct 16
2
Break nested instructions?
On 16/10/15 14:33, mats petersson wrote: > Interesting point, I'm not sure - but the operand on an "instruction" > is a Value, so I expect it can be any type that is within the Value > class hierarchy? I expected the same. That's why I was searching a way to "break" the inlined instructions, as nested instructions are not convenient for me. In case the
2015 Dec 15
2
Line number without -Debug ?
Hi list, Is it possible to retrieve the source/IR line number without being on a debug mode? Thank you in advance, -- irini
2008 Jan 06
4
[LLVMdev] Another memory fun
Hey again) Now I have next code: ; ModuleID = 'sample.lz' @.str1 = internal global [8 x i8] c" world!\00" ; <[8 x i8]*> [#uses=1] @.str2 = internal global [8 x i8] c"hello, \00" ; <[8 x i8]*> [#uses=1] @.str7 = internal global [21 x i8] c"welcome to out hall!\00" ; <[21 x i8]*> [#uses=1] declare i32 @puts(i8*)
2008 Jan 06
0
[LLVMdev] Another memory fun
It's invalid for the same reason that char *foobar = strcat("foo", "bar"); is invalid in C. Please make sure you understand what you're asking LLVM to do before going any further down this path. A good approach is to write out the correct code in C and then use llvm-gcc (or the demo page at http://llvm.org/demo ) to see what it looks like in LLVM assembly. Nick
2008 Jan 06
0
[LLVMdev] Another memory fun
but why this code don't work: ; ModuleID = 'sample.lz' @.str1 = internal global [6 x i8] c"world\00" ; <[6 x i8]*> [#uses=1] @.str2 = internal global [7 x i8] c"hello \00" ; <[7 x i8]*> [#uses=1] @.str7 = internal global [7 x i8] c"father\00" ; <[7 x i8]*> [#uses=1] @.str8 = internal global [8 x i8]
2008 Jan 06
2
[LLVMdev] trouble with getelementptr
Hello, I have next code: ;begin ; ModuleID = 'sample.lz' @.str1 = internal constant [20 x i8] c"\22hello, cruel world\22" ; <[20 x i8]*> [#uses=1] @.str4 = internal constant [9 x i8] c"\22hello, \22" ; <[9 x i8]*> [#uses=1] @.str7 = internal constant [7 x i8] c"\22heya!\22" ; <[7 x i8]*> [#uses=1]
2011 Aug 28
0
[LLVMdev] How to break/iterate over nested instructions.
Dear Manish, First, in answer to your original question: yes, there is a pass that will convert constant expression GEPs used within LLVM instructions into GEP instructions. SAFECode has a pass called BreakConstantGEPs in safecode/trunk/lib/ArrayBoundChecks/BreakConstantGEPs.cpp (http://llvm.org/viewvc/llvm-project/safecode/trunk/lib/ArrayBoundChecks/BreakConstantGEPs.cpp?view=log). It
2011 Aug 27
4
[LLVMdev] How to break/iterate over nested instructions.
Hi Duncan, Why to break? I wish to analyse all the operands of getelemetptr instructions. For which I iterate over the code and get the instruction of interest by getopcode == getelementptr. But the getelementptrs in this form as in my last mail are getting away from my pass. So i wish to break it. I have a work around if breaking is not possible, but I think it may be a common requirement by
2008 Jan 06
4
[LLVMdev] Another memory fun
hm.... I think, that is valid in c but next code too doesn't works right: ; ModuleID = 'sample.lz' @.str1 = internal global [6 x i8] c"world\00" ; <[6 x i8]*> [#uses=1] @.str2 = internal global [7 x i8] c"hello \00" ; <[7 x i8]*> [#uses=1] @.str7 = internal global [7 x i8] c"father\00" ; <[7 x i8]*> [#uses=1]
2011 Jan 23
1
[LLVMdev] Pointers in Load and Store
John, I have looked at the real code (instead of the obsolete one) and it appears to be easy to find if an operand is a getelementptr instruction. if (ConstantExpr * CE = dyn_cast<ConstantExpr>(I.getOperand(0))) { Out<< "*** operand 0 is a constant Expr******"; if (CE->getOpcode() == Instruction::GetElementPtr) { Out<< "*** operand 0 is
2008 Jan 06
4
[LLVMdev] Another memory fun
Yes, I agree with you -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080106/efb1c465/attachment.html>
2011 Aug 19
1
[LLVMdev] Break operands into multiple instructions
Hi All, I am creating an instrumentation pass using LLVM libraries. I am using clang++ (version 2.9) to compile cpp code into LLVM bit code. When I generate the llvm bit code using clang++ using -O3, I get many instances of instructions that look like the following. br i1 icmp ne (i8* bitcast (i32 (i32)* @pthread_cancel to i8*), i8* null), label %bb23, label %bb25 Here three LLVM instructions
2011 Jan 22
2
[LLVMdev] Pointers in Load and Store
John, I have looked at the SAFECode and thought following sould work if (isa<Constant>(I.getOperand(0))) { Out << "*** operand 0 is a constant ******"; if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) { Out << "********operand is an instruction ****"; if (GetElementPtrInst *gepI =
2011 Jan 22
0
[LLVMdev] Pointers in Load and Store
On 1/21/2011 10:46 PM, Surinder wrote: > John, > > I have looked at the SAFECode and thought following sould work > > if (isa<Constant>(I.getOperand(0))) > { Out<< "*** operand 0 is a constant ******"; > if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) > { Out<<
2008 Jan 06
0
[LLVMdev] Another memory fun
On Jan 6, 2008, at 12:29 PM, Zalunin Pavel wrote: > Hey again) > > Now I have next code: > > ; ModuleID = 'sample.lz' > @.str1 = internal global [8 x i8] c" world!\00" ; <[8 x > i8]*> [#uses=1] > @.str2 = internal global [8 x i8] c"hello, \00" ; <[8 x > i8]*> [#uses=1] > @.str7 = internal global [21 x i8]
2012 Sep 24
2
[LLVMdev] [cfe-dev] SPIR provisional specification is now available in the Khronos website
> > For the record, I just workarounded it in pocl by borrowing the > BreakConstantGEPs code from SAFECode. But for SPIR specs, IMHO, this should > be reconsidered. Yes, I agree. On 24 September 2012 15:08, Pekka Jääskeläinen <pekka.jaaskelainen at tut.fi>wrote: > Well, > > To be honest I'm not very comfortable with the whole constant GEP > idea. It's a
2016 Apr 27
3
ArrayBoundChecks in SafeCode-llvm37
Hi, I am wondering if anyone could run ArrayBoundChecks located in SafeCode-llvm37 (https://github.com/jtcriswell/safecode-llvm37) on llvm-3.8? Thanks. Syed -- Rafi