mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
C++: IR: InstructionSanity::duplicateOperand perf
The `InstructionSanity::duplicateOperand` predicate used `count` instead of `strictcount`. The 0-case of this `count` was as large as the Cartesian product of `Instruction` and `OperandTag`, which made `duplicateOperand` take forever to compute on large snapshots.
This commit is contained in:
@@ -63,7 +63,7 @@ module InstructionSanity {
|
||||
* Holds if instruction `instr` has multiple operands with tag `tag`.
|
||||
*/
|
||||
query predicate duplicateOperand(Instruction instr, OperandTag tag) {
|
||||
count(instr.getOperand(tag)) > 1 and
|
||||
strictcount(instr.getOperand(tag)) > 1 and
|
||||
not tag instanceof UnmodeledUseOperand
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ module InstructionSanity {
|
||||
* Holds if instruction `instr` has multiple operands with tag `tag`.
|
||||
*/
|
||||
query predicate duplicateOperand(Instruction instr, OperandTag tag) {
|
||||
count(instr.getOperand(tag)) > 1 and
|
||||
strictcount(instr.getOperand(tag)) > 1 and
|
||||
not tag instanceof UnmodeledUseOperand
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ module InstructionSanity {
|
||||
* Holds if instruction `instr` has multiple operands with tag `tag`.
|
||||
*/
|
||||
query predicate duplicateOperand(Instruction instr, OperandTag tag) {
|
||||
count(instr.getOperand(tag)) > 1 and
|
||||
strictcount(instr.getOperand(tag)) > 1 and
|
||||
not tag instanceof UnmodeledUseOperand
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user