search for: dyn_casting

Displaying 20 results from an estimated 954 matches for "dyn_casting".

2018 Feb 06
2
6 separate instances of static getPointerOperand(). Time to consolidate?
LLVM friends, I'm currently trying to make LoopVectorizationLegality class in Transform/Vectorize/LoopVectorize.cpp more modular and eventually move it to Analysis directory tree. It uses several file scope helper functions that do not really belong to LoopVectorize. Let me start from getPointerOperand(). Within LLVM, there are five other similar functions defined. I think it's time to
2018 Feb 06
0
6 separate instances of static getPointerOperand(). Time to consolidate?
"Saito, Hideki via llvm-dev" <llvm-dev at lists.llvm.org> writes: > LLVM friends, > > I'm currently trying to make LoopVectorizationLegality class in > Transform/Vectorize/LoopVectorize.cpp more modular and eventually move > it to Analysis directory tree. It uses several file scope helper > functions that do not really belong to LoopVectorize. Let me start
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
2018 Feb 06
1
6 separate instances of static getPointerOperand(). Time to consolidate?
What LoopVectorize.cpp has are the following. Each function may have to have a separate consolidation discussion. I'm bringing up getpointerOperand() since I actually found multiple instances defined/used. DependenceAnalysis.cpp has isLoadOrStore(). LoopAccessAnalysis.cpp has getAddressSpaceOperand(). I'm sure there are others that might be worth discussing within this thread or a follow
2004 Sep 03
2
[LLVMdev] diffs for vc7.1
On Fri, Sep 03, 2004 at 03:01:01PM -0500, Anshu Dasgupta wrote: > ><snip> > >for (BasicBlock::iterator I = Dest->begin(); PHINode *PN = > >dyn_cast<PHINode>(I); ++I) > > visitPHINode(*PN); > ><snip> > > > >build_vc71\lib\Transforms\Scalar\SCCP.cpp(202) : error C2275: > >'llvm::PHINode' : illegal use of this type as
2004 Jun 17
1
[LLVMdev] Small dyn_cast embellishment
It appears that LLVM has quite a number of dyn_casts (which I find quite natural) The suggested idiom: if (ConstantExpr* ce = dyn_cast<ConstantExpr>(*j)) { } is fine, and IIRC even used in TC++PL, but it occured to me that we can do even better: if (dyn_caster<ConstantExpr> ce = *j) { } where dyn_caster is defined like this: template<class T> class
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?
2013 Nov 26
2
[LLVMdev] LLVM compilation problem
I am using gcc 3.4.6 to build LLVM, and am encountering overloaded/ambiguous errors in several files... % gcc -v Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
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
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
2004 Sep 03
0
[LLVMdev] diffs for vc7.1
I can confirm that both are compiled properly: A) PHINode *PN; for (BasicBlock::iterator I = H->begin(); PN = dyn_cast<PHINode>(I); I++) .... B) for (BasicBlock::iterator I = H->begin; isa<PHINode>(I); I++) { PHINode *PN = cast<PHINode(I); .... } I'll make a patch for whatever solution do you prefer (this problem is a showstopper for more than a dozen
2010 Nov 13
0
[LLVMdev] dyn_cast vs. dynamic_cast
Trevor Harmon <Trevor.W.Harmon at nasa.gov> writes: [snip] > 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.
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 Dec 17
4
[LLVMdev] BasicBlock back()
Hello, I am a beginner of LLVM. I am trying to move among the instructions of a BasicBlock and I cannot. In this particular example, I try to get the previous instruction of the end instruction. I am trying 2 methods: 1. I have the following sequence of code: bool patternDC::runOnBasicBlock(BasicBlock &BB) { ... if (BB.getTerminator()) { Instruction* current =
2007 Dec 17
2
[LLVMdev] Elsa and LLVM and LLVM submissions
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 modified my >> code to >> use the LLVMFoldingBuilder. Very nice! >> >> My question is this: I noticed that the folding builder doesn't fold >> some >> operations, e.g. casts. Is there some reason why? If
2012 Oct 05
2
[LLVMdev] TableGen: Requesting feedback for "TGContext"
> It won't cause a negative effect, go for it! Dynamic_cast is realllly slow compared to dyn_cast, it is worth the memory. Ok, here's the first batch. It converts the RecTy hierarchy over to use LLVM-style RTTI. Along the way, I also wrote up a new doc "How to set up LLVM-style RTTI for your class hierarchy", which covers the previously undocumented (albeit not that
2002 Sep 17
3
[LLVMdev] questions
Sorry I got really overwhelmed by so many classes and member functions in LLVM. So would you please clarify some problems I have? 1. If I see this instruction in the function. %S.i = alloca %struct.SimpleStruct Suppose SimpleStruct is as following: struct.SimpleStruct = type { int, double } When I read the instruction, how can I know the type of simplstruct, should I use 'getType'
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 =
2004 Sep 03
0
[LLVMdev] diffs for vc7.1
Hi Paolo, > <snip> > for (BasicBlock::iterator I = Dest->begin(); PHINode *PN = > dyn_cast<PHINode>(I); ++I) > visitPHINode(*PN); > <snip> > > build_vc71\lib\Transforms\Scalar\SCCP.cpp(202) : error C2275: > 'llvm::PHINode' : illegal use of this type as an expression > > but I think is a NO-NO, so suggestions? Since it's fussy
2012 Apr 12
0
[LLVMdev] detection of constant diagonal matrix * vector
Hi! currently instcombine does not detect constant diagonal matrix times vector, for example a.xx * [2 0] + a.yy * [0 3] can be optimized to a * [2 3] I have implemented this for float. I know that this assumes x * 0 = 0 which is not ieee compliant but i post it here in case it is interesting for someone. on my wish list there is still an option for target independent optimizations to have x