Displaying 20 results from an estimated 23 matches for "createmul".
2018 Aug 07
2
Error Calling eraseFromParent()
Hi.
This is part of my code:
...
if (auto* op = dyn_cast<BinaryOperator>(&I)) {
Value* lhs = op->getOperand(0);
Value* rhs = op->getOperand(1);
Value* mul = builder.CreateMul(lhs, rhs);
for (auto& U : op->uses()) {
User* user = U.getUser();
user->setOperand(U.getOperandNo(), mul);
}
I.eraseFromParent();
}
...
This leads to the following runtime error:
LLVMSymbolizer: error reading file: No such file or directory
...
Does anybody know the...
2018 Aug 08
2
Error Calling eraseFromParent()
...();
for (inst_iterator It = inst_begin(&F), Ie = inst_end(&F); It != Ie;) {
Instruction *I = &*(It++);
if (auto* op = dyn_cast<BinaryOperator>(I)) {
IRBuilder<NoFolder> builder(op);
Value* lhs = op->getOperand(0);
Value* rhs = op->getOperand(1);
Value* mul = builder.CreateMul(lhs, rhs);
for (auto& U : op->uses()) {
User* user = U.getUser();
user->setOperand(U.getOperandNo(), mul);
}
//I->eraseFromParent();
dels.push_back(I);
}
}
for (auto &I : dels) {
I->eraseFromParent();
}
...
On Wed, Aug 8, 2018 at 6:16 PM, mayuyu.io <admin at mayuyu.io&...
2016 May 31
0
AMDGPUPromoteAlloca assume 3-dims enabled?
hi, list,
I found AMDGPUPromoteAlloca calculates newly ptr as follows:
std::tie(TCntY, TCntZ) = getLocalSizeYZ(Builder);
Value *TIdX = getWorkitemID(Builder, 0);
Value *TIdY = getWorkitemID(Builder, 1);
Value *TIdZ = getWorkitemID(Builder, 2);
Value *Tmp0 = Builder.CreateMul(TCntY, TCntZ, "", true, true);
Tmp0 = Builder.CreateMul(Tmp0, TIdX);
Value *Tmp1 = Builder.CreateMul(TIdY, TCntZ, "", true, true);
Value *TID = Builder.CreateAdd(Tmp0, Tmp1);
TID = Builder.CreateAdd(TID, TIdZ);
it assumes that we enable 3 dims already?
actually,...
2018 Aug 07
2
Error Calling eraseFromParent()
...ds to it. The
whole code is:
...
bool runOnFunction(Function &F) override {
for (auto &I : instructions(F)) {
if (auto* op = dyn_cast<BinaryOperator>(&I)) {
IRBuilder<> builder(op);
Value* lhs = op->getOperand(0);
Value* rhs = op->getOperand(1);
Value* mul = builder.CreateMul(lhs, rhs);
for (auto& U : op->uses()) {
User* user = U.getUser();
user->setOperand(U.getOperandNo(), mul);
}
I.eraseFromParent();
}
}
...
And I think that the code worked well with LLVM-3.6.0 that I tested one
year ago. Now, I use LLVM-6.0.0.
Regards.
On Tue, Aug 7, 2018 at 8:...
2018 Aug 08
3
Error Calling eraseFromParent()
...n(&F), Ie = inst_end(&F); It != Ie;) {
> Instruction *I = &*(It++);
>
> if (auto* op = dyn_cast<BinaryOperator>(I)) {
> IRBuilder<NoFolder> builder(op);
>
> Value* lhs = op->getOperand(0);
> Value* rhs = op->getOperand(1);
> Value* mul = builder.CreateMul(lhs, rhs);
>
> for (auto& U : op->uses()) {
> User* user = U.getUser();
> user->setOperand(U.getOperandNo(), mul);
> }
> //I->eraseFromParent();
> dels.push_back(I);
> }
> }
>
> for (auto &I : dels) {
> I->eraseFromParent();
> }
> .....
2018 Aug 07
2
Error Calling eraseFromParent()
...nFunction(Function &F) override {
>
> for (auto &I : instructions(F)) {
>
> if (auto* op = dyn_cast<BinaryOperator>(&I)) {
> IRBuilder<> builder(op);
>
> Value* lhs = op->getOperand(0);
> Value* rhs = op->getOperand(1);
> Value* mul = builder.CreateMul(lhs, rhs);
>
> for (auto& U : op->uses()) {
> User* user = U.getUser();
> user->setOperand(U.getOperandNo(), mul);
> }
>
> I.eraseFromParent();
> }
>
> }
> ...
> And I think that the code worked well with LLVM-3.6.0 that I tested one
> year a...
2008 Apr 11
2
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
...is my first patch so please let me know if there are any
>> problems or anything I need to do differently.
>>
> And there were. updated patches attached.
Looking good. One big comment: Please attach patches to email instead
of including them inline.
Some nits:
> + Value *CreateMul(Value *LHS, Value *RHS, const char *Name = "") {
> + if (Constant *LC = dyn_cast<Constant>(LHS))
> + if (Constant *RC = dyn_cast<Constant>(RHS))
> + return ConstantExpr::getMul(LC, RC);
> + return Insert(BinaryOperator::createMul(LHS, RHS, N...
2015 Apr 15
2
[LLVMdev] Instruction combiner multiplication canonicalization
...em.cpp >
168 Instruction *InstCombiner::visitMul(BinaryOperator &I) {
268 // Canonicalize (X+C1)*CI -> X*CI+C1*CI.
269 {
270 Value *X;
271 Constant *C1;
272 if (match(Op0, m_OneUse(m_Add(m_Value(X), m_Constant(C1))))) {
273 Value *Mul = Builder->CreateMul(C1, Op1);
274 // Only go forward with the transform if C1*CI simplifies to a tidier
275 // constant.
276 if (!match(Mul, m_Mul(m_Value(), m_Value())))
277 return BinaryOperator::CreateAdd(Builder->CreateMul(X, Op1), Mul);
278 }
279 }
If my under...
2008 Apr 10
0
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
Dominic Hamon wrote:
> Duncan Sands wrote:
>>> Another option that was discussed in #llvm is to nuke LLVMBuilder
>>> and rename LLVMFoldingBuilder to LLVMBuilder. If this was the case,
>>> I'd argue for a flag in the Builder that could retain the old
>>> non-folding functionality for debugging purposes.
>>>
>>
>> this plan
2008 Apr 10
3
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
Duncan Sands wrote:
>> Another option that was discussed in #llvm is to nuke LLVMBuilder and
>> rename LLVMFoldingBuilder to LLVMBuilder. If this was the case, I'd
>> argue for a flag in the Builder that could retain the old non-folding
>> functionality for debugging purposes.
>>
>
> this plan sounds good to me. However it's not clear to me how
2008 Dec 30
2
[LLVMdev] Folding vector instructions
...eading the code in Gallium-3D driver in a mesa3d branch, which
converts the shader programs (TGSI tokens) to LLVM IR.
For the shader instruction also found in LLVM IR, the conversion is trivial:
<code>
llvm::Value * Instructions::mul(llvm::Value *in1, llvm::Value *in2) {
return m_builder.CreateMul(in1, in2, name("mul")); // m_builder is a
llvm::IRBuilder
}
</code>
However, the special instrucions cannot directly be mapped to LLVM IR, like
"min", the conversion involves in 'extract' the vector, create
less-than-compare, create 'select' instruction, a...
2005 Jul 28
2
[LLVMdev] help with pointer-to-array conversion
...etIncomingValue(0)))
> if (CE->getOpcode() == Instruction::GetElementPtr) // We
want this to become explicit...
> {
> std::cerr << "Block Before: " << *GEPI->getParent();
> Instruction *mul =
BinaryOperator::createMul(saved_trip_count,
> LI->getLoopFor( phi->getIncomingBlock(1) )
> ->getCanonicalInductionVariable(), "mul.",
GEPI);
> Instruction *add = BinaryOperator::createAdd(mul,
NewAdd, "add.&q...
2007 May 27
2
[LLVMdev] New LLVMBuilder api
...rt
it. In particular, when you create an LLVMBuilder object, you can tell it
where to insert all subsequently created instructions. This means you end
up writing code like this:
LLVMBuilder B;
B.SetInsertPoint(<where-ever>);
Value *V1 = B.CreateAdd(a, b, "tmp");
Value *V2 = B.CreateMul(V1, c, "whatever");
Value *V3 = B.CreateCall(FnPtr, V1, V2);
...
The name strings are c strings, are always at the end of the argument
list, and are always optional.
This API is simple and consistent, which makes it easy to understand. It
would also be really easy to build a C api f...
2005 Jul 28
0
[LLVMdev] help with pointer-to-array conversion
...gt; if (CE->getOpcode() == Instruction::GetElementPtr) // We
> want this to become explicit...
>> {
>> std::cerr << "Block Before: " << *GEPI->getParent();
>> Instruction *mul =
> BinaryOperator::createMul(saved_trip_count,
>> LI->getLoopFor( phi->getIncomingBlock(1) )
>> ->getCanonicalInductionVariable(), "mul.",
> GEPI);
>> Instruction *add = BinaryOperator::createAdd(mul,
>...
2014 Sep 19
2
[LLVMdev] More careful treatment of floating point exceptions
Hi Sanjay,
Thanks, I saw this flag and it's definitely should be considered, but
it appeared to me to be static characteristic of target platform. I'm
not sure how appropriate it would be to change its value from a front-end.
It says "Has", while optional flag would rather say "Uses" meaning that
implementation cares about floating point exceptions.
Regards,
Sergey
2014 Sep 25
2
[LLVMdev] More careful treatment of floating point exceptions
...f --git a/include/llvm/Analysis/TargetFolder.h b/include/llvm/Analysis/TargetFolder.h
index 587a7ef..e9b2ba17 100644
--- a/include/llvm/Analysis/TargetFolder.h
+++ b/include/llvm/Analysis/TargetFolder.h
@@ -62,11 +62,14 @@ public:
return Fold(ConstantExpr::getFSub(LHS, RHS));
}
Constant *CreateMul(Constant *LHS, Constant *RHS,
- bool HasNUW = false, bool HasNSW = false) const {
- return Fold(ConstantExpr::getMul(LHS, RHS, HasNUW, HasNSW));
- }
- Constant *CreateFMul(Constant *LHS, Constant *RHS) const {
- return Fold(ConstantExpr::getFMul(LHS, RHS));
+...
2008 Dec 30
2
[LLVMdev] [Mesa3d-dev] Folding vector instructions
...r in a mesa3d branch, which
> converts the shader programs (TGSI tokens) to LLVM IR.
>
> For the shader instruction also found in LLVM IR, the conversion is trivial:
>
> <code>
> llvm::Value * Instructions::mul(llvm::Value *in1, llvm::Value *in2) {
> return m_builder.CreateMul(in1, in2, name("mul")); // m_builder is a
> llvm::IRBuilder
> }
> </code>
>
> However, the special instrucions cannot directly be mapped to LLVM IR, like
> "min", the conversion involves in 'extract' the vector, create
> less-than-compare, cre...
2010 Mar 23
2
[LLVMdev] How to avoid memory leaks
...uction(unsigned
int, llvm::Constant*, llvm::Constant*) (in /home/gabi/vgen/Debug/vgen)
==20504== by 0x88BD87: llvm::ConstantExpr::getTy(llvm::Type const*,
unsigned int, llvm::Constant*, llvm::Constant*, unsigned int) (in
/home/gabi/vgen/Debug/vgen)
==20504== by 0x423ADA:
llvm::ConstantFolder::CreateMul(llvm::Constant*, llvm::Constant*)
const (ConstantFolder.h:61)
==20504== by 0x424CD8: llvm::IRBuilder<true, llvm::ConstantFolder,
llvm::IRBuilderDefaultInserter<true> >::CreateMul(llvm::Value*,
llvm::Value*, llvm::Twine const&) (IRBuilder.h:364)
==20504== by 0x4225EF: vgen::Cod...
2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...n() {
Value *L = LHS->Codegen();
Value *R = RHS->Codegen();
if (L == 0 || R == 0) return 0;
switch (Op) {
case '+': return Builder.CreateAdd(L, R, "addtmp");
case '-': return Builder.CreateSub(L, R, "subtmp");
case '*': return Builder.CreateMul(L, R, "multmp");
case '<':
L = Builder.CreateFCmpULT(L, R, "cmptmp");
// Convert bool 0/1 to double 0.0 or 1.0
return Builder.CreateUIToFP(L,
Type::getDoubleTy(getGlobalContext()), "booltmp");
default: return ErrorV("invalid binary opera...
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...odegen();
> Value *R = RHS->Codegen();
> if (L == 0 || R == 0) return 0;
>
> switch (Op) {
> case '+': return Builder.CreateAdd(L, R, "addtmp");
> case '-': return Builder.CreateSub(L, R, "subtmp");
> case '*': return Builder.CreateMul(L, R, "multmp");
> case '<':
> L = Builder.CreateFCmpULT(L, R, "cmptmp");
> // Convert bool 0/1 to double 0.0 or 1.0
> return Builder.CreateUIToFP(L,
> Type::getDoubleTy(getGlobalContext()), "booltmp");
> default: return ErrorV(&...