[PATCH] D51392: [IR] add shuffle queries for identity extend/extract

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 11:42:52 PDT 2018


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

I think this looks good. Naming suggestion included.



================
Comment at: include/llvm/IR/Instructions.h:2508-2514
+  /// Return true if this shuffle extends exactly one source vector with undefs
+  /// in the high elements.
+  bool isIdentityWithExtend() const;
+
+  /// Return true if this shuffle extracts the first N elements of exactly one
+  /// source vector.
+  bool isIdentityWithExtract() const;
----------------
`isIdentityWithExtend()` sounds very much like [[ https://llvm.org/docs/LangRef.html#zext-to-instruction | `zext` ]]-but-with-undef.
So maybe `isIdentityWithExtract()` can follow suit and be named `isIdentityWithTruncate()`?


https://reviews.llvm.org/D51392





More information about the llvm-commits mailing list