[PATCH] D27191: TII: add hook getInstrOperandImmValue.

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 14:04:37 PST 2016


qcolombet added inline comments.


================
Comment at: include/llvm/Target/TargetInstrInfo.h:1144
+                                       const MachineOperand &MO,
+                                       int64_t &Val) const {
+    return false;
----------------
kparzysz wrote:
> qcolombet wrote:
> > qcolombet wrote:
> > > qcolombet wrote:
> > > > MI is probably useless given it is accessible through MO.getParent(), unless it represents something else and in that case it must be documented.
> > > Val should probably be an APInt.
> > If this is a compile time known constant, why this is not directly MO_Immediate?
> > What am I saying is in which cases do we need that API?
> The intent was to evaluate the value of the operand at compile-time: for immediate operands that is trivial, for registers the function would look up their definitions, etc.
I see.
One thing that you didn't address is why does the API have both MI and MO?


https://reviews.llvm.org/D27191





More information about the llvm-commits mailing list