search for: constantaggregate

Displaying 5 results from an estimated 5 matches for "constantaggregate".

2020 Mar 25
4
Multi-Threading Compilers
...ink). Okay, let's actually think through how practical that is. The class hierarchy is: Value - Argument - BasicBlock - InlineAsm (huh, why is that not a constant?) - MetadataAsValue (+ children) - User -- Instruction (+ children) -- Constant --- ConstantData (undef, token none, literals) --- ConstantAggregate (non-literal aggregates) --- BlockAddress --- ConstantExpr --- GlobalValue (+ children) -- Operator (utility / facade, i.e. not real) -- DerivedUser (extension point used by MemorySSA) It seems to me that the only points of this hierarchy that are guaranteed to be function-local are Argument and I...
2020 Oct 01
3
Creating a global variable for a struct array
...bInitArr,2)); GlobalVariable *htabConst = new GlobalVariable(M, htabInit->getType(), false, GlobalVariable::ExternalLinkage, htabInit, "htab"); Here is the error message: opt: /home/chaitra/llvm-5-src/lib/IR/Constants.cpp:879: llvm::ConstantAggregate::ConstantAggregate(llvm::CompositeType*, llvm::Value::ValueTy, llvm::ArrayRef<llvm::Constant*>): Assertion `V[I]->getType() == T->getTypeAtIndex(I) && "Initializer for composite element doesn't match!"' failed. #0 0x0000000001e558fa (opt+0x1e558fa) #1 0x0000000...
2020 Oct 01
2
Creating a global variable for a struct array
...Create the ConstantStruct that will initialize the first element of the array. Constant *FirstInitArr[] = { FileName, StaticList }; ConstantStruct *FirstInit = ConstantStruct::get(DHashTy, FirstInitArr); // Create an all-zero struct for the rest of the array. Constant *OtherInits = ConstantAggregateZero::get(DHashTy); // Create the global variable. Type *H1Ty = ArrayType::get(DHashTy, 10); Constant *H1InitArr[] = {FirstInit, OtherInits, OtherInits, OtherInits, OtherInits, OtherInits, OtherInits, OtherInits, OtherInits, OtherInits}; Constant *H1Init = ConstantArray::get(H1Ty, H...
2020 Mar 21
3
Multi-Threading Compilers
> On Mar 20, 2020, at 12:34 PM, Nicholas Krause <xerofoify at gmail.com> wrote: > >> >> The problem isn’t constants or functions themselves, it is that they are instances of llvm::Value. Everything that walks a use/def list would have to run code that checks for this, and every call to inst->setOperand() would have to do locking or conditional locking. This would be
2018 May 31
1
Proper way to lower all ConstantExprs?
Hi: For my own Transform passes I need to lower all ConstantExpressions into Instructions in order to conveniently analyze the use-def def-use chains and operand comparisons. Could anyone possibly kindly share some insights on if there is any standard way to do this without crafting my own implementation and if not, should we add this feature into LLVM upstream? Zhang