File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
llvm/lib/CodeGen/SelectionDAG Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -9390,8 +9390,7 @@ SDValue DAGCombiner::mergeTruncStores(StoreSDNode *N) {
93909390 LLVMContext &Context = *DAG.getContext();
93919391 unsigned NumStores = Stores.size();
93929392 unsigned WideNumBits = NumStores * NarrowNumBits;
9393- EVT WideVT = EVT::getIntegerVT(Context, WideNumBits);
9394- if (WideVT != MVT::i16 && WideVT != MVT::i32 && WideVT != MVT::i64)
9393+ if (WideNumBits != 16 && WideNumBits != 32 && WideNumBits != 64)
93959394 return SDValue();
93969395
93979396 // Check if all bytes of the source value that we are looking at are stored
@@ -9445,7 +9444,7 @@ SDValue DAGCombiner::mergeTruncStores(StoreSDNode *N) {
94459444 SourceValue = WideVal;
94469445
94479446 // Give up if the source value type is smaller than the store size.
9448- if (SourceValue.getScalarValueSizeInBits() < WideVT.getScalarSizeInBits() )
9447+ if (SourceValue.getScalarValueSizeInBits() < WideNumBits )
94499448 return SDValue();
94509449 }
94519450
@@ -9469,6 +9468,8 @@ SDValue DAGCombiner::mergeTruncStores(StoreSDNode *N) {
94699468 OffsetMap[Offset] = ByteOffsetFromBase;
94709469 }
94719470
9471+ EVT WideVT = EVT::getIntegerVT(Context, WideNumBits);
9472+
94729473 assert(FirstOffset != INT64_MAX && "First byte offset must be set");
94739474 assert(FirstStore && "First store must be set");
94749475
You can’t perform that action at this time.
0 commit comments