C++: Remove the IRFunction column from the TUniqueValueNumber branch. The next commits will protect the recursion from instructions which has multiple IRFunctions and assign such instructions a unique value number so it won't make sense for them to have an IRFunction column.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-09-04 18:49:09 +01:00
parent c5e5b8a585
commit 76f2c6a9f1

View File

@@ -41,7 +41,7 @@ newtype TValueNumber =
) {
loadTotalOverlapValueNumber(_, irFunc, type, memOperand, operand)
} or
TUniqueValueNumber(IRFunction irFunc, Instruction instr) { uniqueValueNumber(instr, irFunc) }
TUniqueValueNumber(Instruction instr) { uniqueValueNumber(instr) }
/**
* A `ConvertInstruction` which converts data of type `T` to data of type `U`
@@ -277,8 +277,7 @@ private predicate loadTotalOverlapValueNumber(
* Holds if `instr` should be assigned a unique value number because this library does not know how
* to determine if two instances of that instruction are equivalent.
*/
private predicate uniqueValueNumber(Instruction instr, IRFunction irFunc) {
instr.getEnclosingIRFunction() = irFunc and
private predicate uniqueValueNumber(Instruction instr) {
not instr.getResultIRType() instanceof IRVoidType and
(
not numberableInstruction(instr)
@@ -294,10 +293,8 @@ cached
TValueNumber tvalueNumber(Instruction instr) {
result = nonUniqueValueNumber(instr)
or
exists(IRFunction irFunc |
uniqueValueNumber(instr, irFunc) and
result = TUniqueValueNumber(irFunc, instr)
)
uniqueValueNumber(instr) and
result = TUniqueValueNumber(instr)
}
/**