similar to: [LLVMdev] Small dyn_cast embellishment

Displaying 20 results from an estimated 9000 matches similar to: "[LLVMdev] Small dyn_cast embellishment"

2004 Jun 07
2
[LLVMdev] X86: copyConstantToRegister
Hello, looking at X86 codegen, I see this: void ISel::copyConstantToRegister(MachineBasicBlock *MBB, MachineBasicBlock::iterator IP, Constant *C, unsigned R) { if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { ..... case Instruction::Add: emitSimpleBinaryOperation(MBB, IP, CE->getOperand(0),
2009 Apr 03
0
[LLVMdev] Patch: MSIL backend global pointers initialization
Hi, Artur > + if (isa<ConstantExpr>(I->constant)){ > + const ConstantExpr *CE = > dyn_cast<ConstantExpr>(I->constant); > + printConstantExpr(CE); > + ty = CE->getType(); > + } else { > + const Function * F = dyn_cast<Function>(I->constant); > + printValueLoad(F); > + ty =
2007 Dec 17
0
[LLVMdev] Elsa and LLVM and LLVM submissions
I used &Idx[0]. In future, please avoid tabs in your patch. I applied your patch. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071217/056403.html - Devang On Dec 17, 2007, at 2:57 AM, Richard Pennington wrote: > Devang Patel wrote: >> On Dec 15, 2007, at 12:15 PM, Richard Pennington wrote: >>> I got the current version of LLVM via svn yesterday and
2012 Jan 28
1
[LLVMdev] How to get the string value?
Hey Duncan, Thanks! I figured out this piece of code finally: Value *gep = call->getArgOperand(0); if ( ConstantExpr *pCE = dyn_cast<ConstantExpr>(gep) ) { Value *firstop = pCE->getOperand(0); if (GlobalVariable *GV = dyn_cast<GlobalVariable>(firstop)){ Constant *v = GV->getInitializer(); if
2007 Jul 12
2
[LLVMdev] BasicCallGraph patch
The current BasicCallGraph will miss call sites like this: %tmp86 = call i8* (...)* bitcast (i8* ()* @find_ispell to i8* (...)*)( ) ; <i8*> [#uses=1] Here the direct user of @find_ispell is a ConstantExpr. I added several lines of code to address this case. Below is the output of command: svn diff lib/Analysis/IPA/CallGraph.cpp Attached is LLVM asm files with such function calls.
2007 Jul 17
0
[LLVMdev] BasicCallGraph patch
On Thu, 12 Jul 2007, Zhongxing Xu wrote: > The current BasicCallGraph will miss call sites like this: > %tmp86 = call i8* (...)* bitcast (i8* ()* @find_ispell to i8* (...)*)( ) > ; <i8*> [#uses=1] > > Here the direct user of @find_ispell is a ConstantExpr. > I added several lines of code to address this case. > Below is the output of command: svn diff
2004 Jun 17
2
[LLVMdev] ConstantInt::getRawValue
Is there are reason why ConstantInt::getRawValue method can't be moved one step into class hierarchy, into ConstantIntegral::getRawValue The reason I'd like this is that to handle both ConstantInt and ConstantBool, I need the following: if (ConstantInt* CI = dyn_cast<ConstantInt>(V)) { BuildMI(*MBB, IPt, NM::MOVE, 1, Reg).addImm(CI->getRawValue()); } if
2011 Nov 24
1
[LLVMdev] differences in IR and ELF?
I'm trying to create a GlobalVariable that is a ConstantArray. Id like each element to be a pointer to other things in the program(global variables, functions). So that they all have the same type Id like to make the elements void pointers. I think I am going about this wrong, heres how I am doing it: void writeArray(Module &M, GlobalVariable *shadow, Function *val,
2013 Apr 07
1
[LLVMdev] How to get the Instruction where one function use the global variable.
Hi, all I try to get the Instructions where one function use the global variable. for (llvm::Module::global_iterator gvar_iter = M.global_begin(); gvar_iter != M.global_end(); gvar_iter++) { llvm::GlobalVariable *gvar = &*gvar_iter; llvm::errs() << "const global var: " << gvar->getName() << "\n"; for (
2007 Jul 17
2
[LLVMdev] BasicCallGraph patch
I am doing inter-procedural static analysis, so I need to do DFS of call graph. llvm-gcc sometimes generates this kind of call instruction, which cause the call graph to be incomplete. But thanks for your information, instcombine really solves the problem. On 7/17/07, Chris Lattner <sabre at nondot.org> wrote: > > On Thu, 12 Jul 2007, Zhongxing Xu wrote: > > The current
2008 Dec 10
2
[LLVMdev] dyn_cast really doesn't like multiple inheritance
Been having a bit of a problem with dyn_cast: Suppose I have a class A that inherits from two base classes, both of which support dyn_cast. In order to use dyn_cast on A, I need to do a bunch of extra work: 1) Since dyn_cast uses reinterpret_cast rather than static_cast, the pointer value won't get adjusted by the cast operation, making the pointer invalid. I end up having to redefine
2011 Jan 19
0
[LLVMdev] How to get the name and argument of a function
Thanks a lot! I finally fix my problem. My code is like this: //CallInst* pCall pCall is a printf called in my situation if( ConstantExpr * pCE = dyn_cast<ConstantExpr>( pCall->getArgOperand(0))){ if( GlobalVariable * pGV = dyn_cast<GlobalVariable>( pCE->getOperand(0))){ if( ConstantArray * pCA = dyn_cast<ConstantArray>(
2014 Sep 25
2
[LLVMdev] More careful treatment of floating point exceptions
Hi again, It's partially done. My concern is that it won't be accepted as is because of adding the flag parameter in a lot of places. I'd like to show what it looks like (here, not on llvm-commit yet), maybe someone could suggest a better way. There are two sources of the flag: field of TargetOptions and function attribute. I had to add the later one for InstCombine pass. Still
2010 Nov 13
3
[LLVMdev] dyn_cast vs. dynamic_cast
LLVM has a relatively large number of proprietary replacements for standard C++ functions and classes. One of these is dyn_cast to replace dynamic_cast. The two calls appear to be semantically equivalent; the only difference that I can see is that dyn_cast reportedly works on classes that have no v-table [1]. Could someone please explain why I should use dyn_cast instead of dynamic_cast?
2019 Feb 13
2
changing variable naming rules in LLVM codebase
> On Feb 12, 2019, at 4:02 AM, Björn Pettersson A via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > (Sorry if this subject already has been discussed, but I could not find any clear rules/recommendations.) > > What would the recommendation be for acronyms (I’ve seen the rule about avoiding them unless they are “well known”, > but sometimes an acronym is useful, and we
2012 Oct 07
2
[LLVMdev] Undefined behavior in Operator class?
If I understand correctly, Operator is basically a trivial temporary object that holds some common functionality for both Instruction and ConstantExpr. It looks to me like Operator is doing something illegal though. For example, in this member function of class Operator (in include/llvm/Operator.h): /// getOpcode - Return the opcode for this Instruction or ConstantExpr. /// unsigned
2012 Jul 17
2
[LLVMdev] [DragonEgg] Why Fortran's "call flush()" is converted to "call void bitcast (void (...)* @_gfortran_flush_i4 to void (i8*)*)(i8* null) nounwind" ?
OK, at our end the following workaround seems to be sufficient: // Check if function is called (needs -instcombine pass). Function* callee = call->getCalledFunction(); if (!callee) { // Could be also a function called inside a bitcast. // So try to extract function
2011 Oct 19
2
[LLVMdev] dyn_cast<BitCastInst> fails?
I am trying to dyn_cast a Value* to a BitCastInst. The dump of what I want casted is "i8* bitcast (i32 (i32)* @f1 to i8*)", so it is a BitCastInst. For someone my dyn_cast always fails, does anyone see why? arg->dump(); BitCastInst *bitcast = dyn_cast<BitCastInst>(arg); assert(bitcast != NULL); Thank you
2012 Jul 17
0
[LLVMdev] [DragonEgg] Why Fortran's "call flush()" is converted to "call void bitcast (void (...)* @_gfortran_flush_i4 to void (i8*)*)(i8* null) nounwind" ?
Hi Dmitry, it would be neater to use stripPointerCasts. Ciao, Duncan. > OK, at our end the following workaround seems to be sufficient: > > // Check if function is called (needs -instcombine pass). > Function* callee = call->getCalledFunction(); > if (!callee) > { >
2010 Nov 15
2
[LLVMdev] dyn_cast vs. dynamic_cast
On Nov 12, 2010, at 5:57 PM, Óscar Fuentes wrote: >> Could someone >> please explain why I should use dyn_cast instead of dynamic_cast? (I >> thought all classes have v-tables...) Thanks, > > For reducing executable size, LLVM builds with RTTI disabled where > possible. Right, but how does that relate to dyn_cast? I thought v-tables were present even when RTTI is not