[PATCH] D42179: [NewGVN] Re-evaluate phi of ops after moving an instr to new class

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 08:27:20 PST 2018


fhahn added a comment.

Thanks for the having a look so quickly and thanks for the pointers. I'll have a look there to see why the phi-of-ops is not re-evaluated.

In the test case, the following does happen:

1. when trying to find a phi-of-ops for ` add nsw i32 %inc7, -1 ` the first time, the symbolic expression we find is ` { ExpressionTypeVariable, opcode = 78,  variable =   %y.0.0 = call i32 @llvm.ssa.copy.i32(i32 %y.0)} `, which is not suitable ( as %y.0.0 does not dominate the instruction
2. when processing `%y.0.0 = call i32 @llvm.ssa.copy.i32(i32 %y.0)`, move the instruction to a new class for expression `{ ExpressionTypeVariable, opcode = 77,  variable =   %y.0 = phi i32 [ 1, %entry ], [ %inc7, %for.inc6 ]}`. This is != the expression we put in ExpressionToPhiOfOps, so we do not re-evaluate it.
3. While verifying, we find `{ ExpressionTypeVariable, opcode = 77,  variable =   %y.0 = phi i32 [ 1, %entry ], [ %inc7, %for.inc6 ]}` when evaluating ` add nsw i32 %inc7, -1 `, which dominates the instruction and the phi-of-ops can be created.


Repository:
  rL LLVM

https://reviews.llvm.org/D42179





More information about the llvm-commits mailing list