[PATCH] D108731: [TwoAddressInstructionPass] Improve the SrcRegMap and DstRegMap computation
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 17 23:57:54 PDT 2021
craig.topper added inline comments.
================
Comment at: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:401
+ unsigned Src1 = TII->CommuteAnyOperandIndex;
+ unsigned Src2 = UseMI.findRegisterUseOperandIdx(Reg);
+ if (TII->findCommutedOpIndices(UseMI, Src1, Src2)) {
----------------
pengfei wrote:
> I'm confused about the code here. `findRegisterUseOperandIdx` return `-1` when the function fails. But `-1` is equal to `CommuteAnyOperandIndex`, which means we allow any operand to be commutable?
I think it should never fail, UseMI is already known to use Reg.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108731/new/
https://reviews.llvm.org/D108731
More information about the llvm-commits
mailing list