Can't fold the bit_convert is the store is a truncating store.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 9 May 2007 21:49:47 +0000 (21:49 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 9 May 2007 21:49:47 +0000 (21:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36962 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 290d621cf0edafce91fdf421ce06cfca10d9957e..744a474ba4e979e58919f1616dac0a5106371dab 100644 (file)
@@ -3422,8 +3422,8 @@ SDOperand DAGCombiner::visitSTORE(SDNode *N) {
   SDOperand Ptr   = ST->getBasePtr();
   
   // If this is a store of a bit convert, store the input value if the
-  // resultant store does not need a  higher alignment than the original.
-  if (Value.getOpcode() == ISD::BIT_CONVERT) {
+  // resultant store does not need a higher alignment than the original.
+  if (Value.getOpcode() == ISD::BIT_CONVERT && !ST->isTruncatingStore()) {
     unsigned Align = ST->getAlignment();
     MVT::ValueType SVT = Value.getOperand(0).getValueType();
     unsigned OrigAlign = TLI.getTargetMachine().getTargetData()->