Keep TBAA info when rewriting SelectionDAG loads and stores
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Mon, 28 Oct 2013 11:17:59 +0000 (11:17 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Mon, 28 Oct 2013 11:17:59 +0000 (11:17 +0000)
commit66589dcc8fb5dcf0894a9a80a8dee890a4f3a379
tree958d99bb4d3324f285793579819e2f929f816462
parent188545867dbcd0a6870b19c6b06d49610e7cda93
Keep TBAA info when rewriting SelectionDAG loads and stores

Most SelectionDAG code drops the TBAA info when creating a new form of a
load and store (e.g. during legalization, or when converting a plain
load to an extending one).  This patch tries to catch all cases where
the TBAA information can legitimately be carried over.

The patch adds alternative forms of getLoad() and getExtLoad() that take
a MachineMemOperand instead of individual fields.  (The corresponding
getTruncStore() already exists.)  The idea is to use the MachineMemOperand
forms when all fields are carried over (size, pointer info, isVolatile,
isNonTemporal, alignment and TBAA info).  If some adjustment is being
made, e.g. to narrow the load, then we still pass the individual fields
but also pass the TBAA info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193517 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/SelectionDAG.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/SystemZ/alias-01.ll [new file with mode: 0644]