nhaehnle added a subscriber: nhaehnle. nhaehnle added a comment. This looks good to me, but it also needs to cover the "rewrite undef" path, see the test case at https://lists.freedesktop.org/archives/mesa-dev/2016-July/124285.html https://reviews.llvm.org/D22556