[PATCH] D18830: [llvm] GVN.cpp: Do not swap when both LHS and RHS are arguments.

Aditya Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 12:24:58 PDT 2016


hiraditya added a comment.

In http://reviews.llvm.org/D18830#393400, @joker.eph wrote:

> Oh then it is not even clear if it is worth it (avoid extra work here is doing an extra comparison to avoid a "pointer swap")


It seems VN.lookupOrAdd only swaps operands based on value numbers. Preferring constants/arguments on RHS seems unrelated to that, although I'm not sure this preference is useful in anyway.


Repository:
  rL LLVM

http://reviews.llvm.org/D18830





More information about the llvm-commits mailing list