[PATCH] D46490: [MachineVerifier][GlobalISel] Verifying generic extends and truncates

Roman Tereshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 4 22:37:05 PDT 2018


rtereshin created this revision.
rtereshin added reviewers: aditya_nandakumar, qcolombet, t.p.northover.
Herald added subscribers: llvm-commits, kristof.beyls, rovka, nhaehnle.

Making sure we don't truncate / extend pointers, don't try to change
vector topology or bitcast vectors to scalars or back, and most
importantly, don't extend to a smaller type or truncate to a large
one.

While crafting a test for this change with a more or less decent code coverage I noticed that our MIR Parser is not able to parse vector pointer LLTs. We do quite explicitly support their representation in LLT class, and there is a direct counterpart in LLVM IR. Also it's easy to imagine a target actually sporting them (with some sort of vector scatter / gather stores / loads. So the test ended up depending on a fix for MIR Parser planned as a separate commit:

  [MIRParser][GlobalISel] Parsing vector pointer types (<M x pA>)
  
  MIParser wasn't able to parse LLTs like `<4 x p0>`, fixing that.

This diff includes both commits together.


Repository:
  rL LLVM

https://reviews.llvm.org/D46490

Files:
  lib/CodeGen/MIRParser/MIParser.cpp
  lib/CodeGen/MachineVerifier.cpp
  test/CodeGen/AMDGPU/GlobalISel/regbankselect-trunc.mir
  test/CodeGen/X86/verifier-generic-extend-truncate.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46490.145353.patch
Type: text/x-patch
Size: 9293 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180505/be92604f/attachment.bin>


More information about the llvm-commits mailing list