[PATCH] D37640: [GISel]: Fix generation of illegal COPYs (of different sizes) during CallLowering

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 14:56:49 PDT 2017


qcolombet added inline comments.


================
Comment at: lib/CodeGen/MachineVerifier.cpp:953
+    unsigned SrcSize =
+        RegisterBankInfo::getSizeInBits(SrcOp.getReg(), *MRI, *TRI);
+    if (DstSize != SrcSize)
----------------
aditya_nandakumar wrote:
> qcolombet wrote:
> > Using the type of the vregs, MachineRegisterInfo::getType, should eliminate the dependency on RegisterBankInfo.
> This part has moved to https://reviews.llvm.org/D37775
> MRI->getType would only give me valid types for generic virtual registers.
> For cases such as %0(s16) = COPY %W0, I'd still need to get the size of W0. If dependency is the issue, I can certainly do what RegisterBankInfo::getSizeInBits() is doing, but that's duplicating work.
I would push the interesting part of getSizeInBits from RegisterBankInfo to TargetRegisterInfo and have RegisterBankInfo::getSizeInBits uses TargetRegisterInfo::getSizeInBits to avoid the duplication while having the necessary functionality available for the verifier.


https://reviews.llvm.org/D37640





More information about the llvm-commits mailing list