[PATCH] D46384: Reapply "[SelectionDAG] Selection of DBG_VALUE using a PHI node result (pt 2)"
Vedant Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 3 11:45:06 PDT 2018
vsk added inline comments.
================
Comment at: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:5282
+ if (Offset >= BitsToDescribe)
+ break;
+ unsigned FragmentSize = (Offset + RegisterSize > BitsToDescribe)
----------------
bjope wrote:
> vsk wrote:
> > Just curious -- could this be simplified to 'assert(Offset <= BitsToDescribe)'?
> No.
>
> If we for example have a IR level PHI node for i64, and i64 isn't legal we can get two PHI nodes in MIR. Each of them defining a 32-bit vreg. So the loop will do two iterations (I=0 and I=1), with RegisterSize=32.
>
> If the dbg.value only describes a fragment of a variable, then for example we could get BitsToDescibe=24
> So for I=0,Offset=0 we will create a DBG_VALUE with a 24-bit fragment.
> And then for I=0,Offset=32 we will bail out due to Offset>=BitsToDescribe. And we do not need to create a DBG_VALUE for the second register since we already described all 24-bits that the dbg.value described.
>
Got it, thanks for explaining.
Repository:
rL LLVM
https://reviews.llvm.org/D46384
More information about the llvm-commits
mailing list