[PATCH] D119121: [test-suite] Add unit tests for vectorizer memory runtime checks.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 09:05:48 PDT 2022


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


================
Comment at: SingleSource/UnitTests/Vectorizer/runtime-checks.cpp:17
+static void init_data(const std::unique_ptr<Ty[]> &A, unsigned N) {
+  std::uniform_int_distribution<Ty> distrib(std::numeric_limits<Ty>::min(),
+                                            std::numeric_limits<Ty>::max());
----------------
Kai wrote:
> According to https://reviews.llvm.org/D120630 `std::uniform_int_distribution<char>` is UB. It gives a compile error with latest C++lib.
Thanks for the heads-up! IIUC it needs to be an unsigned type. So probably the best way to fix this is to instantiate `std::uniform_int_distribution` with something like `uint64_t` and then have the result converted?


Repository:
  rT test-suite

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119121/new/

https://reviews.llvm.org/D119121



More information about the llvm-commits mailing list