search for: binaryoperator

Displaying 20 results from an estimated 177 matches for "binaryoperator".

2008 Jul 01
2
[LLVMdev] vmkit on x86_64
...=============================== --- VMCore/JavaJITOpcodes.cpp (revision 52951) +++ VMCore/JavaJITOpcodes.cpp (working copy) @@ -1008,7 +1008,7 @@ Value* val2 = popAsInt(); Value* val1 = popAsInt(); Value* mask = ConstantInt::get(Type::Int32Ty, 0x1F); - val2 = BinaryOperator::CreateAnd(val2, mask, "", currentBlock); + val2 = BinaryOperator::createAnd(val2, mask, "", currentBlock); push(BinaryOperator::createLShr(val1, val2, "", currentBlock), AssessorDesc::dInt); break; @@ -1017,7 +1017,7 @@ ca...
2008 Jul 01
0
[LLVMdev] vmkit on x86_64
Hi Zsombor, Thanks for the patch! Unfortunately I can't apply it because the llvm API has moved from BinaryOperator::create to BinaryOperator::Create. Are you using svn head? Now on the x86_64 part. There has been very little work on porting vmkit on x86_64. If you're having compilation problems, I suppose it's in the garbage collector directory (GCMmap2). If you could make the GC code x86_64 clean,...
2012 Jul 31
0
[LLVMdev] rotate
Oh, no. I should have been more clear. The patch was not rejected, just lost in the daily shuffle. I already have my employer's approval to send this upstream, so I will prepare a patch against trunk this morning. > I proposed a similar patch to LLVM (left circular shift) around 10/2011. > > Parts of my patch did make it into trunk about a year after, but others > > did not.
2012 Jul 31
4
[LLVMdev] rotate
On Monday, July 30, 2012 12:16 AM, Cameron McInally wrote: > Hey Andy, > > I proposed a similar patch to LLVM (left circular shift) around 10/2011. > Parts of my patch did make it into trunk about a year after, but others > did not. > > At that time, my solution was to add a binary operator to the IRBuilder, > since LCS fits in nicely with the other shift operators. But,
2012 Jul 31
3
[LLVMdev] rotate
...-- Index: include/llvm/Instruction.def =================================================================== --- include/llvm/Instruction.def (revision 161045) +++ include/llvm/Instruction.def (working copy) @@ -121,58 +121,59 @@ // Logical operators (integer operands) HANDLE_BINARY_INST(20, Shl , BinaryOperator) // Shift left (logical) HANDLE_BINARY_INST(21, LShr , BinaryOperator) // Shift right (logical) -HANDLE_BINARY_INST(22, AShr , BinaryOperator) // Shift right (arithmetic) -HANDLE_BINARY_INST(23, And , BinaryOperator) -HANDLE_BINARY_INST(24, Or , BinaryOperator) -HANDLE_BINARY_INST(25, Xor , B...
2014 Jun 25
2
[LLVMdev] Question Regarding Sign-Overflow
.../PointerTo/start-with-ll/llvm/class-Value.cc&ct=xref_jump_to_def&cl=GROK&l=3&gsn=*>V <https://cs.corp.google.com/#piper///depot/google3/third_party/llvm/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp&ct=xref_usages&gs=cpp:llvm::class-InstCombiner::visitSub(llvm::BinaryOperator%2520&)::V at google3/third_party/llvm/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp:48204%257Cdef&l=1470&gsn=V> = dyn_castNegVal <https://cs.corp.google.com/#piper///depot/google3/third_party/llvm/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp&ct=xref_jump_to...
2017 Sep 13
2
How to add optimizations to InstCombine correctly?
...place X * (2^C+/-1) with (X << C) -/+ X APInt Plus1 = *IVal + 1; APInt Minus1 = *IVal - 1; int isPow2 = Plus1.isPowerOf2() ? 1 : Minus1.isPowerOf2() ? -1 : 0; if (isPow2) { APInt &Pow2 = isPow2 > 0 ? Plus1 : Minus1; Value *Shl = Builder.CreateShl(Op0, Pow2.logBase2()); return BinaryOperator::Create(isPow2 > 0 ? BinaryOperator::Sub : BinaryOperator::Add, Shl, Op0); } Thanks, Michael
2008 May 08
0
[LLVMdev] Vector code
...y[0]; z[1] = x[1] + y[1]; z[2] = x[2] + y[2]; z[3] = x[3] + y[3]; } And here's part of the output from the online demo: LoadInst* float_tmp2 = new LoadInst(ptr_x, "tmp2", false, label_entry); LoadInst* float_tmp5 = new LoadInst(ptr_y, "tmp5", false, label_entry); BinaryOperator* float_tmp6 = BinaryOperator::create(Instruction::Add, float_tmp2, float_tmp5, "tmp6", label_entry); StoreInst* void_20 = new StoreInst(float_tmp6, ptr_z, false, label_entry); GetElementPtrInst* ptr_tmp10 = new GetElementPtrInst(ptr_x, const_int32_13, "tmp10", label_entry); Load...
2017 Sep 13
3
How to add optimizations to InstCombine correctly?
...Val + 1; >> APInt Minus1 = *IVal - 1; >> int isPow2 = Plus1.isPowerOf2() ? 1 : Minus1.isPowerOf2() ? -1 : 0; >> >> if (isPow2) { >> APInt &Pow2 = isPow2 > 0 ? Plus1 : Minus1; >> Value *Shl = Builder.CreateShl(Op0, Pow2.logBase2()); >> return BinaryOperator::Create(isPow2 > 0 ? BinaryOperator::Sub : >> BinaryOperator::Add, Shl, Op0); >> } >> >> Thanks, >> Michael >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm....
2011 Aug 26
1
[LLVMdev] Why BinaryOperator::Create requires same argument types for shifts?
On 08/26/2011 05:32, Stephan Falke wrote: > As stated in LLVM's language reference manual > (http://llvm.org/docs/LangRef.html#i_shl), both arguments for a shl need > to have the same type. In my case, original types were uint8 (value) and uint32 (shift) llvm lacks unsigned types which made it S1=i8 and S2=i32. It's technically nothing wrong with such combination, and code works
2011 Nov 03
1
[LLVMdev] Why there is no unary operator in LLVM?
Hi llvmdev, I've noticed that there is no unary operator in LLVM. For unary operator such as Neg or Or operator, the IR builder just creates a binary operation with one dummy operand, 01823 <http://llvm.org/doxygen/classllvm_1_1BinaryOperator.html#a073c092ce74a122e898e435e60e84599> BinaryOperator <http://llvm.org/doxygen/classllvm_1_1BinaryOperator.html> *BinaryOperator::CreateNeg <http://llvm.org/doxygen/classllvm_1_1BinaryOperator.html#a073c092ce74a122e898e435e60e84599>(Value <http://llvm.org/doxygen/classllvm_1_1Val...
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::BinaryOper...
2015 Apr 11
2
[LLVMdev] How doesn't llvm generate IR for logical negate operation
How can I generate LLVM IR for both logical NEG (!)? For example, if I have Int32Ty a, For the bitwise NEG(~): c = ~a ; I can use the following API from LLVM: BinaryOperator *neg = BinaryOperator::CreateNeg(nbits, "bitwiseNEG", insertBefore); How, if I want to generate logical NEG: c = !a; what should I do for this? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachmen...
2008 May 08
2
[LLVMdev] Vector code
...; > z[3] = x[3] + y[3]; > } > > And here's part of the output from the online demo: > > LoadInst* float_tmp2 = new LoadInst(ptr_x, "tmp2", false, > label_entry); > LoadInst* float_tmp5 = new LoadInst(ptr_y, "tmp5", false, > label_entry); > BinaryOperator* float_tmp6 = BinaryOperator::create(Instruction::Add, > float_tmp2, float_tmp5, "tmp6", label_entry); > StoreInst* void_20 = new StoreInst(float_tmp6, ptr_z, false, > label_entry); > GetElementPtrInst* ptr_tmp10 = new GetElementPtrInst(ptr_x, > const_int32_13, > &qu...
2008 May 08
3
[LLVMdev] Vector code
Hi Nicolas (at least, I suspect your signing of your mail with "Anton" was not intentional :-p), > I assume that's the same as the online demo's "Show LLVM C++ API code" > option (http://llvm.org/demo/)? I've tried that with a structure containing > four floating-point components but it also appears to add them individually > using extract/insert. Maybe
2017 Sep 14
3
How to add optimizations to InstCombine correctly?
...int isPow2 = Plus1.isPowerOf2() ? 1 : Minus1.isPowerOf2() ? > -1 : 0; > > if (isPow2) { > APInt &Pow2 = isPow2 > 0 ? Plus1 : Minus1; > Value *Shl = Builder.CreateShl(Op0, Pow2.logBase2()); > return BinaryOperator::Create(isPow2 > 0 ? > BinaryOperator::Sub : > BinaryOperator::Add, Shl, Op0); > } > > Thanks, > Michael > _______________________________________________ > LLVM Developers mailing list &...
2018 Sep 26
2
[FPEnv] FNEG instruction
...e I'm looking at foldShuffledBinop(...), so maybe a naive question, but why not do similar shuffle canonicalizations on unary (or ternary) operations? That may be a better fix in the long run. > But glancing at Reassociate.cpp is scarier. It does a lot of stuff like > this: > if (BinaryOperator::isNeg(TheOp) || BinaryOperator::isFNeg(TheOp)) > X = BinaryOperator::getNegArgument(TheOp); > > I think that's going to fail without a (terrible) hack to treat the > proposed fneg as a binop. So that's probably a preliminary requirement: > find all uses of BinaryOperat...
2011 Aug 26
2
[LLVMdev] Why BinaryOperator::Create requires same argument types for shifts?
I get an assert @ Instructions.cpp:1774 when Op=llvm::Instruction::Shl. Should this assert avoid shift operations? Yuri
2011 Aug 26
0
[LLVMdev] Why BinaryOperator::Create requires same argument types for shifts?
Hi Yuri, As stated in LLVM's language reference manual (http://llvm.org/docs/LangRef.html#i_shl), both arguments for a shl need to have the same type. What exactly are you trying to do? --Stephan > I get an assert @ Instructions.cpp:1774 when Op=llvm::Instruction::Shl. > Should this assert avoid shift operations? > > Yuri
2012 Apr 12
0
[LLVMdev] detection of constant diagonal matrix * vector
...tantInt* element = llvm::dyn_cast<llvm::ConstantInt>(elements[i])) values[i] = int(element->getZExtValue()); } } } at the end of InstCombiner::visitFAdd: // check for constant diagonal matrix * vector: a.xx * [2 0] + a.yy * [0 3] --> a * [2 3] BinaryOperator* leftMul = dyn_cast<BinaryOperator>(LHS); BinaryOperator* rightMul = dyn_cast<BinaryOperator>(RHS); if (leftMul != NULL && rightMul != NULL && leftMul->getOpcode() == Instruction::FMul && rightMul->getOpcode() == Instruction::FMul) { ShuffleV...