[PATCH] D27191: TII: add hook getInstrOperandImmValue.

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 13:36:06 PST 2016


kparzysz added inline comments.


================
Comment at: include/llvm/Target/TargetInstrInfo.h:1144
+                                       const MachineOperand &MO,
+                                       int64_t &Val) const {
+    return false;
----------------
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.


https://reviews.llvm.org/D27191





More information about the llvm-commits mailing list