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

Sanjay Patel spatel at rotateright.com
Wed Jul 2 14:11:38 PDT 2014


Updated patch to only set KeepRegs[reg] when a reg is tied AND live. This allows the existing Atom test case to work as expected.
This patch should make the code strictly safer (do less work) and avoid PR20020 while preserving all existing regression test behavior.

I removed the assert() that was in the previous draft because there is one existing test (test/Codegen/X86/select.ll - test17) where it would still fire. This is because that test has an instruction with a tied op, but we don't set KeepRegs for it because we only change the Classes[] value for the reg after-the-fact based on a register that aliases it around this code:
      // If an alias of the reg is used during the live range, give up.

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.11034.patch
Type: text/x-patch
Size: 6075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140702/01f590dc/attachment.bin>


More information about the llvm-commits mailing list