[PATCH] Add simple cross-block DSE.

Hello,

This patch implements cross-block dead store elimination for a simple
scenario -- which was somehow important in my case --, i.e. when a
store has only one memory dependence in a function.

This patch is a bit narrow-minded (e..g, only store instructions are
checked for memory dependencies), but I can always make it more
generic, if you give me pointers *and* my code is correct.

Cheers,
Gianluca

simple-cross-bb-dse.patch (1.09 KB)

Hi Gianluca, did you look at Jakub Staszak's "Non-local DSE" patch
he posted to the mailing list a while ago?

Ciao,

Duncan.

Hi Duncan,

Hi Gianluca, did you look at Jakub Staszak's "Non-local DSE" patch
he posted to the mailing list a while ago?

Yes, and as it happens, I just found his patch *after* I've send mine. Of course it is way more complete and smarter than mine -- which tend to solve as unintrusively as possible a common problem I found in a few IRs I've been generating recently (working on a JIT I tend to like simpler optimization passes or I just try to produce a better IR from my side).

I'll try to have a look at Jakub's patch, I'm sure it'll handle my case as well.

Ah, another thing I found is that my way of sending patches was completely ignoring the LLVM developers policies. My fault. :slight_smile:

Ciao :wink:
Gianluca