C++:/C# Remove opcode from TRawInstruction

This commit is contained in:
Dave Bartolomeo
2020-06-12 17:36:01 -04:00
parent 978275cbd4
commit 73d2e09a8d
3 changed files with 12 additions and 9 deletions

View File

@@ -15,10 +15,10 @@ private import Imports::Opcode
cached
newtype TInstruction =
TRawInstruction(
Opcode opcode, IRConstruction::Raw::InstructionTag1 tag1,
IRConstruction::Raw::InstructionTag1 tag1,
IRConstruction::Raw::InstructionTag2 tag2
) {
IRConstruction::Raw::hasInstruction(opcode, tag1, tag2)
IRConstruction::Raw::hasInstruction(tag1, tag2)
} or
TUnaliasedSSAPhiInstruction(
TRawInstruction blockStartInstr,

View File

@@ -15,11 +15,11 @@ private import TranslatedStmt
private import TranslatedFunction
TranslatedElement getInstructionTranslatedElement(Instruction instruction) {
instruction = TRawInstruction(_, result, _)
instruction = TRawInstruction(result, _)
}
InstructionTag getInstructionTag(Instruction instruction) {
instruction = TRawInstruction(_, _, result)
instruction = TRawInstruction(_, result)
}
pragma[noinline]
@@ -44,8 +44,8 @@ module Raw {
predicate functionHasIR(Function func) { exists(getTranslatedFunction(func)) }
cached
predicate hasInstruction(Opcode opcode, TranslatedElement element, InstructionTag tag) {
element.hasInstruction(opcode, tag, _)
predicate hasInstruction(TranslatedElement element, InstructionTag tag) {
element.hasInstruction(_, tag, _)
}
cached
@@ -379,7 +379,10 @@ private module Cached {
cached
Opcode getInstructionOpcode(TStageInstruction instr) {
instr = TRawInstruction(result, _, _)
exists(TranslatedElement element, InstructionTag tag |
instructionOrigin(instr, element, tag) and
element.hasInstruction(result, tag, _)
)
}
cached