[PATCH] D120545: [LoongArch] Add EncoderMethods for transformed immediate operands
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 27 20:42:13 PST 2022
MaskRay added inline comments.
================
Comment at: llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp:94
+ const MCOperand &MO = MI.getOperand(OpNo);
+
+ if (MO.isImm()) {
----------------
delete unneeded blank line
================
Comment at: llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp:97
+ unsigned Res = MO.getImm();
+ return Res - 1;
+ }
----------------
Inline used-once variable
================
Comment at: llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp:101
+ llvm_unreachable("Unhandled expression!");
+ return 0;
+}
----------------
llvm_unreachable does not need a following return
Optional: For regular diagnostics, see https://llvm.org/docs/CodingStandards.html#error-and-warning-messages for the recommended style. I know that some llvm_unreachable used capitalized messages.
================
Comment at: llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp:117
+ llvm_unreachable("Unhandled expression!");
+ return 0;
+}
----------------
llvm_unreachable does not need a following return
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120545/new/
https://reviews.llvm.org/D120545
More information about the llvm-commits
mailing list