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

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 14:43:50 PDT 2017


aditya_nandakumar marked an inline comment as done.
aditya_nandakumar added inline comments.


================
Comment at: lib/CodeGen/MachineVerifier.cpp:953
+    unsigned SrcSize =
+        RegisterBankInfo::getSizeInBits(SrcOp.getReg(), *MRI, *TRI);
+    if (DstSize != SrcSize)
----------------
qcolombet wrote:
> 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.
Quentin - I refactored getSizeInBits in the other review.


https://reviews.llvm.org/D37640





More information about the llvm-commits mailing list