[PATCH] bug fix for PR20020: anti-dependency-breaker causes miscompilation

Sanjay Patel spatel at rotateright.com
Mon Jun 30 14:56:29 PDT 2014


Hi hfinkel, atrick,

This patch sets the 'KeepReg' bit for any tied 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

The existing code also uses the 'Classes' variable as a marker for registers that shouldn't be changed (by setting the value to -1). If someone can explain why we need two data structures to mark unusable regs, I'd love to understand that.

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.

http://reviews.llvm.org/D4351

Files:
  lib/CodeGen/CriticalAntiDepBreaker.cpp
  test/CodeGen/X86/pr20020.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4351.10985.patch
Type: text/x-patch
Size: 5908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140630/3022345f/attachment.bin>


More information about the llvm-commits mailing list