[PATCH] D40049: [PATCH] Global reassociation for improved CSE

escha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 11:17:09 PST 2017


escha added inline comments.


================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:2273
+          Value *Op1 = Ops[j];
+          if (std::less<Value *>()(Op1, Op0))
+            std::swap(Op0, Op1);
----------------
arsenm wrote:
> I'm not sure what std::less on a Value * means. Is this sorting by pointer value?
yes. it's canonically ordering them so we don't have to worry about checking both [a,b] and [b,a].


Repository:
  rL LLVM

https://reviews.llvm.org/D40049





More information about the llvm-commits mailing list