search for: tglobaladdr

Displaying 20 results from an estimated 41 matches for "tglobaladdr".

2011 Apr 26
2
[LLVMdev] Symbol folding with MC
...a pattern in the .td file like this: def : Pat<(add DLDREGS:$src1, imm:$src2), (SUBIWRdK DLDREGS:$src1, (imm16_neg_XFORM imm:$src2))>; Now, the typical pattern concerning additions with global addresses looks like this: (taken from x86) def : Pat<(add GR32:$src1, (X86Wrapper tglobaladdr :$src2)), (ADD32ri GR32:$src1, tglobaladdr:$src2)>; but i can't write that since i dont have an add with imm instr, and doing: def : Pat<(add DREGS:$src, (Wrapper tglobaladdr:$src2)), (SUBIWRdK DREGS:$src, tglobaladdr:$src2)>; is wrong because the tglobala...
2009 Apr 20
2
[LLVMdev] A few questions from a newbie
Hi Jacob, thank you for your reply. Your suggestion works! But instead of using the Pat<>, I am using def MOVE_ADDR : MYInst<(outs Int32Regs:$dst), (ins i32mem:$a), "move $dst, $a;", [(set Int32Regs:$dst, (Wrapper tglobaladdr:$a))]>; I don't quite understand what the semantics of Pat in general. Could you please explain what def : Pat<(BfinWrapper (i32 tglobaladdr:$addr)), (LOAD32imm tglobaladdr:$addr)>; means? And I totally agree it would be better if someone can explain why the Wrapper is n...
2011 Apr 26
0
[LLVMdev] Symbol folding with MC
...(SUBIWRdK DLDREGS:$src1, (imm16_neg_XFORM imm:$src2))>; > Cool. That's exactly the sort of thing I was referring to. > Now, the typical pattern concerning additions with global addresses looks like this: (taken from x86) > def : Pat<(add GR32:$src1, (X86Wrapper tglobaladdr :$src2)), > (ADD32ri GR32:$src1, tglobaladdr:$src2)>; > > but i can't write that since i dont have an add with imm instr, and doing: > > def : Pat<(add DREGS:$src, (Wrapper tglobaladdr:$src2)), > (SUBIWRdK DREGS:$src, tglobaladdr:$src2)>;...
2012 Jul 25
2
[LLVMdev] Purpose of MSP430Wrapper
...MSP430ISelLowering.cpp that ISD::GlobalAddress: ISD::BlockAddress: ISD::ExternalSymbol all get lowered to MSP430ISD::Wrapper(address space) plus the wrapped address node. What has me mystified is that in some of the patterns in MSP430InstrInfo.td take the form def : Pat<(i16 (MSP430Wrapper tglobaladdr:$dst)), (MOV16ri tglobaladdr:$dst)>; and others ... def : Pat<(MSP430call (i16 tglobaladdr:$dst)), (CALLi tglobaladdr:$dst)>; In other words, some patterns rely on MSP430Wrapper being part of the pattern then extract the wrapped info anyway, and some others just directly match tgloba...
2011 Apr 27
1
[LLVMdev] Symbol folding with MC
...c1, (imm16_neg_XFORM imm:$src2))>; > > > > Cool. That's exactly the sort of thing I was referring to. > > > > Now, the typical pattern concerning additions with global addresses looks > like this: (taken from x86) > > def : Pat<(add GR32:$src1, (X86Wrapper tglobaladdr :$src2)), > > (ADD32ri GR32:$src1, tglobaladdr:$src2)>; > > > > but i can't write that since i dont have an add with imm instr, and > doing: > > > > def : Pat<(add DREGS:$src, (Wrapper tglobaladdr:$src2)), > > (SUBIWRdK DR...
2016 Jan 15
2
Expanding a PseudoOp and accessing the DAG
On 1/15/2016 1:08 PM, Phil Tomson wrote: > > Ah, I see, the defm is a multi-class so I needed to change it to: > > def: Pat<(load (XSTGADDR_NORMAL tglobaladdr:$addr)), > (LOADI64_RI tglobaladdr:$addr, 0)>; > // Match load from a relocatable address to a load with GRP: > def: Pat<(load (XSTGADDR_USE_GRP tglobaladdr:$addr)), > (LOADI64_RI (MOVIMMZ_I64 tglobaladdr:$addr), GRP)>; Right. > ...at least that gets t...
2016 Jan 15
2
Expanding a PseudoOp and accessing the DAG
...Nodes corresponding to these opcodes, e.g. > "addr_normal" and "addr_use_grp". Then, you can have these patterns for > loads: > > // Match a load from a non-relocatable address to a simple load > // instruction (with offset 0): > def: Pat<(load (addr_normal tglobaladdr:$addr)), > (load tglobaladdr:$addr, 0)>; > // Match load from a relocatable address to a load with GRP: > def: Pat<(load (addr_use_grp tglobaladdr:$addr)), > (load (movimm tglobaladdr:$addr), GRP)>; > I'm not entirely sure what to replace 'load'...
2012 Jul 25
2
[LLVMdev] Purpose of MSP430Wrapper
...ISD::ExternalSymbol >> >> all get lowered to MSP430ISD::Wrapper(address space) plus the wrapped >> address node. >> >> What has me mystified is that in some of the patterns in >> MSP430InstrInfo.td take the form >> >> def : Pat<(i16 (MSP430Wrapper tglobaladdr:$dst)), (MOV16ri >> tglobaladdr:$dst)>; >> >> and others ... >> >> def : Pat<(MSP430call (i16 tglobaladdr:$dst)), (CALLi tglobaladdr:$dst)>; >> >> In other words, some patterns rely on MSP430Wrapper being part of the >> pattern then extract t...
2012 Jul 25
0
[LLVMdev] Purpose of MSP430Wrapper
...gt; ISD::BlockAddress: > ISD::ExternalSymbol > > all get lowered to MSP430ISD::Wrapper(address space) plus the wrapped > address node. > > What has me mystified is that in some of the patterns in > MSP430InstrInfo.td take the form > > def : Pat<(i16 (MSP430Wrapper tglobaladdr:$dst)), (MOV16ri > tglobaladdr:$dst)>; > > and others ... > > def : Pat<(MSP430call (i16 tglobaladdr:$dst)), (CALLi tglobaladdr:$dst)>; > > In other words, some patterns rely on MSP430Wrapper being part of the > pattern then extract the wrapped info anyway, and...
2009 Apr 20
2
[LLVMdev] A few questions from a newbie
Hello, I am learning to write a new backend for LLVM and have a few simple questions. 1) What are the differences between 'constant' and 'targetconstant', 'globaladdress' and 'targetglobaladdress'? It is not clear from the document when and which should be used. 2) On the processor I am working on, there is a 'move reg, mem_addr' instruction. When I try to match it using the pattern [(set Int32Regs::reg, tglobaladdr::mem_addr)]. the code generated by tblgen cannot be compi...
2009 Apr 20
0
[LLVMdev] A few questions from a newbie
...am learning to write a new backend for LLVM and have a few > simple questions. Hi Peter, I am a newbie too, but I have recently dealt with the same issues. > 1) What are the differences between 'constant' and 'targetconstant', > 'globaladdress' and 'targetglobaladdress'? It is not clear from the > document when and which should be used. The target* variants are 'done' and will not be changed further by the instruction selection. After instruction selection, everything should be converted to the target* variants. > 2) On the processor...
2012 Jul 25
0
[LLVMdev] Purpose of MSP430Wrapper
...ith is why this .... > > def BL_lu10 : _FLU10< > (outs), > (ins calltarget:$target, variable_ops), > "bl $target", > [(XCoreBranchLink immU20:$target)]>; > > def : Pat<(XCoreBranchLink tglobaladdr:$addr), (BL_lu10 > tglobaladdr:$addr)>; > def : Pat<(XCoreBranchLink texternalsym:$addr), (BL_lu10 > texternalsym:$addr)>; > > is necessary. Are the Pat<> s just 'casting' tglobaladdr:$addr and > texternalsym:$addr to an immU20 to force a match ? There is...
2016 Jan 13
2
Expanding a PseudoOp and accessing the DAG
...SSA-based optimizations, after register allocation. In > other words, quite late in the entire optimization sequence. Most of the > actual optimization work is pretty much done at this point. > > > [as an aside, we've got patterns like: >> >> def : Pat<(XSTGMVINI tglobaladdr:$off), >> (MOVIMMZ_I64 tglobaladdr:$off)>; >> >> ] >> > > I'm not sure if the input will match if you have tglobaladdr in it. The > 't' means "target", and in this context it means that the argument has > already been handled...
2007 Aug 03
1
[LLVMdev] Adding intrinsic with variable argument list HOWTO.
...EInstrInfo.td, for recognizing that variable argument intrinsic and I have no idea how it's done. Right now I'm trying following: def CustomOpParams : SDTypeProfile<0,2,[]>; def customop : SDNode<"ISD::INTRINSIC_VOID", CustomOpParams>; def : Pat<(customop tglobaladdr:$dst,iPTR:$vararg), (int_tce_customop tglobaladdr:$dst, iAny:$vararg)>; def : Pat<(call texternalsym:$dst,iAny:$vararg), (int_tce_customop texternalsym:$dst, iAny:$vararg)>; but compilation gives following error: isVoid:void anonymous.52: (intrinsic_void:void...
2016 Jan 13
2
Expanding a PseudoOp and accessing the DAG
...stRAPseudo function, however, I'm a bit worried that expansion happens too late (after things should already be MI's, it seems). So things like patterns that try to match on that XSTGMVINI would have already been matched. [as an aside, we've got patterns like: def : Pat<(XSTGMVINI tglobaladdr:$off), (MOVIMMZ_I64 tglobaladdr:$off)>; ] So, first off, if I wanted to expand that DAG for the RelAddr Node, and I want something like (the first BuildMI below is pseudo code as I'm not sure how to accomplish it): case XSTG::RelAddr: BuildMI(MBB, MI, DL, MI->getOperand(...
2013 Apr 12
1
[LLVMdev] Problem with Store of i8 in a global address
...STInst<(outs), (ins globaladdress:$addr, GPR32:$ra), "stdb\t$addr, $ra", [], IIStore> { let mayStore = 1; } def : Pat<(atomic_store_8 (IcyflexCONST32_GP tglobaladdr:$global), (i32 GPR32:$ra)), (STdb tglobaladdr:$global, (i32 GPR32:$ra))>; def : Pat <(truncstorei8 (i32 GPR32:$ra), (myCONST32_GP tglobaladdr:$global)), (STdb tglobaladdr:$global, (i32 GPR32:$ra))>; However, this IR code...
2016 Jan 15
2
Expanding a PseudoOp and accessing the DAG
...e (in XSTGGenDGISel.inc): > > > /*2235*/ OPC_SwitchOpcode /*2 cases */, 27, > TARGET_VAL(XSTGISD::ADDR_NORMAL),// ->2266 > /*2239*/ OPC_RecordChild0, // #1 = $addr > /*2240*/ OPC_MoveChild, 0, > /*2242*/ OPC_CheckOpcode, TARGET_VAL(ISD::TargetGlobalAddress), > /*2245*/ OPC_MoveParent, > /*2246*/ OPC_MoveParent, > /*2247*/ OPC_CheckPredicate, 5, // Predicate_unindexedload > /*2249*/ OPC_CheckPredicate, 6, // Predicate_load > /*2251*/ OPC_CheckType, MVT::i64, > /*2253*/ OPC_Emit...
2014 Mar 09
2
[LLVMdev] Isel DAG documentation?
...the DAG thinks it's doing and make it clear why the recursion happens. It's because the globaladdr node doesn't actually get changed during matching, so LLVM is just going to encounter it again at the next step and perform the same substitution. I'd want that Dst globaladdr to be a tglobaladdr (target globaladdr) since LLVM knows it shouldn't try to select target nodes. Existing targets mostly do that during ISelLowering for various reasons, but for your case a separate pattern can probably do the job: def : Pat<(globaladdr:$addr), (MOVar tglobaladdr:$addr)>; > (2) Even wh...
2012 Jul 25
0
[LLVMdev] Purpose of (XXX)Wrapper
...in MSP430ISelLowering.cpp that ISD::GlobalAddress: ISD::BlockAddress: ISD::ExternalSymbol all get lowered to MSP430ISD::Wrapper(address base) plus the wrapped address node. What has me mystified is that in some of the patterns in MSP430InstrInfo.td take the form def : Pat<(i16 (MSP430Wrapper tglobaladdr:$dst)), (MOV16ri tglobaladdr:$dst)>; and others ... def : Pat<(MSP430call (i16 tglobaladdr:$dst)), (CALLi tglobaladdr:$dst)>; In other words, some patterns rely on MSP430Wrapper being part of the pattern then extract the wrapped info anyway, and some others just directly match tglobalad...
2010 Jun 21
2
[LLVMdev] LLC Bug x86 with thread local storage
...===================================================== --- lib/Target/X86/X86Instr64bit.td (revision 105882) +++ lib/Target/X86/X86Instr64bit.td (working copy) @@ -1832,6 +1832,8 @@ (MOV64ri64i32 tjumptable :$dst)>, Requires<[SmallCode]>; def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)), (MOV64ri64i32 tglobaladdr :$dst)>, Requires<[SmallCode]>; +def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)), + (MOV64ri32 tglobaltlsaddr :$dst)>, Requires<[SmallCode]>; def : Pat<(i64 (X86Wrapper texternalsym:$dst)), (MOV64ri64i32...