[PATCH] D21935: Add TLI.allowsMisalignedMemoryAccesses to LoadStoreVectorizer

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 10:16:23 PDT 2016

asbirlea added inline comments.

Comment at: include/llvm/Analysis/TargetTransformInfo.h:391
@@ -390,1 +390,3 @@
+  /// \brief Indicate whether target allows misaligned memory accesses
+  bool allowsMisalignedMemoryAccesses(unsigned BitWidth, unsigned AddressSpace = 0,
The definition should be the same as the one in TLI. It reads:
  /// \brief Determine if the target supports unaligned memory accesses.
  /// This function returns true if the target allows unaligned memory accesses
  /// of the specified type in the given address space. If true, it also returns
  /// whether the unaligned memory access is "fast" in the last argument by
  /// reference. This is used, for example, in situations where an array
  /// copy/move/set is converted to a sequence of store operations. Its use
  /// helps to ensure that such replacements don't generate code that causes an
  /// alignment error (trap) on the target machine.

The difference in the API here is not having a type, but a size in bits. The brief description still applies. Perhaps use just that?


More information about the llvm-commits mailing list