[PATCH] D59227: [GlobalISel][Utils] Teach getConstantVRegVal how to look through trunc and z|sext

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 10:43:29 PDT 2019


qcolombet added a comment.

> For operands that truly need to be constants that shouldn't be legalized, I don't think G_CONSTANT should be used. This is part of the motivation behind D58232 <https://reviews.llvm.org/D58232> https://reviews.llvm.org/D58232. In SelectionDAG there is the TargetConstant vs. Constant distinction, but I think that makes less sense here, so weird constants should just never be materialized.

If we were to go down the road of allowing constants as MachineOperand, I would rather kill the G_CONSTANT and be smart about how we materialize them (unlike selection DAG). Now, the code churn to deal with that would be so bad (teaching every place that a MachineOperand may not be a vreg) that I don't think it makes sense.
I am somewhat sensible for the intrinsic argument since the generic passes don't look at them.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59227





More information about the llvm-commits mailing list