[PATCH] D116895: Fix a missed opportunity to optimize consecutive stores.

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 25 07:38:39 PST 2022


uabelho added a comment.

Hi,

Anyone seen problems with this patch?
I have a case for my out-of-tree target where this patch causes two stores to be merged leading to a cycle in the DAG.
So in the initial DAG we have the following dependencies

  store2 <- load1 <- load2 <- load3 <- store1

and then store2 and store1 are merged to store21 and we end up with dependencies like this:

  store12 <- load1 <- load2 <- load3
                            <- store12

ie. load2 depends on both load3 and store12 so we have a broken DAG with a cycle in it.
So then we end up with

  Operand not processed?0x882a240
  t9: i16,ch = load<(load (s16) from %ir.next1.i)> t26, t8, undef:i16
  
  UNREACHABLE executed at ../lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:503!

I haven't been able to reproduce this for any in-tree targets yet so it might very well be something we've broken for our target but I thought I'd mention here that we see problems in case anyone else does too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116895/new/

https://reviews.llvm.org/D116895



More information about the llvm-commits mailing list