search for: isnullvalu

Displaying 20 results from an estimated 51 matches for "isnullvalu".

Did you mean: isnullvalue
2009 Nov 05
0
[LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything
...asAnalysis::AliasResult > BasicAliasAnalysis::aliasCheck(const Value *V1, unsigned V1Size, > const Value *V2, unsigned V2Size) { > + // Null pointers do not alias with anything > + if (const Constant *C = dyn_cast<Constant>(V1)) > + if (C->isNullValue()) > + return NoAlias; > + > + if (const Constant *C = dyn_cast<Constant>(V2)) > + if (C->isNullValue()) > + return NoAlias; > + As Chris mentioned, for consistency with what the rest of LLVM is doing, this should check whether the pointers are in the defa...
2014 Mar 13
2
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...ss R, L greater R). > [/new comment] > > > > > > +enum ConstantType { > > I'm not sure that this buys you much. All the "isa" tests can be > broken > > down into a switch on getValueID() with the one exception of > isNullValue(). > Done. > > > > + assert( > > + C1->getType()->__canLosslesslyBitCastTo(C2->__getType()) && > > + "Pass is healthless. checkForLosslessBitcast should be > twin of " > > + "canLossle...
2009 Nov 04
5
[LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything
This is the first patch I've sent to this project. Please be gentle :) LLVM fails to remove the dead load in the following code when running $./llvm-as -o - test.ll | ./opt -O3 -o - | ./llvm-dis -o - %t = type { i32 } declare void @foo(i8*) define void @f(%t* noalias nocapture %stuff ) { %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 %before = load i32* %p call void
2009 Jan 21
2
[LLVMdev] RFA: Constant String c"\000"
..."\000" string. Here is the code: Constant *ConstantArray::get(const ArrayType *Ty, const std::vector<Constant*> &V) { // If this is an all-zero array, return a ConstantAggregateZero object if (!V.empty()) { Constant *C = V[0]; if (!C->isNullValue()) return ArrayConstants->getOrCreate(Ty, V); for (unsigned i = 1, e = V.size(); i != e; ++i) if (V[i] != C) return ArrayConstants->getOrCreate(Ty, V); } return ConstantAggregateZero::get(Ty); } This seems wrong to me, and it's causing a problem in Objective-...
2012 Jan 22
2
[LLVMdev] Fwd: How to force the creation of arrays with zeroes?
Yep check out PR1324. Doing something like this would be a great improvement. -Chris On Jan 21, 2012, at 9:42 AM, Duncan Sands <baldrick at free.fr> wrote: > Hi Anton, in a solution without CAZ, isNullValue can just return true when it > sees the special "this ConstantArray is all zero" flag. So all the places that > now look for CAZ can just use isNullValue instead and there need be no > performance loss. That said, CAZ is more "in your force" so less likely to be >...
2007 Feb 23
2
[LLVMdev] bytecode reader assertion failure
...have been working on that produces bytecode that passes the verifier. However, when I try to read that bytecode back in, I get the assertion failure below. llvm::BytecodeReader::ParseConstantPoolValue(unsigned int): Assertion `(!isa<Constant>(Result) || !cast<Constant>(Result)->isNullValue()) || !hasImplicitNull(TypeID) && "Cannot read null values from bytecode!"' failed. So, I ran gdb on opt. I was able to get the following information from opt: (gdb) print Result $7 = (class llvm::Constant *) 0x96ad9d0 (gdb) call Result->dump() [41 x sbyte *] zeroini...
2019 Feb 13
2
changing variable naming rules in LLVM codebase
...nym is useful, and we at least need to have some recommendation for the “well known” ones). > > Example: > > if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) > if (CE->getOpcode() == Instruction::GetElementPtr && > CE->getOperand(0)->isNullValue()) { > > In the above example, is the recommendation to use “ce” instead of “CE” now? Or should it be “cE”? > With lowerCamelCase one might think that “cE” is the correct one (although I personally think that one looks quite ugly). In most examples, you’d use something other than an in...
2012 Jan 21
0
[LLVMdev] Fwd: How to force the creation of arrays with zeroes?
Hi Anton, in a solution without CAZ, isNullValue can just return true when it sees the special "this ConstantArray is all zero" flag. So all the places that now look for CAZ can just use isNullValue instead and there need be no performance loss. That said, CAZ is more "in your force" so less likely to be forgotten about. A...
2012 Jan 22
0
[LLVMdev] Fwd: How to force the creation of arrays with zeroes?
...3, "Chris Lattner" <clattner at apple.com>: > Yep check out PR1324.  Doing something like this would be a great improvement. > > -Chris > > On Jan 21, 2012, at 9:42 AM, Duncan Sands <baldrick at free.fr> wrote: > >>  Hi Anton, in a solution without CAZ, isNullValue can just return true when it >>  sees the special "this ConstantArray is all zero" flag.  So all the places that >>  now look for CAZ can just use isNullValue instead and there need be no >>  performance loss.  That said, CAZ is more "in your force" so less li...
2005 May 03
2
[LLVMdev] VC++ build broken
The recently added code: static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) { if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY); if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty, -INFINITY); if (V2->isNullValue()) return 0; BuiltinType R = (BuiltinType)V1->getValue() / (BuiltinType)V2->getValue(); return ConstantClass::get(*Ty, R); } does not compile with VC++. The symbol INFINITY is undefined, nor is there an equivalent I can find.
2005 May 03
2
[LLVMdev] VC++ build broken
...y added code: >> static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) { >> if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY); >> if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty, >> -INFINITY); >> if (V2->isNullValue()) return 0; >> BuiltinType R = (BuiltinType)V1->getValue() / >> (BuiltinType)V2->getValue(); >> return ConstantClass::get(*Ty, R); >> } >> >> does not compile with VC++. The symbol INFINITY is undefined, nor is >> there an equivalent I can fi...
2007 Feb 23
0
[LLVMdev] bytecode reader assertion failure
...duces > bytecode that passes the verifier. However, when I try to read that > bytecode back in, I get the assertion failure below. > > llvm::BytecodeReader::ParseConstantPoolValue(unsigned int): > Assertion `(!isa<Constant>(Result) || > !cast<Constant>(Result)->isNullValue()) || !hasImplicitNull(TypeID) && > "Cannot read null values from bytecode!"' failed. > > So, I ran gdb on opt. I was able to get the following information from opt: > > (gdb) print Result > $7 = (class llvm::Constant *) 0x96ad9d0 > (gdb) call Result-...
2007 Feb 23
1
[LLVMdev] bytecode reader assertion failure
...ecode that passes the verifier. However, when I try to read that >>bytecode back in, I get the assertion failure below. >> >>llvm::BytecodeReader::ParseConstantPoolValue(unsigned int): >>Assertion `(!isa<Constant>(Result) || >>!cast<Constant>(Result)->isNullValue()) || !hasImplicitNull(TypeID) && >>"Cannot read null values from bytecode!"' failed. >> >>So, I ran gdb on opt. I was able to get the following information from opt: >> >>(gdb) print Result >>$7 = (class llvm::Constant *) 0x96ad9d0 >&...
2014 Feb 27
3
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...total ordering requires two values that indicates non-equivalence (L less R, L greater R). [/new comment] > > +enum ConstantType { > I'm not sure that this buys you much. All the "isa" tests can be broken > down into a switch on getValueID() with the one exception of isNullValue(). Done. > + assert( > + C1->getType()->canLosslesslyBitCastTo(C2->getType()) && > + "Pass is healthless. checkForLosslessBitcast should be twin of " > + "canLosslesslyBitCastTo method, except the case when the last one " &g...
2009 Nov 06
2
[LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything
...ult >> BasicAliasAnalysis::aliasCheck(const Value *V1, unsigned V1Size, >> const Value *V2, unsigned V2Size) { >> + // Null pointers do not alias with anything >> + if (const Constant *C = dyn_cast<Constant>(V1)) >> + if (C->isNullValue()) >> + return NoAlias; >> + >> + if (const Constant *C = dyn_cast<Constant>(V2)) >> + if (C->isNullValue()) >> + return NoAlias; >> + > > As Chris mentioned, for consistency with what the rest of LLVM is doing, > this should che...
2005 May 03
0
[LLVMdev] VC++ build broken
...en wrote: > The recently added code: > static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) { > if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY); > if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty, -INFINITY); > if (V2->isNullValue()) return 0; > BuiltinType R = (BuiltinType)V1->getValue() / (BuiltinType)V2->getValue(); > return ConstantClass::get(*Ty, R); > } > > does not compile with VC++. The symbol INFINITY is undefined, nor is there > an equivalent I can find. Can std::numeric_limits be us...
2005 May 03
0
[LLVMdev] VC++ build broken
On Mon, 2 May 2005, Jeff Cohen wrote: > Yes, that will work. I'll make the change. While you're at it, please remove this line, which is dead: if (V2->isNullValue()) return 0; Thanks, -Chris > Chris Lattner wrote: > >> On Mon, 2 May 2005, Jeff Cohen wrote: >> >>> The recently added code: >>> static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) { >>> if (V2->isExactlyValue(0.0)) return C...
2008 Aug 01
2
[LLVMdev] Sparc assembly syntax
...emporary) solution is a hack, however: ================================================================== --- SparcAsmPrinter.cpp (revision 720) +++ SparcAsmPrinter.cpp (working copy) @@ -263,7 +263,7 @@ // FALL THROUGH case GlobalValue::InternalLinkage: if (C->isNullValue()) - SwitchToDataSection(".bss", I); + SwitchToDataSection("\t.section\t\".bss\"", I); else SwitchToDataSection(".data", I); break; My question is: What is the "right" way to do this? I l...
2012 Jan 21
2
[LLVMdev] Fwd: How to force the creation of arrays with zeroes?
Sorry, forgot to reply-all ---------- Forwarded message ---------- From: Anton Korobeynikov <anton at korobeynikov.info> Date: Sat, Jan 21, 2012 at 20:59 Subject: Re: [LLVMdev] How to force the creation of arrays with zeroes? To: Stepan Dyatkovskiy <STPWORLD at narod.ru> > Though, there is also cases when we really need to transform it to 10,000 zeroes (just look at CBackend.cpp,
2010 Mar 03
3
[LLVMdev] folding x * 0 = 0
...m, you can do so by adding it to the instcombine pass. We'd need IR enhancements to do this sort of thing for real in the mid-level optimizer, some thoughts are here: > http://nondot.org/sabre/LLVMNotes/FloatingPointChanges.txt > Thanks, now it works. I inserted if (Op1F->isNullValue()) return ReplaceInstUsesWith(I, Op1C); // X * 0 == 0 into llvm::InstCombiner::visitFMul Why not at first create a compile time option for this so that the code is already available for special purposes? -Jochen