search for: constval

Displaying 14 results from an estimated 14 matches for "constval".

2012 May 08
0
[LLVMdev] Address space information dropped
...orrectly propagate it. It also > avoids existent back-ends to break because of an unimplemented hook in > MCAsmInfo. @@ -1046,7 +1046,8 @@ if (CPE.isMachineConstantPoolEntry()) EmitMachineConstantPoolValue(CPE.Val.MachineCPVal); else - EmitGlobalConstant(CPE.Val.ConstVal); + EmitGlobalConstant(CPE.Val.ConstVal, (isa<PointerType>(Ty)) ? + cast<PointerType>(Ty)->getAddressSpace() : 0); } } } This looks suspicious; how can an entry in the constant pool possibly acquire an address space based on the type of the value? -Eli
2012 May 08
4
[LLVMdev] Address space information dropped
Hi Eli, On 07/05/2012 18:15, Eli Friedman wrote: > On Mon, May 7, 2012 at 5:15 AM, Ivan Llopard<ivanllopard at gmail.com> wrote: >> Hi all, >> >> Tuning my TargetAsmPrinter implementation in the back-end side, I >> discovered that the address space number is not passed down while >> emitting global variables with constant initializers. The information is
2012 May 09
1
[LLVMdev] Address space information dropped
...> avoids existent back-ends to break because of an unimplemented hook in >> MCAsmInfo. > @@ -1046,7 +1046,8 @@ > if (CPE.isMachineConstantPoolEntry()) > EmitMachineConstantPoolValue(CPE.Val.MachineCPVal); > else > - EmitGlobalConstant(CPE.Val.ConstVal); > + EmitGlobalConstant(CPE.Val.ConstVal, (isa<PointerType>(Ty)) ? > + cast<PointerType>(Ty)->getAddressSpace() : 0); > } > } > } > > This looks suspicious; how can an entry in the constant pool possibly > acquire an address spac...
2019 Feb 05
2
IRBuilder constraints
...s example). But LLVM uses global variables, which happen to have the correct addresses. Even more strange is, that for a bit shifting operation a global variable address is used as operand. The IRBuilder code for the memread instruction is the following for both cases(simplified version): int constVal = param1; llvm::IRBuilder<>& irb; llvm::Value* op1 = llvm::ConstantInt::getSigned(irb.getInt32Ty(), constVal); auto* pt = llvm::PointerType::get(op1->getType(), 0); auto* addr = irb.CreateIntToPtr(op1, pt); auto* loaded = irb.CreateLoad(addr); irb.CreateStore(lo...
2008 Mar 30
3
[LLVMdev] Being able to know the jitted code-size before emitting
Hi everyone, vmkit requires to know the size of a jitted method before emitting the method. This allows to allocate the correct size for the method. The attached patch creates this functionality when the flag SizedMemoryCode is on. In order to implement this functionality, i had to virtualize some MachineCodeEmitter functions. Is it OK to commit the patch? Thanks, Nicolas --------------
2008 Apr 01
2
[LLVMdev] Being able to know the jitted code-size before emitting
...; >>> >> + if (Constants.empty()) return; >> + >> + MachineConstantPoolEntry CPE = Constants.back(); >> + unsigned Size = CPE.Offset; >> + const Type *Ty = CPE.isMachineConstantPoolEntry() >> + ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal->getType(); >> + Size += Fn->getTarget().getTargetData()->getABITypeSize(Ty); >> + ConstantPoolBase = allocateSpace(Size, 1 << MCP- >> >>> getConstantPoolAlignment()); >>> >> + ConstantPool = MCP; >> +} >> + >&g...
2008 Mar 31
0
[LLVMdev] Being able to know the jitted code-size before emitting
...mp;Constants = MCP- > >getConstants(); > + if (Constants.empty()) return; > + > + MachineConstantPoolEntry CPE = Constants.back(); > + unsigned Size = CPE.Offset; > + const Type *Ty = CPE.isMachineConstantPoolEntry() > + ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal->getType(); > + Size += Fn->getTarget().getTargetData()->getABITypeSize(Ty); > + ConstantPoolBase = allocateSpace(Size, 1 << MCP- > >getConstantPoolAlignment()); > + ConstantPool = MCP; > +} > + > +void SizeEmitter::initJumpTableInfo(MachineJumpTableInfo *...
2008 Apr 01
0
[LLVMdev] Being able to know the jitted code-size before emitting
...t;>> + if (Constants.empty()) return; >>> + >>> + MachineConstantPoolEntry CPE = Constants.back(); >>> + unsigned Size = CPE.Offset; >>> + const Type *Ty = CPE.isMachineConstantPoolEntry() >>> + ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal- >>> >getType(); >>> + Size += Fn->getTarget().getTargetData()->getABITypeSize(Ty); >>> + ConstantPoolBase = allocateSpace(Size, 1 << MCP- >>> >>>> getConstantPoolAlignment()); >>>> >>> + ConstantPool = MCP; &gt...
2008 Apr 04
3
[LLVMdev] Being able to know the jitted code-size before emitting
...nstants.empty()) return; >>>> + >>>> + MachineConstantPoolEntry CPE = Constants.back(); >>>> + unsigned Size = CPE.Offset; >>>> + const Type *Ty = CPE.isMachineConstantPoolEntry() >>>> + ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal- >>>> >>>>> getType(); >>>>> >>>> + Size += Fn->getTarget().getTargetData()->getABITypeSize(Ty); >>>> + ConstantPoolBase = allocateSpace(Size, 1 << MCP- >>>> >>>> &g...
2008 Apr 05
2
[LLVMdev] Being able to know the jitted code-size before emitting
...;>> + >>>>>> + MachineConstantPoolEntry CPE = Constants.back(); >>>>>> + unsigned Size = CPE.Offset; >>>>>> + const Type *Ty = CPE.isMachineConstantPoolEntry() >>>>>> + ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal- >>>>>> >>>>>> >>>>>>> getType(); >>>>>>> >>>>>>> >>>>>> + Size += Fn->getTarget().getTargetData()->getABITypeSize(Ty); >>>>>> +...
2008 Apr 05
0
[LLVMdev] Being able to know the jitted code-size before emitting
...>>>>>> + MachineConstantPoolEntry CPE = Constants.back(); >>>>>>> + unsigned Size = CPE.Offset; >>>>>>> + const Type *Ty = CPE.isMachineConstantPoolEntry() >>>>>>> + ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal- >>>>>>> >>>>>>> >>>>>>>> getType(); >>>>>>>> >>>>>>>> >>>>>>> + Size += Fn->getTarget().getTargetData()->getABITypeSize(Ty); >>>>>>> +...
2008 Apr 04
0
[LLVMdev] Being able to know the jitted code-size before emitting
...urn; >>>>> + >>>>> + MachineConstantPoolEntry CPE = Constants.back(); >>>>> + unsigned Size = CPE.Offset; >>>>> + const Type *Ty = CPE.isMachineConstantPoolEntry() >>>>> + ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal- >>>>> >>>>>> getType(); >>>>>> >>>>> + Size += Fn->getTarget().getTargetData()->getABITypeSize(Ty); >>>>> + ConstantPoolBase = allocateSpace(Size, 1 << MCP- >>>>> >>>>> >...
2008 Apr 07
2
[LLVMdev] Being able to know the jitted code-size before emitting
...>>> + MachineConstantPoolEntry CPE = Constants.back(); >>>>>>>> + unsigned Size = CPE.Offset; >>>>>>>> + const Type *Ty = CPE.isMachineConstantPoolEntry() >>>>>>>> + ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal- >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> getType(); >>>>>>>>> >>>>>>>>> >>>>>>>>> >...
2008 Apr 07
0
[LLVMdev] Being able to know the jitted code-size before emitting
...+ MachineConstantPoolEntry CPE = Constants.back(); >>>>>>>>> + unsigned Size = CPE.Offset; >>>>>>>>> + const Type *Ty = CPE.isMachineConstantPoolEntry() >>>>>>>>> + ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal- >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>>> getType(); >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>...