Skip to content

Commit 1618a2a

Browse files
aeubankskinke
authored andcommitted
[SelectionDAG] Bail out of mergeTruncStores when not optimizing
With unoptimized code, we may see lots of stores and spend too much time in mergeTruncStores. Fixes PR51827. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D111596
1 parent 3739e2f commit 1618a2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7296,7 +7296,7 @@ SDValue DAGCombiner::mergeTruncStores(StoreSDNode *N) {
72967296
// TODO: If there is evidence that running this later would help, this
72977297
// limitation could be removed. Legality checks may need to be added
72987298
// for the created store and optional bswap/rotate.
7299-
if (LegalOperations)
7299+
if (LegalOperations || OptLevel == CodeGenOpt::None)
73007300
return SDValue();
73017301

73027302
// We only handle merging simple stores of 1-4 bytes.

0 commit comments

Comments
 (0)