[PATCH] D140530: [RISCV] Add integer scalar instructions to isAssociativeAndCommutative

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 02:31:41 PST 2022


HsiangKai added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:2616-2618
+  // If both instructions have no FRM operand, treat it as equal FRM.
+  if (MI1FrmOpIdx < 0 && MI2FrmOpIdx < 0)
+    return true;
----------------
kito-cheng wrote:
> This seems out of scope of this patch?
In order to let hasReassociableSibling() return correct result for integer scalar cases, we have to handle non-fp cases here.

I think it makes sense to return true when instructions have no FRM operand in this function. There may be better way to handle it for hasReassociableSibling(). Any suggestions?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140530



More information about the llvm-commits mailing list