1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Fix a bug that David Greene found in the DAGCombiner's logic

that checks whether it's safe to transform a store of a bitcast
value into a store of the original value.

llvm-svn: 65201
This commit is contained in:
Dan Gohman 2009-02-20 23:29:13 +00:00
parent 5cfd666bde
commit c9cfc596a3

View File

@ -4903,9 +4903,9 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) {
// resultant store does not need a higher alignment than the original. // resultant store does not need a higher alignment than the original.
if (Value.getOpcode() == ISD::BIT_CONVERT && !ST->isTruncatingStore() && if (Value.getOpcode() == ISD::BIT_CONVERT && !ST->isTruncatingStore() &&
ST->isUnindexed()) { ST->isUnindexed()) {
unsigned Align = ST->getAlignment(); unsigned OrigAlign = ST->getAlignment();
MVT SVT = Value.getOperand(0).getValueType(); MVT SVT = Value.getOperand(0).getValueType();
unsigned OrigAlign = TLI.getTargetData()-> unsigned Align = TLI.getTargetData()->
getABITypeAlignment(SVT.getTypeForMVT()); getABITypeAlignment(SVT.getTypeForMVT());
if (Align <= OrigAlign && if (Align <= OrigAlign &&
((!LegalOperations && !ST->isVolatile()) || ((!LegalOperations && !ST->isVolatile()) ||