SDValue val1 = builder->createConstant(llvm::APInt(32, 42), *VT); SDValue val2 = builder->createConstant(llvm::APInt(32, 10), *VT); SDValue add = builder->getNode(ISD::ADD, SDLoc(), *VT, val1, val2);
SDValue val1 = DAG.getLoad(*VT, dl, Base, Offset, nullptr, 0); SDValue val2 = DAG.createConstant(llvm::APInt(32, 5)); SDValue mul = DAG.getNode(ISD::MUL, dl, *VT, val1, val2);In this example, SDValues are used to store a load instruction and a multiplication operation in a graph. The `getLoad` method creates an SDValue that represents a load instruction from a memory location. The `getNode` method creates an SDValue that represents the multiplication operation between the loaded value and a constant value. Package/library: LLVM's SelectionDAG library