[llvm] [AArch64] merge index address with large offset into base address (PR #75343)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 01:19:33 PST 2023


================
@@ -4089,6 +4089,11 @@ AArch64InstrInfo::getLdStOffsetOp(const MachineInstr &MI) {
   return MI.getOperand(Idx);
 }
 
+const MachineOperand &
+AArch64InstrInfo::getLdStAmountOp(const MachineInstr &MI) {
+  return MI.getOperand(4);
----------------
david-arm wrote:

OK, but my point is that if your patch lands another engineer may start using this function believing that it is complete. However, it might do the wrong thing if called for a different opcode. I think you need to explicitly add an error if the opcode is not what you expect so that it fails sensibly.

https://github.com/llvm/llvm-project/pull/75343


More information about the llvm-commits mailing list