[PATCH] D42697: [GlobalISel] Fix crash due to assuming a COPY src reg has a reg class

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 14:03:49 PST 2018



> On Jan 30, 2018, at 11:15 AM, Amara Emerson via Phabricator <reviews at reviews.llvm.org> wrote:
> 
> aemerson added inline comments.
> 
> 
> ================
> Comment at: lib/CodeGen/GlobalISel/InstructionSelect.cpp:186
> +        auto DstRC = MRI.getRegClassOrNull(DstReg);
> +        if (SrcReg && SrcRC == DstRC) {
>           MRI.replaceRegWith(DstReg, SrcReg);
> ----------------
> aditya_nandakumar wrote:
>> After ISel, is it at all possible that vregs will have no regclass assigned?

No it shouldn’t happen, or that’s a bug. I believe the verifier would complain about this.

>> The above code assumes that specifically.
> I'm not sure, it did seem odd. Perhaps the underlying issue is manifesting before this.
> 
> 
> Repository:
>  rL LLVM
> 
> https://reviews.llvm.org/D42697
> 
> 
> 



More information about the llvm-commits mailing list