I am not sure this is the right place to ask but here is my question. About a year ago there was a fix of some obscure bug (rdar://problem/8030636 which is located on the internal Apple bugtracker I believe and so not available to the general public J)
Some discussion can be found here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20100531/102160.html. Unfortunately, no real testcase is provided, just abstract scenario description.
Basically a EFLAGS-clobbering instruction is not sunk if EFLAGS might be live out of the current block and since a conditional branch doesn’t mark its EFLAGS use as a kill, that effectively means it is never sunk. But how can that happen? I think the only way for it is when EFLAGS def and use are located in different blocks but that is impossible with current instruction selector. Or am I wrong?
A little later another fix has been made (http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20100614/102554.html) which restricts the problem only to cases when the blocks are produced by lowering a SELECT instruction. It is even more confusing. How is it different from the other scenario wrt. EFLAGS use? Moreover, pseudo cmov is marked as clobbering EFLAGS so how can it be used further in the code?
Are there plans to implement a less conservative fix? I believe proper phys regs liveness information is required for that.