[PATCH] D70844: [InstCombine] Fix big-endian miscompile of (bitcast (zext/trunc (bitcast)))

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 29 23:10:37 PST 2019


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

LGTM now, thank you.
Up to you if you want to wait for yet another review (@spatel ?)



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:1871
+  // Produce an identify shuffle mask for the src vector.
+  ShuffleMaskStorage.resize(SrcElts);
+  std::iota(ShuffleMaskStorage.begin(), ShuffleMaskStorage.end(), 0);
----------------
maybe let's do
```
 ShuffleMaskStorage.reserve(std::max(SrcElts, DestElts));
 ShuffleMaskStorage.resize(SrcElts);
```
to try to avoid allocs in widening case.
Though we then waste memory in truncating case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70844





More information about the llvm-commits mailing list