search for: binaryop

Displaying 20 results from an estimated 31 matches for "binaryop".

2012 Apr 19
2
[LLVMdev] Tablegen to match a literal in an instruction
...> : Instruction { let Namespace = "AMDIL"; dag OutOperandList = outs; dag InOperandList = ins; ILOpCode operation = op; let Pattern = pattern; let AsmString = !strconcat(asmstr, "\n"); bit hasIEEEFlag = 0; bit hasZeroOpFlag = 0; } class BinaryOp<ILOpCode op, SDNode OpNode, RegisterClass dReg, RegisterClass sReg0, RegisterClass sReg1> : ILFormat<op, (outs dReg:$dst), (ins sReg0:$src0, sReg1:$src1), !strconcat(op.Text, " $dst, $src0, $src1"), [(set dReg:$dst, (OpNode sReg0:$src0, sReg1:$src1))]>;...
2012 Apr 19
3
[LLVMdev] Tablegen to match a literal in an instruction
...> : Instruction { let Namespace = "AMDIL"; dag OutOperandList = outs; dag InOperandList = ins; ILOpCode operation = op; let Pattern = pattern; let AsmString = !strconcat(asmstr, "\n"); bit hasIEEEFlag = 0; bit hasZeroOpFlag = 0; } class BinaryOp<ILOpCode op, SDNode OpNode, RegisterClass dReg, RegisterClass sReg0, RegisterClass sReg1> : ILFormat<op, (outs dReg:$dst), (ins sReg0:$src0, sReg1:$src1), !strconcat(op.Text, " $dst, $src0, $src1"), [(set dReg:$dst, (OpNode sReg0:$src0, sReg1:$src1))]>;...
2012 Apr 19
0
[LLVMdev] Tablegen to match a literal in an instruction
...ot;AMDIL"; > dag OutOperandList = outs; > dag InOperandList = ins; > ILOpCode operation = op; > let Pattern = pattern; > let AsmString = !strconcat(asmstr, "\n"); > bit hasIEEEFlag = 0; > bit hasZeroOpFlag = 0; > } > class BinaryOp<ILOpCode op, SDNode OpNode, RegisterClass dReg, > RegisterClass sReg0, RegisterClass sReg1> > : ILFormat<op, (outs dReg:$dst), (ins sReg0:$src0, sReg1:$src1), > !strconcat(op.Text, " $dst, $src0, $src1"), > [(set dReg:$dst, (OpNode sReg0:$src0,...
2012 Apr 19
0
[LLVMdev] Tablegen to match a literal in an instruction
...ot;AMDIL"; > dag OutOperandList = outs; > dag InOperandList = ins; > ILOpCode operation = op; > let Pattern = pattern; > let AsmString = !strconcat(asmstr, "\n"); > bit hasIEEEFlag = 0; > bit hasZeroOpFlag = 0; > } > class BinaryOp<ILOpCode op, SDNode OpNode, RegisterClass dReg, > RegisterClass sReg0, RegisterClass sReg1> > : ILFormat<op, (outs dReg:$dst), (ins sReg0:$src0, sReg1:$src1), > !strconcat(op.Text, " $dst, $src0, $src1"), > [(set dReg:$dst, (OpNode sReg0:$src0,...
2017 Sep 13
2
How to add optimizations to InstCombine correctly?
Hi, I am working on PR34474 and try to add a new optimization to InstCombine. Like in other parts of the visitMul function I add a Shl through the IR builder and create a new BinaryOp which I return from visitMul. If I understand correctly the new BinaryOp returned from visitMul should replace the original Instruction in the Worklist. However, I end up in an infinite loop and the Instruction I try to replace gets scheduled again and again. What is wrong in my code? // Repla...
2017 Sep 13
3
How to add optimizations to InstCombine correctly?
...aidl, Michael via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi, >> >> I am working on PR34474 and try to add a new optimization to >> InstCombine. Like in other parts of the visitMul function I add a Shl >> through the IR builder and create a new BinaryOp which I return from >> visitMul. If I understand correctly the new BinaryOp returned from >> visitMul should replace the original Instruction in the Worklist. >> However, I end up in an infinite loop and the Instruction I try to >> replace gets scheduled again and again. Wha...
2017 Sep 14
3
How to add optimizations to InstCombine correctly?
...sts.llvm.org>> wrote: > > Hi, > > I am working on PR34474 and try to add a new optimization to > InstCombine. Like in other parts of the visitMul function I > add a Shl > through the IR builder and create a new BinaryOp which I > return from > visitMul. If I understand correctly the new BinaryOp > returned from > visitMul should replace the original Instruction in the > Worklist. > However, I end up in an infinite loop and th...
2017 Sep 16
2
How to add optimizations to InstCombine correctly?
...> > > Hi, > > > > I am working on PR34474 and try to add a new optimization to > > InstCombine. Like in other parts of the visitMul function I > > add a Shl > > through the IR builder and create a new BinaryOp which I > > return from > > visitMul. If I understand correctly the new BinaryOp > > returned from > > visitMul should replace the original Instruction in the > > Worklist. > > However, I end...
2009 Dec 10
2
[LLVMdev] SplitVecRes with SIGN_EXTEND_INREG unsupported
On Thu, Dec 10, 2009 at 12:46 PM, Villmow, Micah <Micah.Villmow at amd.com> wrote: > Eli, >  I have a simple SplitVecRes function that implements what you mentioned, splitting the LHS just as in BinaryOp, but passing through the RHS. The problem is that the second operand is MVT::Other, but when casted to an VTSDNode reveals that it is a vector length of the same size as the LHS SDValue. This causes a split on the LHS side to work correctly, but then it fails instruction selection because of Other....
2013 Nov 26
2
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...oo", functionType, nullptr)); llvmFunction->setCallingConv(llvm::CallingConv::C); llvm::BasicBlock * body = llvm::BasicBlock::Create(c, "__entry__", llvmFunction); llvm::IRBuilder <> builder(body); llvm::Value * result = builder.CreateBinOp(llvm::Instruction::BinaryOps::Add, llvm::ConstantInt::getSigned(functionType, 40), llvm::ConstantInt::getSigned(functionType, 2)); builder.CreateRet(result); llvm::verifyModule(module, llvm::PrintMessageAction); std::string errorInfo; llvm::raw_fd_ostream fileStream("test.ll", errorInfo); llvm...
2008 Oct 08
3
[LLVMdev] Lost instcombine opportunity: "or"s of "icmp"s (commutability)
...e simplification: x == 8 OR x > 10 OR x != 5 becomes.. %or.eq8.gt10 OR x != 5 and that can't be simplified because we now have an "or" OR "icmp". What would I need to implement to restore the commutative property? Perhaps a first stab would be to take (A|B)|C create two binaryOp A|C and B|C and recursively call visitOr on each of them to see if they simplify. Using the example above.. Before: %or.eq8.gt10 = .. ; [uses=1] %res = or %or.eq8.gt10, %ne5 ; original instruction After: %or.eq8.gt10 = .. ; [uses=0] %or.eq8.ne5 = %ne5 ; instcombine recursively simplified this [us...
2017 Sep 19
0
How to add optimizations to InstCombine correctly?
...I am working on PR34474 and try to add a new >> optimization to >> > InstCombine. Like in other parts of the visitMul >> function I >> > add a Shl >> > through the IR builder and create a new BinaryOp which I >> > return from >> > visitMul. If I understand correctly the new BinaryOp >> > returned from >> > visitMul should replace the original Instruction in the >> > Workli...
2005 Jan 27
1
[LLVMdev] Question about inserting IR code
Hi, From the file HowToUseJIT.cpp, I learned how to insert some calcuation IR code like Add/Sub/Mul etc by using Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB); By following this way, it works well when I insert some IR code whose operand is integer type like IntTy, however, when I tried to insert similar thing whose operands are float point, I got the following message when I run it void llvm::Bina...
2017 Jul 24
2
LazyValueInfo vs ScalarEvolution
On Mon, Jul 24, 2017 at 2:29 PM, John Regehr via llvm-dev < llvm-dev at lists.llvm.org> wrote: > On 7/24/17 3:16 PM, Hongbin Zheng via llvm-dev wrote: > >> Thanks, maybe we could use ScalarEvolution in LazyValueInfo if it is >> available? >> > > This should be fairly easy to try, if you want to propose a patch and run > some experiments. The question is
2009 Dec 10
0
[LLVMdev] SplitVecRes with SIGN_EXTEND_INREG unsupported
...Re: [LLVMdev] SplitVecRes with SIGN_EXTEND_INREG unsupported > > On Thu, Dec 10, 2009 at 12:46 PM, Villmow, Micah > <Micah.Villmow at amd.com> wrote: > > Eli, > >  I have a simple SplitVecRes function that implements what you > mentioned, splitting the LHS just as in BinaryOp, but passing through > the RHS. The problem is that the second operand is MVT::Other, but when > casted to an VTSDNode reveals that it is a vector length of the same > size as the LHS SDValue. This causes a split on the LHS side to work > correctly, but then it fails instruction selecti...
2008 Oct 08
0
[LLVMdev] [PATCH] Lost instcombine opportunity: "or"s of "icmp"s (commutability)
...x > 10 OR x != 5 becomes.. > %or.eq8.gt10 OR x != 5 > and that can't be simplified because we now have an "or" OR "icmp". > > What would I need to implement to restore the commutative property? > > Perhaps a first stab would be to take (A|B)|C create two binaryOp A|C > and B|C and recursively call visitOr on each of them to see if they > simplify. Using the example above.. > > Before: > %or.eq8.gt10 = .. ; [uses=1] > %res = or %or.eq8.gt10, %ne5 ; original instruction > > After: > %or.eq8.gt10 = .. ; [uses=0] > %or.eq8.ne5 = %n...
2009 Dec 10
0
[LLVMdev] SplitVecRes with SIGN_EXTEND_INREG unsupported
Eli, I have a simple SplitVecRes function that implements what you mentioned, splitting the LHS just as in BinaryOp, but passing through the RHS. The problem is that the second operand is MVT::Other, but when casted to an VTSDNode reveals that it is a vector length of the same size as the LHS SDValue. This causes a split on the LHS side to work correctly, but then it fails instruction selection because of Other....
2017 Sep 19
0
How to add optimizations to InstCombine correctly?
...I am working on PR34474 and try to add a new >> optimization to >> > InstCombine. Like in other parts of the visitMul >> function I >> > add a Shl >> > through the IR builder and create a new BinaryOp which I >> > return from >> > visitMul. If I understand correctly the new BinaryOp >> > returned from >> > visitMul should replace the original Instruction in the >> > Workli...
2013 Nov 28
0
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...llptr)); > llvmFunction->setCallingConv(llvm::CallingConv::C); > llvm::BasicBlock * body = llvm::BasicBlock::Create(c, "__entry__", > llvmFunction); > llvm::IRBuilder <> builder(body); > llvm::Value * result = > builder.CreateBinOp(llvm::Instruction::BinaryOps::Add, > llvm::ConstantInt::getSigned(functionType, 40), > llvm::ConstantInt::getSigned(functionType, 2)); > builder.CreateRet(result); > > llvm::verifyModule(module, llvm::PrintMessageAction); > > std::string errorInfo; > llvm::raw_fd_ostream fileStream("...
2011 Dec 06
1
[LLVMdev] Problem with IR code instruction
Hi... I'm having some trouble with an IR instruction. I'm triying to modify it. I was trying to create a BinaryOperator "op" with some operands from Instruction "inst": op = BinaryOperator::Create(Instruction::Add,cast<Value>(inst->getOperand(0)),cast<Value>(r),inst->getNameStr(),inst); But when executed, my pass throw a segfault and a stacktrace: ../build/Release/bin/c...