Commit Graph

3327 Commits

Author SHA1 Message Date
Jeroen Ketema
68ec4b66e7 C++: Fix join-order problem found on IncorrectCheckScanf.ql
Before on `silentearth/curl2`:

```
Evaluated recursive predicate IRGuards::Cached::unary_compares_eq/5#7aa979d8@e3b01fca in 26109ms on iteration 2 (delta size: 4020).
Evaluated relational algebra for predicate IRGuards::Cached::unary_compares_eq/5#7aa979d8@e3b01fca on iteration 2 running pipeline standard with tuple counts:
                 0   ~0%    {5} r1 = JOIN `IRGuards::Cached::unary_compares_eq/5#7aa979d8#prev_delta` WITH `IRGuards::Cached::BuiltinExpectCallValueNumber.getCondition/0#dispred#9b2b5da2_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4

           1835651   ~2%    {5} r2 = SCAN `IRGuards::Cached::unary_compares_eq/5#7aa979d8#prev_delta` OUTPUT In.4, In.0, In.1, In.2, In.3
           1832833   ~0%    {5}    | JOIN WITH `IRGuards::AbstractValue.getDualValue/0#dispred#bfb2631d` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
              3996   ~0%    {5}    | JOIN WITH `IRGuards::Cached::LogicalNotValueNumber.getUnary/0#dispred#b2251f1f_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4

           1835651   ~7%    {5} r3 = SCAN `IRGuards::Cached::unary_compares_eq/5#7aa979d8#prev_delta` OUTPUT In.1, In.0, In.2, In.3, In.4
           1835651   ~1%    {5}    | JOIN WITH `Operand::Operand.getAnyDef/0#dispred#8dbe2fb8` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4

                 0   ~0%    {5} r4 = JOIN r3 WITH project#Instruction::PointerSubInstruction#0d109780 ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4
                 0   ~0%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getLeftOperand/0#dispred#c8432d08` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
                 0   ~0%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getRight/0#dispred#1f78e436` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
                 0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
                 0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 + In.6) KEEPING 5

                23  ~76%    {5} r5 = JOIN r3 WITH Instruction::SubInstruction#fc619901 ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4
                22  ~56%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getLeftOperand/0#dispred#c8432d08` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
                22  ~56%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getRight/0#dispred#1f78e436` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
                 0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
                 0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 + In.6) KEEPING 5

                 0   ~0%    {5} r6 = JOIN r3 WITH project#Instruction::PointerAddInstruction#5233892c ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4

                 0   ~0%    {6} r7 = JOIN r6 WITH `Instruction::BinaryInstruction.getLeftOperand/0#dispred#c8432d08` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
                 0   ~0%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getRight/0#dispred#1f78e436` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
                 0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
                 0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 - In.6) KEEPING 5

                 0   ~0%    {6} r8 = JOIN r6 WITH `Instruction::BinaryInstruction.getRightOperand/0#dispred#9ca710da` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
                 0   ~0%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getLeft/0#dispred#5cf78406` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
                 0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
                 0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 - In.6) KEEPING 5

                12  ~49%    {5} r9 = JOIN r3 WITH Instruction::AddInstruction#7f8fb455 ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4

                12  ~49%    {6} r10 = JOIN r9 WITH `Instruction::BinaryInstruction.getLeftOperand/0#dispred#c8432d08` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
                12  ~71%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getRight/0#dispred#1f78e436` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
                 0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
                 0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 - In.6) KEEPING 5

                12  ~49%    {6} r11 = JOIN r9 WITH `Instruction::BinaryInstruction.getRightOperand/0#dispred#9ca710da` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
                12  ~49%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getLeft/0#dispred#5cf78406` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
                 0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
                 0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 - In.6) KEEPING 5

                 0   ~0%    {5} r12 = JOIN r1 WITH `IRGuards::Cached::BuiltinExpectCallValueNumber.getAUse/0#dispred#23233591` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4
                 0   ~0%    {6}    | JOIN WITH `IRGuards::Cached::CompareValueNumber.hasOperands/2#dispred#7aa36763_102#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.2

                 0   ~0%    {6} r13 = JOIN r12 WITH project#IRGuards::Cached::CompareNEValueNumber#1aeec1bd ON FIRST 1 OUTPUT Lhs.5, Lhs.1, Lhs.2, Lhs.3, Lhs.0, Lhs.4

                 0   ~0%    {6} r14 = JOIN r12 WITH project#IRGuards::Cached::CompareEQValueNumber#994b6833 ON FIRST 1 OUTPUT Lhs.4, Lhs.1, Lhs.2, Lhs.3, Lhs.0, Lhs.5
                 0   ~0%    {6}    | JOIN WITH `IRGuards::AbstractValue.getDualValue/0#dispred#bfb2631d_10#join_rhs` ON FIRST 1 OUTPUT Lhs.5, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1

                 0   ~0%    {6} r15 = r13 UNION r14
                 0   ~0%    {7}    | JOIN WITH `Operand::Operand.getAnyDef/0#dispred#8dbe2fb8` ON FIRST 1 OUTPUT Rhs.1, _, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
                 0   ~0%    {7}    | REWRITE WITH Out.1 := 0
                 0   ~0%    {5}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 2 OUTPUT Lhs.5, Lhs.2, Lhs.3, Lhs.4, Lhs.6

        1901910478   ~1%    {5} r16 = JOIN `IRGuards::Cached::unary_compares_eq/5#7aa979d8#prev_delta` WITH `ValueNumberingInternal::tvalueNumber/1#f03b58f9_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4
        1902015678   ~4%    {5}    | JOIN WITH `Operand::Operand.getDef/0#dispred#a70e8079_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4
        1902015678   ~3%    {6}    | JOIN WITH `Operand::Operand.getDef/0#dispred#a70e8079` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.0
        1901976207   ~4%    {5}    | JOIN WITH `IRGuards::Cached::isConvertedBool/1#9a130da2` ON FIRST 1 OUTPUT Lhs.5, Lhs.1, Lhs.2, Lhs.3, Lhs.4
                74  ~10%    {6}    | JOIN WITH `IRGuards::Cached::CompareValueNumber.hasOperands/2#dispred#7aa36763_102#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.2

                54  ~10%    {6} r17 = JOIN r16 WITH project#IRGuards::Cached::CompareNEValueNumber#1aeec1bd ON FIRST 1 OUTPUT Lhs.5, Lhs.1, Lhs.2, Lhs.3, Lhs.0, Lhs.4

                20   ~0%    {6} r18 = JOIN r16 WITH project#IRGuards::Cached::CompareEQValueNumber#994b6833 ON FIRST 1 OUTPUT Lhs.4, Lhs.1, Lhs.2, Lhs.3, Lhs.0, Lhs.5
                20   ~0%    {6}    | JOIN WITH `IRGuards::AbstractValue.getDualValue/0#dispred#bfb2631d` ON FIRST 1 OUTPUT Lhs.5, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1

                74   ~5%    {6} r19 = r17 UNION r18
                74   ~5%    {7}    | JOIN WITH `Operand::Operand.getDef/0#dispred#a70e8079` ON FIRST 1 OUTPUT Rhs.1, _, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
                74   ~4%    {7}    | REWRITE WITH Out.1 := 0
                66   ~0%    {5}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 2 OUTPUT Lhs.5, Lhs.2, Lhs.3, Lhs.4, Lhs.6

              4062   ~0%    {5} r20 = r1 UNION r2 UNION r4 UNION r5 UNION r7 UNION r8 UNION r10 UNION r11 UNION r15 UNION r19
              4020   ~0%    {5}    | AND NOT `IRGuards::Cached::unary_compares_eq/5#7aa979d8#prev`(FIRST 5)
                            return r20
```

After:
```
[2025-01-22 14:50:44] Evaluated non-recursive predicate _IRGuards::Cached::CompareValueNumber.hasOperands/2#dispred#7aa36763_102#join_rhs_IRGuards::Cached::__#join_rhs@25668753 in 36ms (size: 47).
Evaluated relational algebra for predicate _IRGuards::Cached::CompareValueNumber.hasOperands/2#dispred#7aa36763_102#join_rhs_IRGuards::Cached::__#join_rhs@25668753 with tuple counts:
        285951  ~0%    {4} r1 = JOIN `IRGuards::Cached::CompareValueNumber.hasOperands/2#dispred#7aa36763_102#join_rhs` WITH `Operand::Operand.getDef/0#dispred#a70e8079` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0, Lhs.2
            47  ~2%    {3}    | JOIN WITH `IRGuards::Cached::isConvertedBool/1#9a130da2` ON FIRST 1 OUTPUT Lhs.2, Lhs.1, Lhs.3
            47  ~0%    {3}    | JOIN WITH `Operand::Operand.getDef/0#dispred#a70e8079` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
            47  ~0%    {3}    | JOIN WITH `ValueNumberingInternal::tvalueNumber/1#f03b58f9` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
                       return r1
                       Evaluated recursive predicate IRGuards::Cached::unary_compares_eq/5#7aa979d8@a808bbfb in 63ms on iteration 2 (delta size: 4020).
Evaluated relational algebra for predicate IRGuards::Cached::unary_compares_eq/5#7aa979d8@a808bbfb on iteration 2 running pipeline standard with tuple counts:
              0   ~0%    {5} r1 = JOIN `IRGuards::Cached::unary_compares_eq/5#7aa979d8#prev_delta` WITH `IRGuards::Cached::BuiltinExpectCallValueNumber.getCondition/0#dispred#9b2b5da2_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4

        1881864  ~10%    {5} r2 = SCAN `IRGuards::Cached::unary_compares_eq/5#7aa979d8#prev_delta` OUTPUT In.4, In.0, In.1, In.2, In.3
        1879046   ~4%    {5}    | JOIN WITH `IRGuards::AbstractValue.getDualValue/0#dispred#bfb2631d` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
           3986   ~0%    {5}    | JOIN WITH `IRGuards::Cached::LogicalNotValueNumber.getUnary/0#dispred#b2251f1f_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4

        1881864  ~11%    {5} r3 = SCAN `IRGuards::Cached::unary_compares_eq/5#7aa979d8#prev_delta` OUTPUT In.1, In.0, In.2, In.3, In.4
        1881864   ~2%    {5}    | JOIN WITH `Operand::Operand.getAnyDef/0#dispred#8dbe2fb8` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4

              0   ~0%    {5} r4 = JOIN r3 WITH project#Instruction::PointerSubInstruction#0d109780 ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4
              0   ~0%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getLeftOperand/0#dispred#c8432d08` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
              0   ~0%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getRight/0#dispred#1f78e436` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
              0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
              0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 + In.6) KEEPING 5

             16  ~14%    {5} r5 = JOIN r3 WITH Instruction::SubInstruction#fc619901 ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4
             16  ~14%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getLeftOperand/0#dispred#c8432d08` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
             16  ~14%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getRight/0#dispred#1f78e436` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
              0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
              0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 + In.6) KEEPING 5

              0   ~0%    {5} r6 = JOIN r3 WITH project#Instruction::PointerAddInstruction#5233892c ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4

              0   ~0%    {6} r7 = JOIN r6 WITH `Instruction::BinaryInstruction.getLeftOperand/0#dispred#c8432d08` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
              0   ~0%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getRight/0#dispred#1f78e436` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
              0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
              0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 - In.6) KEEPING 5

              0   ~0%    {6} r8 = JOIN r6 WITH `Instruction::BinaryInstruction.getRightOperand/0#dispred#9ca710da` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
              0   ~0%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getLeft/0#dispred#5cf78406` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
              0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
              0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 - In.6) KEEPING 5

              8   ~0%    {5} r9 = JOIN r3 WITH Instruction::AddInstruction#7f8fb455 ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4

              8   ~0%    {6} r10 = JOIN r9 WITH `Instruction::BinaryInstruction.getLeftOperand/0#dispred#c8432d08` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
              8   ~0%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getRight/0#dispred#1f78e436` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
              0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
              0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 - In.6) KEEPING 5

              8   ~0%    {6} r11 = JOIN r9 WITH `Instruction::BinaryInstruction.getRightOperand/0#dispred#9ca710da` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1
              8   ~0%    {6}    | JOIN WITH `Instruction::BinaryInstruction.getLeft/0#dispred#5cf78406` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
              0   ~0%    {7}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 1 OUTPUT Lhs.1, Lhs.5, _, Lhs.3, Lhs.4, Lhs.2, Rhs.1
              0   ~0%    {5}    | REWRITE WITH Out.2 := (In.5 - In.6) KEEPING 5

             70   ~6%    {6} r12 = JOIN `IRGuards::Cached::unary_compares_eq/5#7aa979d8#prev_delta` WITH `_IRGuards::Cached::CompareValueNumber.hasOperands/2#dispred#7aa36763_102#join_rhs_IRGuards::Cached::__#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Rhs.2, Lhs.1, Lhs.2, Lhs.3, Lhs.4

             50   ~2%    {6} r13 = JOIN r12 WITH project#IRGuards::Cached::CompareNEValueNumber#1aeec1bd ON FIRST 1 OUTPUT Lhs.1, Lhs.0, Lhs.2, Lhs.3, Lhs.4, Lhs.5

             20   ~0%    {6} r14 = JOIN r12 WITH project#IRGuards::Cached::CompareEQValueNumber#994b6833 ON FIRST 1 OUTPUT Lhs.5, Lhs.0, Lhs.1, Lhs.2, Lhs.3, Lhs.4
             20   ~0%    {6}    | JOIN WITH `IRGuards::AbstractValue.getDualValue/0#dispred#bfb2631d` ON FIRST 1 OUTPUT Lhs.2, Lhs.1, Lhs.3, Lhs.4, Lhs.5, Rhs.1

             70   ~0%    {6} r15 = r13 UNION r14
             70   ~1%    {7}    | JOIN WITH `Operand::Operand.getDef/0#dispred#a70e8079` ON FIRST 1 OUTPUT Rhs.1, _, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
             70   ~0%    {7}    | REWRITE WITH Out.1 := 0
             66   ~2%    {5}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 2 OUTPUT Lhs.2, Lhs.3, Lhs.4, Lhs.5, Lhs.6

              0   ~0%    {5} r16 = JOIN r1 WITH `IRGuards::Cached::BuiltinExpectCallValueNumber.getAUse/0#dispred#23233591` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4
              0   ~0%    {6}    | JOIN WITH `IRGuards::Cached::CompareValueNumber.hasOperands/2#dispred#7aa36763_102#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.2

              0   ~0%    {6} r17 = JOIN r16 WITH project#IRGuards::Cached::CompareNEValueNumber#1aeec1bd ON FIRST 1 OUTPUT Lhs.5, Lhs.1, Lhs.2, Lhs.3, Lhs.0, Lhs.4

              0   ~0%    {6} r18 = JOIN r16 WITH project#IRGuards::Cached::CompareEQValueNumber#994b6833 ON FIRST 1 OUTPUT Lhs.4, Lhs.1, Lhs.2, Lhs.3, Lhs.0, Lhs.5
              0   ~0%    {6}    | JOIN WITH `IRGuards::AbstractValue.getDualValue/0#dispred#bfb2631d_10#join_rhs` ON FIRST 1 OUTPUT Lhs.5, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1

              0   ~0%    {6} r19 = r17 UNION r18
              0   ~0%    {7}    | JOIN WITH `Operand::Operand.getAnyDef/0#dispred#8dbe2fb8` ON FIRST 1 OUTPUT Rhs.1, _, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.5
              0   ~0%    {7}    | REWRITE WITH Out.1 := 0
              0   ~0%    {5}    | JOIN WITH `IRGuards::Cached::int_value/1#f9d7a458` ON FIRST 2 OUTPUT Lhs.5, Lhs.2, Lhs.3, Lhs.4, Lhs.6

           4052   ~1%    {5} r20 = r1 UNION r2 UNION r4 UNION r5 UNION r7 UNION r8 UNION r10 UNION r11 UNION r15 UNION r19
           4020   ~1%    {5}    | AND NOT `IRGuards::Cached::unary_compares_eq/5#7aa979d8#prev`(FIRST 5)
                         return r20
```
2025-01-22 14:54:24 +01:00
Mathias Vorreiter Pedersen
12666848c0 C++: Fix conflation in 'Pure' models. 2025-01-21 20:43:53 +00:00
Jeroen Ketema
442dad4ff9 C++: Update PreprocBlock.qll QLDoc and add C++23 test 2025-01-21 18:02:28 +01:00
Jeroen Ketema
ac18e7494f C++: Update stats file 2025-01-21 16:14:29 +01:00
Jeroen Ketema
32ff8dc0f6 C++: Add upgrade and downgrade scripts 2025-01-21 16:14:27 +01:00
Jeroen Ketema
e0acf262d5 C++: Add change note 2025-01-21 16:14:18 +01:00
Jeroen Ketema
9fd95381dc C++: Support #elifdef #elifndef, and MSVC's #import 2025-01-21 16:14:16 +01:00
github-actions[bot]
ebe9088458 Post-release preparation for codeql-cli-2.20.2 2025-01-21 13:58:45 +00:00
Chris Smowton
9fa1ad9d8d Fix changelog typos 2025-01-21 13:58:44 +00:00
github-actions[bot]
f21784db9d Release preparation for version 2.20.2 2025-01-21 13:58:43 +00:00
Chris Smowton
fb140404b6 Revert "Release preparation for version 2.20.2" 2025-01-21 13:58:38 +00:00
github-actions[bot]
fbb7f0a0c6 Post-release preparation for codeql-cli-2.20.2 2025-01-20 21:11:14 +00:00
github-actions[bot]
a0512a50f2 Release preparation for version 2.20.2 2025-01-20 21:11:12 +00:00
Mathias Vorreiter Pedersen
ed651294b6 Merge branch 'main' into remove-conflation-from-out-nodes 2025-01-20 12:42:26 +00:00
Jeroen Ketema
4b85ea3bc6 Merge pull request #18502 from jketema/consteval
C++: Support `if consteval` and `if ! consteval`
2025-01-20 12:49:02 +01:00
Jeroen Ketema
a9e0f20861 C++: Simplify consteval if to be just a single class with an isNot predicate 2025-01-20 11:20:11 +01:00
Jeroen Ketema
a74189f6fa Update cpp/ql/lib/change-notes/2024-01-16-consteval-if.md
Co-authored-by: Calum Grant <42069085+calumgrant@users.noreply.github.com>
2025-01-20 10:43:25 +01:00
Mathias Vorreiter Pedersen
d1bb5970ce Merge branch 'main' into remove-conflation-from-out-nodes 2025-01-18 18:05:22 +00:00
Mathias Vorreiter Pedersen
2448475141 C++: Ensure that 'argumentOf' does not map to multiple argument positions. 2025-01-18 02:11:50 +00:00
Mathias Vorreiter Pedersen
5c494c3f66 C++: Infer 'b1 = true' and 'b2 = true' from 'b1 && b2 = true', and infer 'b1 = false' and 'b2 = false' from 'b1 || b2 = false'. 2025-01-17 13:07:41 +00:00
Mathias Vorreiter Pedersen
d8ec6dd155 Merge pull request #18490 from MathiasVP/generate-int-to-bool-conversion-instructions-2
C++: Generate int-to-bool conversions in C code
2025-01-17 12:57:55 +00:00
Mathias Vorreiter Pedersen
21f9e6763d C++: Remove an unnecessary conjunct. 2025-01-17 12:44:22 +00:00
Mathias Vorreiter Pedersen
b39a932ae1 C++: Update comment in the char pred of 'GuardConditionFromNotExpr'. 2025-01-17 12:17:47 +00:00
Jeroen Ketema
ff0d4955cf C++: Fix change note 2025-01-16 17:55:45 +01:00
Mathias Vorreiter Pedersen
d0bd6eb2eb C++: Remove the type restriction on 'GuardConditionFromNotExpr' since this class also applies to C++. 2025-01-16 16:55:10 +00:00
Jeroen Ketema
52eef7c4c2 C++: Fix typo in test 2025-01-16 13:19:54 +01:00
Jeroen Ketema
d027e0c06b C++: Add change note 2025-01-16 13:12:20 +01:00
Jeroen Ketema
bd40d249e3 C++: Support more "noreturn" attributes in DefaultOptions 2025-01-16 13:04:44 +01:00
Jeroen Ketema
6ad342c567 C++: Add change note 2025-01-16 10:22:54 +01:00
Jeroen Ketema
4a3350bd41 C++: Update stats file 2025-01-16 08:18:09 +01:00
Jeroen Ketema
123f1d599a C++: Add upgrade and downgrade scripts 2025-01-16 08:18:07 +01:00
Jeroen Ketema
bc2f203c4b C++: Support if consteval and if ! consteval 2025-01-16 08:17:57 +01:00
Mathias Vorreiter Pedersen
5373e2222e C++: Improve IRGuads logic for 'unlikely' expressions. 2025-01-16 00:45:07 +00:00
Mathias Vorreiter Pedersen
14db788125 C++: Ensure that 'x' in 'if(!x) is also an AST-based GuardCondition. 2025-01-16 00:39:37 +00:00
Mathias Vorreiter Pedersen
2d9036eb5f C++: Make 'getInstructionConvertedResultExpression' equivalent in C and C++. 2025-01-16 00:39:35 +00:00
Mathias Vorreiter Pedersen
ebb7f28d39 C++: Remove workaround for missing comparisons against 0 in C code. 2025-01-16 00:39:33 +00:00
Mathias Vorreiter Pedersen
9810a4f34d C++: Remove 'inNonZeroCase' from IRGuards since we now always have implicit comparisons against 0 in C code. 2025-01-16 00:39:32 +00:00
Mathias Vorreiter Pedersen
65771614ef C++: Insert int-to-bool conversions at binary conditional expressions. 2025-01-16 00:39:28 +00:00
Mathias Vorreiter Pedersen
f30bfb63cf C++: Insert int-to-bool conversions at 'NotExpr's. 2025-01-16 00:39:25 +00:00
Mathias Vorreiter Pedersen
dd39b97ab0 C++: Insert int-to-bool conversions at conditions. 2025-01-16 00:39:22 +00:00
Mathias Vorreiter Pedersen
5acd2bb2fb C++: Adjust the result type at 'NotExpr' and at comparisons. 2025-01-16 00:39:17 +00:00
Mathias Vorreiter Pedersen
9429b03896 C++: Provide a hook for overriding 'getResultType'. 2025-01-16 00:39:16 +00:00
Mathias Vorreiter Pedersen
6dd1c5e809 C++: Split out 'NotExpr' to its own class. 2025-01-16 00:39:14 +00:00
Jeroen Ketema
84c674b992 C++: Fix typos in IR translation comments 2025-01-15 20:16:43 +01:00
Jeroen Ketema
a3cd66844c C++: Add change note 2025-01-15 11:38:09 +01:00
Jeroen Ketema
cd5e77348b C++: Add upgrade and downgrade scripts 2025-01-15 11:38:07 +01:00
Jeroen Ketema
8e39eb9020 C++: Fix incorrect dbscheme assumptions on proxy classes 2025-01-15 11:38:05 +01:00
Jeroen Ketema
537feddf06 C++: Introduce usertypes for structs and unions 2025-01-15 11:38:01 +01:00
Mathias Vorreiter Pedersen
0ff37f1205 Merge pull request #18486 from MathiasVP/indirect-instruction-barriers
C++: Add a `BarrierGuard` module for indirect instruction/operand nodes.
2025-01-14 11:37:58 +00:00
Simon Friis Vindum
7196892867 Merge pull request #18461 from paldepind/cpp-conditional-expr-range-analysis
C++: Only propagate smallest/largest range bound in conditional expressions
2025-01-14 12:31:21 +01:00