[PATCH] D116305: [CSInfo][clang][ISEL][RISCV] Support for recovering optimized debug function parameters

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 06:01:25 PST 2022


djtodoro added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:1935
+
+Optional<RegImmPair> RISCVInstrInfo::isAddImmediate(const MachineInstr &MI,
+                                                    Register Reg) const {
----------------
djtodoro wrote:
> jrtc27 wrote:
> > Does this need to be a member function? It doesn't seem to access any state from what I can tell, only its inputs.
> > 
> > Also, the name is misleading. isAddImmediate suggests it's checking for RISCV::ADDI (which would be a pointless function), but it in fact does many more things than that.
> I guess a more appropriate name would be something like `isAddImmLike()`
In addition to this -- please take a look into the X86 implementation of the `describeLoadedValue()`. I think that some of these instructions here are `moveImmLike` (since the offset ends up being 0) rather than `addImmLike` instructions -- so those could/should be moved out of this predicate for sure.


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

https://reviews.llvm.org/D116305



More information about the llvm-commits mailing list