search for: getsplatvalu

Displaying 17 results from an estimated 17 matches for "getsplatvalu".

Did you mean: getsplatvalue
2012 Feb 09
2
[LLVMdev] Your commit 149912 "Remove some dead code and tidy things up"...
...> @@ -98,13 +98,6 @@ > Res = &CI->getValue(); > return true; > } > - // FIXME: Remove this. > - if (ConstantVector *CV = dyn_cast<ConstantVector>(V)) > - if (ConstantInt *CI = > - dyn_cast_or_null<ConstantInt>(CV->getSplatValue())) { > - Res = &CI->getValue(); > - return true; > - } > if (ConstantDataVector *CV = dyn_cast<ConstantDataVector>(V)) > if (ConstantInt *CI = > dyn_cast_or_null<ConstantInt>(CV->getSplatValue())) { ...
2016 Jul 20
2
Hitting assertion failure related to vectorization + instcombine
...e' --- Looking at the code, the issue is with this line: if (TrueVal == X && match(FalseVal, m_And(m_Specific(X), m_APInt(C))) && *Y == ~*C) In this case Y is a 128-bit APInt, and so is the value that C is extracted from, but the m_APInt matcher has code that calls getSplatValue() if the matched expression has vector type. So C ends up as an 8-bit value, triggering the assertion failure on the call to ==. The issue is clear but I'm not sure what the correct fix should be -- whether this code is just not meant to work with vector types, or whether the call to getSplat...
2016 Jul 20
2
Hitting assertion failure related to vectorization + instcombine
...this line: >> >> if (TrueVal == X && match(FalseVal, m_And(m_Specific(X), m_APInt(C))) && >> *Y == ~*C) >> >> In this case Y is a 128-bit APInt, and so is the value that C is >> extracted from, but the m_APInt matcher has code that calls getSplatValue() >> if the matched expression has vector type. So C ends up as an 8-bit value, >> triggering the assertion failure on the call to ==. >> >> The issue is clear but I'm not sure what the correct fix should be -- >> whether this code is just not meant to work with v...
2013 Jul 22
0
[LLVMdev] Inverse of ConstantFP::get and similar functions?
...e (checking for vectors matching the predicate in the > vector case). > > For example: > > static bool ConstantFP::isExactlyValue(Value *V, double D); You can currently do this: if (const ConstantVector *CV = dyn_cast<ConstantVector>(X)) if (Constant *Splat = CV->getSplatValue()) // Now you know that Splat is a splatted value, so check it for something. -Hal > > would return true is V is ConstantFP, a splat ConstantVector, or a > ConstantDataVector with the appropriate type. Similarly, > > static bool ConstantFP::isZero(Value *V); > >...
2012 Feb 10
0
[LLVMdev] Your commit 149912 "Remove some dead code and tidy things up"...
...>> Res = &CI->getValue(); >> return true; >> } >> - // FIXME: Remove this. >> - if (ConstantVector *CV = dyn_cast<ConstantVector>(V)) >> - if (ConstantInt *CI = >> - dyn_cast_or_null<ConstantInt>(CV->getSplatValue())) { >> - Res = &CI->getValue(); >> - return true; >> - } >> if (ConstantDataVector *CV = dyn_cast<ConstantDataVector>(V)) >> if (ConstantInt *CI = >> dyn_cast_or_null<ConstantInt>(CV->getSplatValue()...
2016 Jul 22
2
Hitting assertion failure related to vectorization + instcombine
...amp;& match(FalseVal, m_And(m_Specific(X), m_APInt(C))) >>>> && >>>> *Y == ~*C) >>>> >>>> In this case Y is a 128-bit APInt, and so is the value that C is >>>> extracted from, but the m_APInt matcher has code that calls getSplatValue() >>>> if the matched expression has vector type. So C ends up as an 8-bit value, >>>> triggering the assertion failure on the call to ==. >>>> >>>> The issue is clear but I'm not sure what the correct fix should be -- >>>> whether th...
2012 Feb 10
1
[LLVMdev] Your commit 149912 "Remove some dead code and tidy things up"...
...CI->getValue(); >>> return true; >>> } >>> - // FIXME: Remove this. >>> - if (ConstantVector *CV = dyn_cast<ConstantVector>(V)) >>> - if (ConstantInt *CI = >>> - dyn_cast_or_null<ConstantInt>(CV->getSplatValue())) { >>> - Res =&CI->getValue(); >>> - return true; >>> - } >>> if (ConstantDataVector *CV = dyn_cast<ConstantDataVector>(V)) >>> if (ConstantInt *CI = >>> dyn_cast_or_null<ConstantInt&...
2016 Jul 25
2
Hitting assertion failure related to vectorization + instcombine
...t;>>> && >> >>>> *Y == ~*C) >> >>>> >> >>>> In this case Y is a 128-bit APInt, and so is the value that C is >> >>>> extracted from, but the m_APInt matcher has code that calls >> >>>> getSplatValue() >> >>>> if the matched expression has vector type. So C ends up as an 8-bit >> >>>> value, >> >>>> triggering the assertion failure on the call to ==. >> >>>> >> >>>> The issue is clear but I'm not sure...
2016 Jul 27
0
Hitting assertion failure related to vectorization + instcombine
...& >>> >>>> *Y == ~*C) >>> >>>> >>> >>>> In this case Y is a 128-bit APInt, and so is the value that C is >>> >>>> extracted from, but the m_APInt matcher has code that calls >>> >>>> getSplatValue() >>> >>>> if the matched expression has vector type. So C ends up as an 8-bit >>> >>>> value, >>> >>>> triggering the assertion failure on the call to ==. >>> >>>> >>> >>>> The issue is clear...
2016 Jul 28
1
Hitting assertion failure related to vectorization + instcombine
...gt;>>> *Y == ~*C) > >>> >>>> > >>> >>>> In this case Y is a 128-bit APInt, and so is the value that C is > >>> >>>> extracted from, but the m_APInt matcher has code that calls > >>> >>>> getSplatValue() > >>> >>>> if the matched expression has vector type. So C ends up as an > 8-bit > >>> >>>> value, > >>> >>>> triggering the assertion failure on the call to ==. > >>> >>>> > >>> >&g...
2013 Jul 22
6
[LLVMdev] Inverse of ConstantFP::get and similar functions?
Hi, I noticed that ConstantFP::get automatically returns the appropriately types Constant depending on the LLVM type passed in (i.e. if called with a vector, it returns a splat vector with the given constant). Is there any simple way to do the inverse of this function? i.e., given a llvm::Value, check whether it is either a scalar of the given constant value or a splat vector with the given
2015 Jul 09
2
[LLVMdev] Extracting a splat value from vector instruction.
Hi, We have a function in IRBuilder.h Value *CreateVectorSplat(unsigned NumElts, Value *V, const Twine &Name = "") { .. } This function creates 2 instructions - "insertelement" and "shuffle" with all-zero mask. Now I want to add Value *getSplatValue(Value *Val). This function will try to recognize the pattern - insertelement+shuffle and return the splat value (or nullptr). I suppose, this interface should be useful. Do you agree with me? If yes, where should I put it? May it be I can define a new class VectorInst and put this interface there...
2013 Jan 20
1
[LLVMdev] Get the value of a GlobalVariable
...GlobalVariable *my_global = Mod->getNamedGlobal("MY_GLOBAL"); I want to know the value which was stored in this variable, I use the following command, but it gives error: APInt value = my_global->getValue(); Error is: llvm/lib/IR/Constants.cpp:1257: llvm::Constant *llvm::Constant::getSplatValue() const: Assertion `this->getType()->isVectorTy() && "Only valid for vectors!"' failed. I am new to LLVM, so a lot of nomenclature is still not very familiar to me and I am trying to understand it as I go forward. Thanks, Varun Agrawal -------------- next part ------...
2017 Mar 15
2
Speculative execution of FP divide Instructions - Call-Graph Simplify
...:FRem:{ + const Value *Denominator = Inst->getOperand(1); + // x / y is undefined if y == 0 + // The denominator is not a constant, so there is nothing we can do to prove + // it is non-zero. + if (auto *VV = dyn_cast<ConstantVector>(Denominator)) + Denominator = VV->getSplatValue(); + if (!isa<ConstantFP>(Denominator)) + return false; + // The denominator is a zero constant - we can't speculate here. + if (m_AnyZero().match(Denominator)) + return false; + return true; + } case Instruction::Load: { const LoadInst *LI = cast<LoadIn...
2017 Mar 15
3
Speculative execution of FP divide Instructions - Call-Graph Simplify
...rand(1); >> + // x / y is undefined if y == 0 >> + // The denominator is not a constant, so there is nothing we can >> do to prove >> + // it is non-zero. >> + if (auto *VV = dyn_cast<ConstantVector>(Denominator)) >> + Denominator = VV->getSplatValue(); >> + if (!isa<ConstantFP>(Denominator)) >> + return false; >> + // The denominator is a zero constant - we can't speculate here. >> + if (m_AnyZero().match(Denominator)) >> + return false; >> + return true; >> + } >&g...
2017 Mar 15
2
Speculative execution of FP divide Instructions - Call-Graph Simplify
...:FRem:{ + const Value *Denominator = Inst->getOperand(1); + // x / y is undefined if y == 0 + // The denominator is not a constant, so there is nothing we can do to prove + // it is non-zero. + if (auto *VV = dyn_cast<ConstantVector>(Denominator)) + Denominator = VV->getSplatValue(); + if (!isa<ConstantFP>(Denominator)) + return false; + // The denominator is a zero constant - we can't speculate here. + if (m_AnyZero().match(Denominator)) + return false; + return true; + } case Instruction::Load: { const LoadInst *LI = cast<LoadIn...
2019 Aug 29
6
[SVE][AArch64] Codegen for a scalable vector splat
Hi, During the discussion on introducing scalable vectors we established that we could use the canonical IR form for splats of scalable vector types (insert element into lane 0 of an undef vector, shuffle that with another undef vector of the same type and a zeroinitializer mask). We do run into a problem for lowering to SelectionDAG however, since the canonical form there is a BUILD_VECTOR with