[PATCH] D66498: [GlobalISel] Import patterns containing INSERT_SUBREG

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 12:14:36 PDT 2019


mgrang added inline comments.


================
Comment at: llvm/trunk/utils/TableGen/CodeGenTarget.cpp:330
+  // Find and return the largest of our candidate classes.
+  llvm::sort(Candidates,
+             [&](const CodeGenRegisterClass *A, const CodeGenRegisterClass *B) {
----------------
If A and B have the same size then you would end up with a tie. This can result in non-deterministic sorting order. I guess you would need a tie breaker in that case.
See https://llvm.org/docs/CodingStandards.html#beware-of-non-deterministic-sorting-order-of-equal-elements.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66498/new/

https://reviews.llvm.org/D66498





More information about the llvm-commits mailing list