ScEpTIC.AST.elements.instructions package
Submodules
ScEpTIC.AST.elements.instructions.binary_operation module
- class ScEpTIC.AST.elements.instructions.binary_operation.BinaryOperation(operation_type, first_operand, second_operand, target, is_bitwise, specific_attributes)
Bases:
Instruction
AST nodes for the LLVM Binary Instructions group https://llvm.org/docs/LangRef.html#binaryops
NB: each result is stored as SIGNED int, even if the operation is unsigned. The sign bit is an interpretation of UNSIGNED operations, which will manage that by converting the int to its unsigned equivalent.
- get_input_lookup()
Returns the input lookup data for the current operation
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- get_val()
Returns the value obtained from the operation. It converts address operands (if present) to relative spaces, applies the operation and converts them back to the absolute space.
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- resolve_memory_address_chain(elements)
Returns a list of all the instructions required to get the address of the targeted element(s)
- resolve_memory_tag(elements)
Resolves and returns the memory tag of the targeted element
- resolve_memory_tag_dependency(elements)
ScEpTIC.AST.elements.instructions.conversion module
- class ScEpTIC.AST.elements.instructions.conversion.ConversionOperation(conversion_type, operand, target_type, target)
Bases:
Instruction
AST nodes for the LLVM Bitwise Instructions group https://llvm.org/docs/LangRef.html#bitwiseops
- get_input_lookup()
Returns the input lookup data for the current operation
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- get_val()
Returns the value obtained from the operation. It converts address operands (if present) to relative spaces, applies the operation and converts them back to the absolute space.
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- resolve_memory_address_chain(elements)
Returns a list of all the instructions required to get the address of the targeted element(s)
- resolve_memory_tag(elements)
Resolves and returns the memory tag of the targeted element
- resolve_memory_tag_dependency(elements)
ScEpTIC.AST.elements.instructions.memory_operations module
- class ScEpTIC.AST.elements.instructions.memory_operations.AllocaOperation(target, element_type, elements_number, align)
Bases:
Instruction
AST node of the LLVM Memory Instructions group - Alloca Instruction https://llvm.org/docs/LangRef.html#memoryops
- get_ignore()
Returns a list of register names to be ignored by register allocation. For alloca operation it is the target register.
- get_input_lookup()
Returns the input lookup data for the current operation
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- resolve_memory_address_chain(elements)
Returns a list of all the instructions required to get the address of the targeted element(s)
- resolve_memory_tag(elements)
Resolves and returns the memory tag of the targeted element
- resolve_memory_tag_dependency(elements)
- run(update_program_counter=True)
Executes the operation and the target assignment. (Update program counter ignored -> always True)
- class ScEpTIC.AST.elements.instructions.memory_operations.GetElementPointerOperation(target, element, base_type, indexes, inbounds)
Bases:
Instruction
AST node of the LLVM Memory Instructions group - GetElementPointer Instruction https://llvm.org/docs/LangRef.html#memoryops
- get_input_lookup()
Returns the input lookup data for the current operation
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- get_val()
Returns the represented absolute address.
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- resolve_memory_address_chain(elements)
Returns a list of all the instructions required to get the address of the targeted element(s)
- resolve_memory_tag(elements)
Resolves and returns the memory tag of the targeted element
- resolve_memory_tag_dependency(elements)
- class ScEpTIC.AST.elements.instructions.memory_operations.LoadOperation(target, load_type, element, align, volatile)
Bases:
Instruction
AST node of the LLVM Memory Instructions group - Load Instruction https://llvm.org/docs/LangRef.html#memoryops
- get_ignore()
Returns a list of register names to be ignored by register allocation. For load operation it is the target register, if the load operation is marked to be used as argument of a function call, since it will be loaded as a stack offset.
- get_input_lookup()
Returns the input lookup data for the current operation
- get_load_address()
Returns the address to be loaded.
- get_memory_address()
- Returns:
the address of the targeted memory cell
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- get_val()
Executes the operation and the target assignment.
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- resolve_memory_address_chain(elements)
Returns a list of all the instructions required to get the address of the targeted element(s)
- resolve_memory_tag(elements)
Resolves and returns the memory tag of the targeted element
- resolve_memory_tag_dependency(elements)
- run(update_program_counter=True)
Executes the load operation and the target assignment. (Update program counter ignored -> always True)
- class ScEpTIC.AST.elements.instructions.memory_operations.StoreOperation(target, value, align, volatile)
Bases:
Instruction
AST node of the LLVM Memory Instructions group - Store Instruction https://llvm.org/docs/LangRef.html#memoryops
- get_defs()
Returns a list of registers defined by this instruction. (used by register allocation)
- get_memory_address()
- Returns:
the target address of the store
- get_store_address()
Returns the address in which the value will be stored.
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- resolve_memory_address_chain(elements)
Returns a list of all the instructions required to get the address of the targeted element(s)
- resolve_memory_tag(elements)
Resolves and returns the memory tag of the targeted element
- resolve_memory_tag_dependency(elements)
- run(update_program_counter=True)
Executes the operation and the target assignment. (Update program counter ignored -> always True)
ScEpTIC.AST.elements.instructions.other_operations module
- class ScEpTIC.AST.elements.instructions.other_operations.CallOperation(target, function_name, return_type, function_signature, function_args, attrs)
Bases:
Instruction
AST node of the LLVM Other Instructions group - Call Instruction https://llvm.org/docs/LangRef.html#otherops
- get_function_max_reg_usage()
Returns the number of physical registers used by this function.
- get_type_from_virtual_reg(virtual_reg)
Returns the type of an argument given its virtual register name.
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- ignore = []
- memory_tick_count = 2
- n_memory_instructions = 2
- property name
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- resolve_function_name()
- run(update_program_counter=True)
Runs the call operation. (Update program counter ignored -> always True)
- tick_count = 4
- class ScEpTIC.AST.elements.instructions.other_operations.CompareOperation(target, first_operand, second_operand, condition, comparation_type, operation_code)
Bases:
Instruction
AST node of the LLVM Other Instructions group - Compare Instruction https://llvm.org/docs/LangRef.html#otherops
- get_input_lookup()
Returns the input lookup data for the current operation
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- get_val()
Returns the value obtained from the operation. It converts address operands (if present) to relative spaces, and applies the comparisons.
- static is_one_qnan(value1, value2)
Returns if at least one of two values are QNAN
- static is_qnan(value)
Returns if a value is a QNAN
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- class ScEpTIC.AST.elements.instructions.other_operations.PhiOperation(target, return_type, values)
Bases:
Instruction
AST node of the LLVM Other Instructions group - Phi Instruction https://llvm.org/docs/LangRef.html#otherops
- get_input_lookup()
Returns the input lookup data for the current operation
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- get_val()
Returns the value obtained from the operation.
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- class ScEpTIC.AST.elements.instructions.other_operations.SelectOperation(target, condition, first_operand, second_operand)
Bases:
Instruction
AST node of the LLVM Other Instructions group - Select Instruction https://llvm.org/docs/LangRef.html#otherops
- get_input_lookup()
Returns the input lookup data for the current operation
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- get_val()
Returns the result of the operation.
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- class ScEpTIC.AST.elements.instructions.other_operations.VaArgOperation(target, element, arg_type)
Bases:
Instruction
AST node of the LLVM Other Instructions group - VaArg Instruction NOT SUPPORTED IN ScEpTIC https://llvm.org/docs/LangRef.html#otherops
- run(update_program_counter=True)
Executes the operation and the target assignment.
ScEpTIC.AST.elements.instructions.termination_instructions module
- class ScEpTIC.AST.elements.instructions.termination_instructions.BranchOperation(condition, target_true, target_false)
Bases:
Instruction
AST node of the LLVM Termination Instructions group - Branch Instruction https://llvm.org/docs/LangRef.html#terminators
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- run(update_program_counter=True)
Executes the branch operation. (Update program counter ignored -> always True)
- class ScEpTIC.AST.elements.instructions.termination_instructions.ReturnOperation(value)
Bases:
Instruction
AST node of the LLVM Termination Instructions group - Return Instruction https://llvm.org/docs/LangRef.html#terminators
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- memory_tick_count = 2
- n_memory_instructions = 2
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- run(update_program_counter=True)
Retrieves the value of the return operation and calls the return’s callback. (Update program counter ignored -> always True)
- tick_count = 6
- class ScEpTIC.AST.elements.instructions.termination_instructions.SwitchOperation(element, default_label, switch_pairs)
Bases:
Instruction
AST node of the LLVM Termination Instructions group - Switch Instruction https://llvm.org/docs/LangRef.html#terminators
- get_uses()
Returns a list containing the names of the registers used by this instruction. (used by register allocation)
- replace_reg_name(old_reg_name, new_reg_name)
Replaces the name of a register used by the instruction with a new one. (used by register allocation)
- run(update_program_counter=True)
Executes the switch operation. (Update program counter ignored -> always True)