[PATCH] D78092: [GlobalISel] add legalization for G_FREEZE
Juneyoung Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 15 19:19:35 PDT 2020
aqjune added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:1772
+ Observer.changingInstr(MI);
+ widenScalarSrc(MI, WideTy, 1, TargetOpcode::G_ANYEXT);
+ widenScalarDst(MI, WideTy);
----------------
gargaroff wrote:
> arsenm wrote:
> > Is this what the DAG does? I would be slightly surprised that undef high bits would be OK
> I'm not familiar with SelectionDAG, so I might have misunderstood the extension used.
>
> This is the code in the DAG:
>
> ```
> SDValue DAGTypeLegalizer::PromoteIntRes_FREEZE(SDNode *N) {
> SDValue V = GetPromotedInteger(N->getOperand(0));
> return DAG.getNode(ISD::FREEZE, SDLoc(N),
> V.getValueType(), V);
> }
> ```
>
> In the documentation of `GetPromotedInteger` it says that the upper bits contain rubbish, which suggested to me that this corresponds to `G_ANYEXT`
In case of SelDag, I think PromoteIntRes_FREEZE is correct: it is creating FREEZE instruction, so even if GetPromotedInteger returned undef bits, the result is frozen, so the high bits are frozen bits.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78092/new/
https://reviews.llvm.org/D78092
More information about the llvm-commits
mailing list