bug fix for PR20020: anti-dependency-breaker causes miscompilation
authorSanjay Patel <spatel@rotateright.com>
Thu, 3 Jul 2014 15:19:40 +0000 (15:19 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 3 Jul 2014 15:19:40 +0000 (15:19 +0000)
commitdc574ab50038b2568016cff95cde3a9a758ef495
tree50d77f2e86012e409d1bbf82f038783674f3e685
parentf236bb1b5bea26acbcb39f8232e64c638904bc82
bug fix for PR20020: anti-dependency-breaker causes miscompilation

This patch sets the 'KeepReg' bit for any tied and live registers during the PrescanInstruction() phase of the dependency breaking algorithm. It then checks those 'KeepReg' bits during the ScanInstruction() phase to avoid changing any tied registers. For more details, please see comments in:
http://llvm.org/bugs/show_bug.cgi?id=20020

I added two FIXME comments for code that I think can be removed by using register iterators that include self. I don't want to include those code changes with this patch, however, to keep things as small as possible.

The test case is larger than I'd like, but I don't know how to reduce it further and still produce the failing asm.

Differential Revision: http://reviews.llvm.org/D4351

llvm-svn: 212275
llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp
llvm/test/CodeGen/X86/pr20020.ll [new file with mode: 0644]