use of com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMValueRef in project graal by oracle.
the class NodeLLVMBuilder method visitLoopEnd.
@Override
public void visitLoopEnd(LoopEndNode i) {
LLVMBasicBlockRef[] basicBlocks = new LLVMBasicBlockRef[] { gen.getBlockEnd((Block) gen.getCurrentBlock()) };
assert gen.getCurrentBlock().getSuccessorCount() == 1;
for (SpecialRegister reg : SpecialRegister.registers()) {
Block successor = ((Block) gen.getCurrentBlock()).getFirstSuccessor();
LLVMValueRef phi = gen.getInitialSpecialRegisterValue(reg, successor);
assert LLVM.LLVMGetInstructionOpcode(phi) == LLVM.LLVMPHI;
builder.addIncoming(phi, new LLVMValueRef[] { gen.getSpecialRegisterValue(reg) }, basicBlocks);
}
for (ValuePhiNode phiNode : i.merge().valuePhis()) {
LLVMValueRef phi = backwardsPhi.get(phiNode);
LLVMValueRef value = llvmOperand(phiNode.valueAt(i));
LLVMValueRef[] values = new LLVMValueRef[] { value };
builder.addIncoming(phi, values, basicBlocks);
}
}
use of com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMValueRef in project graal by oracle.
the class NodeLLVMBuilder method emitCallInstruction.
private LLVMValueRef emitCallInstruction(Invoke invoke, boolean nativeABI, LLVMValueRef callee, long patchpointId, LLVMValueRef... args) {
LLVMValueRef call;
if (invoke instanceof InvokeWithExceptionNode) {
InvokeWithExceptionNode invokeWithExceptionNode = (InvokeWithExceptionNode) invoke;
LLVMBasicBlockRef successor = gen.getBlock(invokeWithExceptionNode.next());
LLVMBasicBlockRef handler = gen.getBlock(invokeWithExceptionNode.exceptionEdge());
call = gen.buildStatepointInvoke(callee, nativeABI, successor, handler, patchpointId, args);
} else {
call = gen.buildStatepointCall(callee, nativeABI, patchpointId, args);
}
return call;
}
use of com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMValueRef in project graal by oracle.
the class LLVMIRBuilder method buildLoad.
public LLVMValueRef buildLoad(LLVMValueRef address, LLVMTypeRef type) {
LLVMTypeRef addressType = LLVM.LLVMTypeOf(address);
if (isObjectType(type) && !isObjectType(addressType)) {
boolean compressed = isCompressedPointerType(type);
return buildCall(helpers.getLoadObjectFromUntrackedPointerFunction(compressed), address);
}
LLVMValueRef castedAddress = buildBitcast(address, pointerType(type, isObjectType(addressType), false));
return buildLoad(castedAddress);
}
use of com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMValueRef in project graal by oracle.
the class LLVMIRBuilder method getExternalSymbol.
public LLVMValueRef getExternalSymbol(String name) {
LLVMValueRef val = getGlobal(name);
if (val == null) {
val = LLVM.LLVMAddGlobalInAddressSpace(module, rawPointerType(), name, UNTRACKED_POINTER_ADDRESS_SPACE);
setLinkage(val, LinkageType.External);
}
return val;
}
use of com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMValueRef in project graal by oracle.
the class LLVMIRBuilder method buildStackmap.
public void buildStackmap(LLVMValueRef patchpointId, LLVMValueRef... liveValues) {
LLVMTypeRef stackmapType = functionType(voidType(), true, longType(), intType());
LLVMValueRef[] allArgs = new LLVMValueRef[2 + liveValues.length];
allArgs[0] = patchpointId;
allArgs[1] = constantInt(0);
System.arraycopy(liveValues, 0, allArgs, 2, liveValues.length);
buildIntrinsicCall("llvm.experimental.stackmap", stackmapType, allArgs);
}
Aggregations