[llvm] r276690 - GlobalISel: add generic casts to IRTranslator

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 09:20:27 PDT 2016


Thanks for the review Quentin.

> On 9 Aug 2016, at 18:10, Quentin Colombet <qcolombet at apple.com> wrote:
> Shouldn’t we test isNoOpCast or something like that instead?
> 
> I.e., having v2i32 becoming v8i8 should also produce a copy.

Unfortunately not. bitcasts aren't necessarily nops at this level. They're defined to be equivalent to a store/load pair and (for example) big-endian NEON's in-register representation is defined in terms of ld1/st1 instructions, which means that vector bitcasts are REV instructions. See arm64-big-endian-bitconverts.ll for examples.

> 
>> +    MIRBuilder.buildInstr(TargetOpcode::COPY, getOrCreateVReg(CI),
>> +                          getOrCreateVReg(*CI.getOperand(0)));
> 
> Although this is correct, I’d like to be a little smarter here. Basically, I would like that we directly use CI.getOperand(0)’s vreg if CI hasn’t been created yet. I.e., I’d like we avoid creating copies if we don’t have to.

Sounds like a good idea, I'll work on it.

Tim.


More information about the llvm-commits mailing list