[PATCH] D40339: Use getStoreSize() in various places instead of BitSize >> 3

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 03:04:51 PST 2017


jonpa created this revision.
Herald added a subscriber: sdardis.

A bug (https://bugs.llvm.org/show_bug.cgi?id=35366) in DAGCombiner was discovered where loads/stores of i1 got the size of 0, due to the use of 'BitSize >> 3'. The proper way to get the memory access size is to use getStoreSize().

Since this is found also in other places, I have tried to fix a few more of them where it looks obvious.

Please review for correctness.


https://reviews.llvm.org/D40339

Files:
  lib/CodeGen/GlobalISel/IRTranslator.cpp
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/StatepointLowering.cpp
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
  lib/Target/Mips/MipsISelLowering.cpp
  lib/Transforms/Scalar/LoopIdiomRecognize.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40339.123895.patch
Type: text/x-patch
Size: 9589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171122/8a059939/attachment.bin>


More information about the llvm-commits mailing list