OSDN Git Service

Use getStoreSize() in various places instead of 'BitSize >> 3'.
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 28 Nov 2017 14:44:32 +0000 (14:44 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 28 Nov 2017 14:44:32 +0000 (14:44 +0000)
commit8973ec011a351d3cfa4c69ac314f7567950cb262
tree6a1f0a7df0d3b6be8c7b02484e73384f52f6b7b4
parent4eb7e2beb5ce67b2e89e0e6ac895f1f111902395
Use getStoreSize() in various places instead of 'BitSize >> 3'.

This is needed for cases when the memory access is not as big as the width of
the data type. For instance, storing i1 (1 bit) would be done in a byte (8
bits).

Using 'BitSize >> 3' (or '/ 8') would e.g. give the memory access of an i1 a
size of 0, which for instance makes alias analysis return NoAlias even when
it shouldn't.

There are no tests as this was done as a follow-up to the bugfix for the case
where this was discovered (r318824). This handles more similar cases.

Review: Björn Petterson
https://reviews.llvm.org/D40339

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319173 91177308-0d34-0410-b5e6-96231b3b80d8
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