Skip to content

Conversation

MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Dec 6, 2024

Observed during QA of #18207.

Before (on #18207):

[2024-12-06 12:46:11] Evaluated non-recursive predicate DataFlowUtil::BarrierGuard<UnboundedWrite::lessThanOrEqual>::getABarrierNode/0#fcc0c149@eee4e50o in 695949ms (size: 10004).
Evaluated relational algebra for predicate DataFlowUtil::BarrierGuard<UnboundedWrite::lessThanOrEqual>::getABarrierNode/0#fcc0c149@eee4e50o with tuple counts:
     322600    ~0%    {2} r1 = JOIN `Instruction::Instruction.getConvertedResultExpression/0#dispred#f9cfafab` WITH `ValueNumberingInternal::tvalueNumber/1#f03b58f9` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
  483600582    ~0%    {2}    | JOIN WITH `ValueNumberingInternal::tvalueNumber/1#f03b58f9_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
  467900586    ~0%    {2}    | JOIN WITH `Instruction::Instruction.getConvertedResultExpression/0#dispred#f9cfafab` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
  467768453    ~7%    {2}    | JOIN WITH `project#ExprNodes::ExprNode.getConvertedExpr/1#dispred#04e26388_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
  467773635   ~12%    {3}    | JOIN WITH `project#DataFlowUtil::Node.hasIndexInBlock/2#4ca72ac1` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0
11948631477   ~10%    {4}    | JOIN WITH `IRGuards::IRGuardCondition.controls/2#dispred#a7389eda_102#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Rhs.2, Lhs.2
      72683  ~810%    {1}    | JOIN WITH `UnboundedWrite::lessThanOrEqual/3#4e4dda57` ON FIRST 3 OUTPUT Lhs.3
                  
     218983    ~1%    {3} r2 = SCAN DataFlowUtil::TSsaPhiInputNode#d9cd78c6 OUTPUT In.1, In.0, In.2
    5691923    ~1%    {4}    | JOIN WITH `DataFlowUtil::guardControlsPhiInput/5#50adc50d_34012#join_rhs` ON FIRST 2 OUTPUT Rhs.2, Rhs.3, Lhs.2, Rhs.4
    9261053    ~1%    {3}    | JOIN WITH `UnboundedWrite::lessThanOrEqual/3#4e4dda57_021#join_rhs` ON FIRST 2 OUTPUT Rhs.2, Lhs.2, Lhs.3
    5991776    ~2%    {3}    | JOIN WITH `Instruction::Instruction.getConvertedResultExpression/0#dispred#f9cfafab_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
    5991754    ~0%    {3}    | JOIN WITH `Operand::Operand.getDef/0#dispred#a70e8079_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
    5991738    ~1%    {3}    | JOIN WITH DataFlowUtil::OperandNode#3e3b23f6_20#join_rhs ON FIRST 1 OUTPUT Lhs.2, Lhs.1, Rhs.1
76562240430    ~0%    {5}    | JOIN WITH `SsaInternals::ssaDefReachesReadExt/4#0fbc7cab_1023#join_rhs` ON FIRST 1 OUTPUT Rhs.2, Rhs.3, Rhs.1, Lhs.2, Lhs.1
       4324  ~184%    {1}    | JOIN WITH `SsaInternals::useToNode/4#96395582` ON FIRST 4 OUTPUT Lhs.4
                  
      77007  ~708%    {1} r3 = r1 UNION r2
                      return r3

After:

[2024-12-06 15:11:43] Evaluated non-recursive predicate DataFlowUtil::BarrierGuard<UnboundedWrite::lessThanOrEqual>::getABarrierNode/0#fcc0c149@9bfd6d2f in 456ms (size: 10004).
Evaluated relational algebra for predicate DataFlowUtil::BarrierGuard<UnboundedWrite::lessThanOrEqual>::getABarrierNode/0#fcc0c149@9bfd6d2f with tuple counts:
  494346    ~0%    {2} r1 = JOIN DataFlowUtil::OperandNode#3e3b23f6_20#join_rhs WITH `Operand::Operand.getDef/0#dispred#a70e8079` ON FIRST 1 OUTPUT Rhs.1, Lhs.1
  326435    ~0%    {2}    | JOIN WITH `Instruction::Instruction.getConvertedResultExpression/0#dispred#f9cfafab` ON FIRST 1 OUTPUT Lhs.1, Rhs.1
  132421    ~5%    {2}    | JOIN WITH `SsaInternals::DefinitionExt.getARead/0#0429944e_10#join_rhs` ON FIRST 1 OUTPUT Lhs.1, Rhs.1
   11306   ~15%    {3}    | JOIN WITH `UnboundedWrite::lessThanOrEqual/3#4e4dda57_102#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Rhs.2, Lhs.1
    1757    ~7%    {2}    | JOIN WITH `DataFlowUtil::guardControlsPhiInput/5#50adc50d` ON FIRST 3 OUTPUT Rhs.4, Rhs.3
    1669    ~9%    {1}    | JOIN WITH DataFlowUtil::TSsaPhiInputNode#d9cd78c6 ON FIRST 2 OUTPUT Rhs.2
               
  138362    ~0%    {3} r2 = JOIN `UnboundedWrite::lessThanOrEqual/3#4e4dda57_102#join_rhs` WITH `Instruction::Instruction.getConvertedResultExpression/0#dispred#f9cfafab_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
  138362  ~565%    {3}    | JOIN WITH `ValueNumberingInternal::tvalueNumber/1#f03b58f9` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
32309466  ~849%    {3}    | JOIN WITH `ValueNumberingInternal::tvalueNumber/1#f03b58f9_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
30802905  ~840%    {3}    | JOIN WITH `Instruction::Instruction.getConvertedResultExpression/0#dispred#f9cfafab` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
28124921  ~758%    {3}    | JOIN WITH `project#ExprNodes::ExprNode.getConvertedExpr/1#dispred#04e26388_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
28125285  ~728%    {4}    | JOIN WITH `project#DataFlowUtil::Node.hasIndexInBlock/2#4ca72ac1` ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.2, Lhs.0
   66856  ~684%    {1}    | JOIN WITH `IRGuards::IRGuardCondition.controls/2#dispred#a7389eda` ON FIRST 3 OUTPUT Lhs.3
               
   68525  ~567%    {1} r3 = r1 UNION r2
                   return r3

@github-actions github-actions bot added the C++ label Dec 6, 2024
@MathiasVP MathiasVP force-pushed the fix-join-order-in-barrier-guards branch from 6bdedc4 to c511532 Compare December 6, 2024 15:10
@MathiasVP MathiasVP marked this pull request as ready for review December 6, 2024 15:21
@MathiasVP MathiasVP requested a review from a team as a code owner December 6, 2024 15:21
@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label Dec 6, 2024
Copy link
Contributor

@jketema jketema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, if DCA is ok.

@MathiasVP
Copy link
Contributor Author

DCA was uneventful

@MathiasVP MathiasVP merged commit 8a6c529 into github:main Dec 6, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants