freebsd-dev/contrib/llvm/lib
Dimitry Andric fa3c2eba12 Pull in r338481 from upstream llvm trunk (by Chandler Carruth):
[x86] Fix a really subtle miscompile due to a somewhat glaring bug in
  EFLAGS copy lowering.

  If you have a branch of LLVM, you may want to cherrypick this. It is
  extremely unlikely to hit this case empirically, but it will likely
  manifest as an "impossible" branch being taken somewhere, and will be
  ... very hard to debug.

  Hitting this requires complex conditions living across complex
  control flow combined with some interesting memory (non-stack)
  initialized with the results of a comparison. Also, because you have
  to arrange for an EFLAGS copy to be in *just* the right place, almost
  anything you do to the code will hide the bug. I was unable to reduce
  anything remotely resembling a "good" test case from the place where
  I hit it, and so instead I have constructed synthetic MIR testing
  that directly exercises the bug in question (as well as the good
  behavior for completeness).

  The issue is that we would mistakenly assume any SETcc with a valid
  condition and an initial operand that was a register and a virtual
  register at that to be a register *defining* SETcc...

  It isn't though....

  This would in turn cause us to test some other bizarre register,
  typically the base pointer of some memory. Now, testing this register
  and using that to branch on doesn't make any sense. It even fails the
  machine verifier (if you are running it) due to the wrong register
  class. But it will make it through LLVM, assemble, and it *looks*
  fine... But wow do you get a very unsual and surprising branch taken
  in your actual code.

  The fix is to actually check what kind of SETcc instruction we're
  dealing with. Because there are a bunch of them, I just test the
  may-store bit in the instruction. I've also added an assert for
  sanity that ensure we are, in fact, *defining* the register operand.
  =D

Noticed by:	kib
MFC after:	1 week
2018-08-11 10:42:12 +00:00
..
Analysis Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 2018-06-29 17:51:35 +00:00
AsmParser Merge llvm trunk r321017 to contrib/llvm. 2017-12-20 14:16:56 +00:00
BinaryFormat Merge llvm trunk r321017 to contrib/llvm. 2017-12-20 14:16:56 +00:00
Bitcode Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 2018-02-25 13:20:32 +00:00
CodeGen Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 2018-06-29 17:51:35 +00:00
DebugInfo Merge llvm trunk r321414 to contrib/llvm. 2017-12-24 01:04:58 +00:00
Demangle Merge llvm trunk r321414 to contrib/llvm. 2017-12-24 01:04:58 +00:00
ExecutionEngine Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 2018-06-29 17:51:35 +00:00
FuzzMutate Merge llvm trunk r321414 to contrib/llvm. 2017-12-24 01:04:58 +00:00
IR Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 2018-06-29 17:51:35 +00:00
IRReader Merge llvm trunk r321017 to contrib/llvm. 2017-12-20 14:16:56 +00:00
LineEditor Update llvm to release_39 branch r276489, and resolve conflicts. 2016-08-16 21:02:59 +00:00
Linker Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 2018-01-24 22:35:00 +00:00
LTO Merge llvm, clang, lld, lldb, compiler-rt and libc++ trunk r321545, 2017-12-29 00:56:15 +00:00
MC Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 2018-06-29 17:51:35 +00:00
Object Pull in r327101 from upstream llvm trunk (by Rafael Espindola): 2018-03-22 18:58:34 +00:00
ObjectYAML Merge llvm trunk r321414 to contrib/llvm. 2017-12-24 01:04:58 +00:00
Option Merge llvm trunk r321017 to contrib/llvm. 2017-12-20 14:16:56 +00:00
Passes Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_60 r321788, 2018-01-06 23:44:14 +00:00
ProfileData Merge llvm, clang, lld, lldb, compiler-rt and libc++ trunk r321545, 2017-12-29 00:56:15 +00:00
Support Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 2018-06-29 17:51:35 +00:00
TableGen Merge llvm, clang, lld, lldb, compiler-rt and libc++ trunk r321545, 2017-12-29 00:56:15 +00:00
Target Pull in r338481 from upstream llvm trunk (by Chandler Carruth): 2018-08-11 10:42:12 +00:00
Testing/Support Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305575, and update 2017-06-17 00:09:34 +00:00
ToolDrivers Merge llvm trunk r321017 to contrib/llvm. 2017-12-20 14:16:56 +00:00
Transforms Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 2018-06-29 17:51:35 +00:00
WindowsManifest Merge llvm trunk r321017 to contrib/llvm. 2017-12-20 14:16:56 +00:00
XRay Merge llvm trunk r321017 to contrib/llvm. 2017-12-20 14:16:56 +00:00