[PATCH] D111596: [SelectionDAG] Bail out of mergeTruncStores when not optimizing

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 18:53:48 PDT 2021


aeubanks created this revision.
Herald added subscribers: ecnelises, hiraditya.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

With unoptimized code, we may see lots of stores and spend too much time in mergeTruncStores.

Fixes PR51827.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111596

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -7315,7 +7315,7 @@
   // TODO: If there is evidence that running this later would help, this
   //       limitation could be removed. Legality checks may need to be added
   //       for the created store and optional bswap/rotate.
-  if (LegalOperations)
+  if (LegalOperations || OptLevel == CodeGenOpt::None)
     return SDValue();
 
   // We only handle merging simple stores of 1-4 bytes.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111596.378851.patch
Type: text/x-patch
Size: 618 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211012/83698bf9/attachment.bin>


More information about the llvm-commits mailing list