[PATCH] D134277: [RISCV] Combine comparison and logic ops.

Ilya Andreev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 03:20:55 PDT 2022


iabg-sc added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:8324
+
+  // SETCC has three operands: op0, op1, cond. Checks only the first two.
+  // Returns Iterator to condition operand in comparison.
----------------
craig.topper wrote:
> I'm not sure the std::finds and std::distance added much over manually checking the 4 permutations.
Perhaps searching for common and other operands is easy to do manually. It can be done with two ifs. But verifying the found operands will be look like copy-paste with different indices. Now this verifying is hidden inside algorithms, and only crucial conditions, when something goes terribly wrong, are checked with assert.
I think there are two different approaches:
  1 - Find correct indices by value properties. Therefore, I do not need to check this properties as they are stated. This is that I did.
  2 - By indices find values and verify their properties. But in this case indices are stated and addition checks are required.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134277



More information about the llvm-commits mailing list