dberlin/llvm-gvn-rewrite — pull request #2 by espindola (2012-08-14 01:14:12+00:00)
Title: Gvnredo cleanups2

More a rfc than anything else really.

This is on top of my previous pull request. I can rebase if you want.

I noticed some style violations. GVN is an old file so some of them predate the current style, but some are in new code. Since this is a 90% rewrite of GVN, it is probably a good time to get the style right.

I also noticed some silly looking instructions coming out of GVN, like "%y = add 0, %x". If I understand the algorithm correctly (a big if), there is nothing in it that prevents substitutions not found by the algorithm itself. I.e., it can query an oracle on the side, so the old code for using SimplifyInstruction should work with only small modifications. That is what the second patch does.