search for: simplify_typ

Displaying 13 results from an estimated 13 matches for "simplify_typ".

Did you mean: simplify_type
2012 Nov 29
2
[LLVMdev] [cfe-dev] UB in TypeLoc casting
Moving to LLVM dev to discuss the possibility of extending the cast infrastructure to handle this. On Tue, Nov 20, 2012 at 5:51 PM, John McCall <rjmccall at apple.com> wrote: > On Nov 18, 2012, at 5:05 PM, David Blaikie <dblaikie at gmail.com> wrote: >> TypeLoc casting looks bogus. >> >> TypeLoc derived types return true from classof when the dynamic type >>
2012 Nov 30
0
[LLVMdev] [cfe-dev] UB in TypeLoc casting
...upport/Casting.h (revision 168949) +++ include/llvm/Support/Casting.h (working copy) @@ -203,13 +203,27 @@ // // cast<Instruction>(myVal)->getParent() // -template <class X, class Y> +template <class X, class Y, class S = typename std::enable_if<!std::is_same<Y, typename simplify_type<Y>::SimpleType>::value>::type> inline typename cast_retty<X, Y>::ret_type cast(const Y &Val) { assert(isa<X>(Val) && "cast<Ty>() argument of incompatible type!"); return cast_convert_val<X, Y, typename simp...
2006 Mar 14
2
[LLVMdev] Port to Solaris' Sun Studio 8
...>(const llvm::ilist_iterator<llvm::Instruction>&)". "~/bin/../src/include/llvm/Support/Casting.h", line 68: Where: Instantiated from non-template code. This seems to be linked with line 364 in LoadValueNumbering.cpp, and my best guess is that the template struct simplify_type in ilist isn't being picked up for some reason, so classof gets an ilist_iterator as an argument rather than the object the iterator points to. It happens every time I try to dyn_cast<...>(I) where I is an ilist_iterator, but in other cases I got around it by manually retrieving the iter...
2015 Apr 18
2
[LLVMdev] how can I create an SSE instrinsics sqrt?
Thanks, Shahid. It is fixed now. On Fri, Apr 17, 2015 at 8:50 PM, Shahid, Asghar-ahmad < Asghar-ahmad.Shahid at amd.com> wrote: > Hi zhi, > > > > You have to also pass the value type to getDecalaration() API such as > > > > Value* sqrtv = Intrinsic::getDeclaration(M, Intrinsic::x86_sse2_sqrt_pd, > v->getType()); > > > > Regards, > >
2006 Mar 15
0
[LLVMdev] RE: Port to Solaris' Sun Studio 8
...piling the following program: #include "llvm/Analysis/LoadValueNumbering.h" #include "llvm/Support/Casting.h" #include "llvm/Support/BasicBlock.h" using namespace llvm; template<class T> void test(const T& val) { simplify_type<T>::getSimplifiedValue(val).no_such_method(); } void foo() { BasicBlock::iterator I; test(I); } With the following command: CC -I <path-to-llvm-includes-directory> -D__STDC_LIMIT_MACROS=1 file.cpp You should get one compile error on atte...
2010 Jul 21
2
[LLVMdev] Casting.h illness
...n isa<> and in cast<>. My suggestion is to simplify Val to a pointer first and then do the comparison against NULL, the instance check and the cast. I tried this (using getSimplifiedValue), but got further problems and had to add a specialization +template<typename From> struct simplify_type<From*const> { + typedef From* SimpleType; + static SimpleType &getSimplifiedValue(From*const &Val) { + return const_cast<From*&>(Val); + } +}; Is there a simpler way to accomplish this? Cheers, Gabor
2010 Jul 21
0
[LLVMdev] Casting.h illness
...t; > My suggestion is to simplify Val to a pointer first and then do the > comparison against NULL, the instance check and the cast. > > I tried this (using getSimplifiedValue), but got further problems and had to > add a specialization > > +template<typename From> struct simplify_type<From*const> { > +  typedef From* SimpleType; > +  static SimpleType &getSimplifiedValue(From*const &Val) { > +    return const_cast<From*&>(Val); > +  } > +}; > > Is there a simpler way to accomplish this? > > Cheers, > >        Gabor > _...
2013 Aug 22
2
[LLVMdev] Crash in CreateShl() method
...1),AI); Value * Vresult = (Value*)ST; Vresult = builderWait.CreateShl(Vresult, 1); I need to make one bit shift left to the variable stored in the second step I've got crash in this step opt: /home/xx/llvm2/llvm/include/llvm/Support/Casting.h:237: typename enable_if<is_same<Y, typename simplify_type<Y>::SimpleType>, typename cast_retty<X, Y *>::ret_type>::type llvm::cast(Y *) [X = llvm::IntegerType, Y = llvm::Type]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed. How could this crash be fixed? Thanks in advan...
2006 Mar 14
0
[LLVMdev] Port to Solaris' Sun Studio 8
...>(const llvm::ilist_iterator<llvm::Instruction>&)". "~/bin/../src/include/llvm/Support/Casting.h", line 68: Where: Instantiated from non-template code. This seems to be linked with line 364 in LoadValueNumbering.cpp, and my best guess is that the template struct simplify_type in ilist isn't being picked up for some reason, so classof gets an ilist_iterator as an argument rather than the object the iterator points to. It happens every time I try to dyn_cast<...>(I) where I is an ilist_iterator, but in other cases I got around it by manually retrieving the iter...
2011 Apr 21
2
[LLVMdev] Compilation error with LLVM 2.9
...;To,FromTy>::doit(Val); ^ /usr/include/llvm/Support/Casting.h:85:71: note: in instantiation of member function 'llvm::isa_impl_wrap<llvm::PHINode, const llvm::User, const llvm::User>::doit' requested here typename simplify_type<const FromCl>::SimpleType>::doit(Val); ^ /usr/include/llvm/Support/Casting.h:103:12: note: in instantiation of function template specialization 'llvm::isa_impl_cl<llvm::User>::isa<llvm::PHINode&g...
2015 Jan 19
3
[LLVMdev] Assertion: replaceAllUses of value with new value of different type! being thrown all of a sudden
> On 2015-Jan-19, at 12:38, Frédéric Riss <friss at apple.com> wrote: > > >> On Jan 19, 2015, at 12:04 PM, Christian Schafmeister <chris.schaf at verizon.net> wrote: >> >> >> I forgot to mention this in my initial email. >> >> The build of LLVM that I was using was commit a0d5d7aed8e177cea381b3d054d80c212ece9f2c >> The date on the
2010 Jul 21
2
[LLVMdev] Casting.h illness
...o simplify Val to a pointer first and then do the >> comparison against NULL, the instance check and the cast. >> >> I tried this (using getSimplifiedValue), but got further problems and had to >> add a specialization >> >> +template<typename From> struct simplify_type<From*const> { >> + typedef From* SimpleType; >> + static SimpleType &getSimplifiedValue(From*const &Val) { >> + return const_cast<From*&>(Val); >> + } >> +}; >> >> Is there a simpler way to accomplish this? >> >>...
2013 Dec 16
3
[LLVMdev] Add call printf instructions problems
...rint.so to transform the test .bc file like this: opt -load /home/king/llvm/Release+Asserts/lib/call_print.so -call_print <test_sum.bc> test_sum.call.bc -debug It failed with such information: /home/king/llvm/include/llvm/Support/Casting.h:237: typename enable_if<is_same<Y, typename simplify_type<Y>::SimpleType>, typename cast_retty<X, Y *>::ret_type>::type llvm::cast(Y *) [X = llvm::PointerType, Y = llvm::Type]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed. Can anyone tell me what the problem is ? And wh...