[llvm-dev] [X86] Is it possible to implicitly promote a virtual subregister to a super?
Craig Topper via llvm-dev
llvm-dev at lists.llvm.org
Wed Jan 20 09:13:53 PST 2021
If there's no guarantee of a value for the upper bits don't you want
INSERT_SUBREG? SUBREG_TO_REG says the upper bits are 0(or whatever the
immediate says). Not that I've ever found a place that checks it.
~Craig
On Wed, Jan 20, 2021 at 9:09 AM Tim Northover via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> On Wed, 20 Jan 2021 at 16:30, Constable, Scott D
> <scott.d.constable at intel.com> wrote:
> > The actual implementation I'm doing is a bit more complex than the
> example I provided for illustrative purposes. In my case, I don't need to
> care about the upper bits at all.
>
> OK, in that case I think SUBREG_TO_REG is what you want. Something like
>
> BuildMI(MBB, InsertPt, Loc, TII->get(X86::SUBREG_TO_REG), ExtendedReg)
> .addImm(0) // Never been entirely sure what this was here for.
> It's always 0.
> .addReg(NarrowReg)
> .addImm(X86::sub_16bit);
>
> then use ExtendedReg (a GR32 vreg) in the compare.
>
> Cheers.
>
> Tim.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210120/61485ea8/attachment.html>
More information about the llvm-dev
mailing list