[llvm-dev] [X86] Is it possible to implicitly promote a virtual subregister to a super?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 20 10:01:52 PST 2021


On Wed, 20 Jan 2021 at 17:14, Craig Topper <craig.topper at gmail.com> wrote:
> 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.

Ah yes, I think you're right there. That's annoying, it's uglier to use:

BuildMI(MBB, InsertPt, Loc, TII->get(X86::IMPLICIT_DEF), UndefReg);
BuildMI(MBB, InsertPt, Loc, TII->get(X86::INSERT_SUBREG), ExtendedReg)
    .addReg(UndefReg)
    .addReg(NarrowReg)
    .addImm(X86::sub_16);


Tim.


More information about the llvm-dev mailing list