search for: op0

Displaying 20 results from an estimated 68 matches for "op0".

Did you mean: op
2007 Oct 08
1
[LLVMdev] patch to docs/BitCodeFormat.html
I wrote in a few weeks ago about writing an independent implementation of Bitcode and updating the docs to be more complete. Attached is a patch to docs/BitCodeFormat.html that adds a lot of information that was previously only available by reading the source code. It also corrects some errors. Josh -------------- next part -------------- An HTML attachment was scrubbed... URL:
2013 Jan 09
0
[LLVMdev] Global variable initializer type does not match global variable type
...ior: > > (snip) I've ran the good and bad bitcode files for a more compact example (attached) through llvm-bcanalyzer and diff: --- bad.xml 2013-01-09 22:57:58.691131492 +0400 +++ good.xml 2013-01-09 22:58:04.153133734 +0400 ... irrelevant ... <STRUCT_NAME abbrevid=7 op0=105 op1=46 op2=78 op3=105 op4=108 op5=67 op6=108 op7=97 op8=115 op9=115/> <STRUCT_NAMED abbrevid=8 op0=0 op1=0 op2=6/> <POINTER abbrevid=4 op0=7 op1=0/> - <STRUCT_ANON abbrevid=6 op0=0 op1=0 op2=6/> </TYPE_BLOCK_ID> <GLOBALVAR abbrevid=4 op0=8 o...
2017 Apr 04
5
RFC: Adding a string table to the bitcode format
...IFUNC,COMDAT} records would change so that their first operand would specify their names with a byte offset into the string table. (To allow for backwards compatibility, I would increment the bitcode version.) Here is what it would look like as bcanalyzer output: <MODULE_BLOCK> <VERSION op0=2> <COMDAT op0=0 ...> ; name = foo <FUNCTION op0=0 ...> ; name = foo <GLOBALVAR op0=4 ...> ; name = bar <ALIAS op0=8 ...> ; name = baz ; function bodies, etc. </MODULE_BLOCK> <STRTAB_BLOCK> <STRTAB_BLOB blob="foo\0bar\0baz\0"> </S...
2013 Jan 09
2
[LLVMdev] Global variable initializer type does not match global variable type
Hello. I've managed to create a bitcode file (attached; also available at [1]) which produces a series of identical errors when verified: | Global variable initializer type does not match global variable type! | %i.NilClass* @nil When ran through llvm-dis and recompiled, through, it verifies successfully. If I disassemble it one more time, the result is identical to the first
2010 Oct 02
1
[LLVMdev] Illegal optimization in LLVM 2.8 during SelectionDAG? (Re: comparison pattern trouble - might be a bug in LLVM 2.8?)
...her optimization afterwards.. >> >> // Transform br(xor(x, y)) -> br(x != y) >> // Transform br(xor(xor(x,y), 1)) -> br (x == y) >> if (N1.hasOneUse()&& N1.getOpcode() == ISD::XOR) { >> SDNode *TheXor = N1.getNode(); >> SDValue Op0 = TheXor->getOperand(0); >> SDValue Op1 = TheXor->getOperand(1); >> if (Op0.getOpcode() == Op1.getOpcode()) { >> // Avoid missing important xor optimizations. >> SDValue Tmp = visitXOR(TheXor); >> if (Tmp.getNode()&& Tmp.ge...
2017 Apr 04
4
RFC: Adding a string table to the bitcode format
...heir names > with a byte offset into the string table. (To allow for backwards > compatibility, I would increment the bitcode version.) > > > I assume you mean the EPOCH? > > Here is what it would look like as bcanalyzer output: > > <MODULE_BLOCK> > <VERSION op0=2> > <COMDAT op0=0 ...> ; name = foo > <FUNCTION op0=0 ...> ; name = foo > <GLOBALVAR op0=4 ...> ; name = bar > <ALIAS op0=8 ...> ; name = baz > ; function bodies, etc. > </MODULE_BLOCK> > <STRTAB_BLOCK> > <STRTAB_BLOB blo...
2017 Apr 04
4
RFC: Adding a string table to the bitcode format
...> > > I assume you mean the EPOCH? > No, the MODULE_CODE_VERSION. http://llvm-cs.pcc.me.uk/lib/Bitcode/Writer/BitcodeWriter.cpp#3822 It isn't clear to me why we have both. > Here is what it would look like as bcanalyzer output: > > <MODULE_BLOCK> > <VERSION op0=2> > <COMDAT op0=0 ...> ; name = foo > <FUNCTION op0=0 ...> ; name = foo > <GLOBALVAR op0=4 ...> ; name = bar > <ALIAS op0=8 ...> ; name = baz > ; function bodies, etc. > </MODULE_BLOCK> > <STRTAB_BLOCK> > <STRTAB_BLOB blo...
2011 Jan 24
3
[LLVMdev] How to change the type of an Instruction?
...ed to "clone" an Instruction, changing its type. That is, I would like to keep all characteristics of the old Instruction and create a new one only with a different type. I am trying create a new Instruction thus: %3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction Value* Op0 = I->getOperand(0); Value* Op1 = I->getOperand(1); Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()), Op0->getValueID()); Value* V1 = new Value(Type::getInt16Ty(Op1->getContext()), Op1->getValueID()); Instruction* newInst = BinaryOperator::CreateNSWAdd(V0, V1, "test&q...
2017 Apr 04
2
RFC: Adding a string table to the bitcode format
...;> > > No, the MODULE_CODE_VERSION. > http://llvm-cs.pcc.me.uk/lib/Bitcode/Writer/BitcodeWriter.cpp#3822 > It isn't clear to me why we have both. > > >> Here is what it would look like as bcanalyzer output: >> >> <MODULE_BLOCK> >> <VERSION op0=2> >> <COMDAT op0=0 ...> ; name = foo >> <FUNCTION op0=0 ...> ; name = foo >> <GLOBALVAR op0=4 ...> ; name = bar >> <ALIAS op0=8 ...> ; name = baz >> ; function bodies, etc. >> </MODULE_BLOCK> >> <STRTAB_BLOCK&gt...
2010 Sep 30
4
[LLVMdev] Illegal optimization in LLVM 2.8 during SelectionDAG? (Re: comparison pattern trouble - might be a bug in LLVM 2.8?)
...which just drops the truncate away.. then there is another optimization afterwards.. // Transform br(xor(x, y)) -> br(x != y) // Transform br(xor(xor(x,y), 1)) -> br (x == y) if (N1.hasOneUse() && N1.getOpcode() == ISD::XOR) { SDNode *TheXor = N1.getNode(); SDValue Op0 = TheXor->getOperand(0); SDValue Op1 = TheXor->getOperand(1); if (Op0.getOpcode() == Op1.getOpcode()) { // Avoid missing important xor optimizations. SDValue Tmp = visitXOR(TheXor); if (Tmp.getNode() && Tmp.getNode() != TheXor) { DEBUG(dbgs() &l...
2010 Oct 01
0
[LLVMdev] Illegal optimization in LLVM 2.8 during SelectionDAG? (Re: comparison pattern trouble - might be a bug in LLVM 2.8?)
...away.. > then there is another optimization afterwards.. > > // Transform br(xor(x, y)) -> br(x != y) > // Transform br(xor(xor(x,y), 1)) -> br (x == y) > if (N1.hasOneUse() && N1.getOpcode() == ISD::XOR) { > SDNode *TheXor = N1.getNode(); > SDValue Op0 = TheXor->getOperand(0); > SDValue Op1 = TheXor->getOperand(1); > if (Op0.getOpcode() == Op1.getOpcode()) { > // Avoid missing important xor optimizations. > SDValue Tmp = visitXOR(TheXor); > if (Tmp.getNode() && Tmp.getNode() != TheXor) { >...
2019 Dec 31
3
Any significance for m_OneUse in (X / Y) / Z => X / (Y * Z) ??
...sformation. Z / (X / Y) => (Y * Z) / X This is performed only when operand Op1 ( (X/Y) in this case) has only one use in future. The code snippet is shown below. if (match(Op1, m_OneUse(m_FDiv(m_Value(X), m_Value(Y)))) && (!isa<Constant>(Y) || !isa<Constant>(Op0))) { // Z / (X / Y) => (Y * Z) / X Value *YZ = Builder.CreateFMulFMF(Y, Op0, &I); return BinaryOperator::CreateFDivFMF(YZ, X, &I); } It would be great if someone explains if there is any issue (correctness/performance-wise) if we avoid the m_OueUse check. What if w...
2011 Jan 24
0
[LLVMdev] How to change the type of an Instruction?
...s). Similarly, what if the old type is a float and the new one is an int? float to signed int, float to unsigned int, or bitcast (only legal sometimes)? I am trying > create a new Instruction thus: > > %3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction > > Value* Op0 = I->getOperand(0); > Value* Op1 = I->getOperand(1); > Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()), > Op0->getValueID()); Hunh, Value's constructor is protected. In any event, Value is pure base. Constructing one this way will never get you what you want. I...
2017 Sep 13
2
How to add optimizations to InstCombine correctly?
...What is wrong in my code? // Replace 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
2011 Jan 24
3
[LLVMdev] How to change the type of an Instruction?
...ut it because I only create smaller instructions. So I never convert a 32-bit instruction in a 64-bit instruction. > > > I am trying > >> create a new Instruction thus: >> >> %3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction >> >> Value* Op0 = I->getOperand(0); >> Value* Op1 = I->getOperand(1); >> Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()), >> Op0->getValueID()); >> > > Hunh, Value's constructor is protected. > > In any event, Value is pure base. Constructing one this w...
2015 Mar 09
2
[LLVMdev] LLVM Backend DAGToDAGISel INTRINSIC
...lt number!"'. More specifically I am doing something like: EVT ReturnValueVT = Node->getValueType(0) ; SDValue ChainIn = Node->getOperand(0); SDValue Zero = CurDAG->getCopyFromReg(ChainIn, DL, Mips::ZERO, MVT::i32); SDValue op0 = Node->getOperand(2); SDValue op1 = Node->getOperand(3); SDValue op2= Node->getOperand(4); SDValue op3 = Node->getOperand(5); SDValue Ops[]= { op0, op1, op2, op3, Zero, ChainIn }; SDNode *Result = CurDAG->getMachi...
2010 Sep 29
0
[LLVMdev] comparison pattern trouble - might be a bug in LLVM 2.8?
On Sep 29, 2010, at 12:36 AM, Heikki Kultala wrote: > On 29 Sep 2010, at 06:25, Heikki Kultala wrote: > >> Our architecture has 1-bit boolean predicate registers. >> >> I've defined comparison >> >> def NErrb : InstTCE<(outs I1Regs:$op3), (ins I32Regs:$op1,I32Regs:$op2), "", [(set I1Regs:$op3, (setne I32Regs:$op1, I32Regs:$op2))]>;
2011 Feb 21
2
[LLVMdev] Questions about LLVM IR encoding
...sts as the document suggests, but I conclude with nothing helpful to my work. The result of my experiment is attached. It is a simple add program, and from the bc file generated by llvm-bcanalyzer I cannot relate it to the original IR. For example, the expressions of <INST_STORE2 op0=6 op1=1 op2=3 op3=0/> <INST_STORE2 op0=5 op1=3 op2=3 op3=0/> actually represent those of store i32 1, i32* %a, align 4 store i32 2, i32* %b, align 4 in the .ll file. Despite the explicit opcode matches in the two forms, I am confused of the information of op0, op1 e...
2017 Sep 13
3
How to add optimizations to InstCombine correctly?
...lt;< 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 >> _______________________________________________ >> LLVM Developers mailing list >> l...
2009 Jul 25
3
[LLVMdev] Bug in ExecutionEngine::getConstantValue() -- Instruction::PtrToInt
I think I might have found a bug in the exection engine's 'constants folding'. Basically APInt's parameters are the wrong way round. Line 577 for lib/ExecutionEngine/ExecutionEngine.cpp :- case Instruction::PtrToInt: { GenericValue GV = getConstantValue(Op0); uint32_t PtrWidth = TD->getPointerSizeInBits(); GV.IntVal = APInt(PtrWidth, uintptr_t(GV.PointerVal)); return GV; } Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090725/db18...