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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 1 07:59:57 PST 2019


spatel accepted this revision.
spatel added a comment.

LGTM



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:1867-1868
+  bool IsBigEndian = IC.getDataLayout().isBigEndian();
+  unsigned SrcElts = SrcTy->getNumElements();
+  unsigned DestElts = DestTy->getNumElements();
 
----------------
Add an assert that SrcElts != DestElts? Make sure the calling code doesn't get out-of-sync from the assumption in this function.


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