[PATCH] D53232: [LegalizeTypes] Prevent an assertion from PromoteIntRes_BSWAP and PromoteIntRes_BITREVERSE if the shift amount is too large for the VT returned by getShiftAmountTy

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 12 17:37:31 PDT 2018


craig.topper updated this revision to Diff 169528.
craig.topper added a comment.

Correct the calculation for how many bits are needed to store the shift amount. It should be log2(val)+1 not log2_ceil(val)


https://reviews.llvm.org/D53232

Files:
  lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  test/CodeGen/X86/bitreverse.ll
  test/CodeGen/X86/bswap.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53232.169528.patch
Type: text/x-patch
Size: 34106 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181013/b5953f65/attachment.bin>


More information about the llvm-commits mailing list