freebsd-skq/contrib/llvm
Dimitry Andric 12752a4a78 Pull in r224884 from upstream llvm trunk (by Keno Fischer):
[FastIsel][X86] Fix invalid register replacement for bool args

  Summary:
  Consider the following IR:

   %3 = load i8* undef
   %4 = trunc i8 %3 to i1
   %5 = call %jl_value_t.0* @foo(..., i1 %4, ...)
   ret %jl_value_t.0* %5

  Bools (that are the result of direct truncs) are lowered as whatever
  the argument to the trunc was and a "and 1", causing the part of the
  MBB responsible for this argument to look something like this:

   %vreg8<def,tied1> = AND8ri %vreg7<kill,tied0>, 1, %EFLAGS<imp-def>; GR8:%vreg8,%vreg7

  Later, when the load is lowered, it will insert

   %vreg15<def> = MOV8rm %vreg14, 1, %noreg, 0, %noreg; mem:LD1[undef] GR8:%vreg15 GR64:%vreg14

  but remember to (at the end of isel) replace vreg7 by vreg15. Now for
  the bug. In fast isel lowering, we mistakenly mark vreg8 as the result
  of the load instead of the trunc. This adds a fixup to have
  vreg8 replaced by whatever the result of the load is as well, so
  we end up with

   %vreg15<def,tied1> = AND8ri %vreg15<kill,tied0>, 1, %EFLAGS<imp-def>; GR8:%vreg15

  which is an SSA violation and causes problems later down the road.

  This fixes PR21557.

  Test Plan: Test test case from PR21557 is added to the test suite.

  Reviewers: ributzka

  Reviewed By: ributzka

  Subscribers: llvm-commits

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

This fixes a possible assertion failure when compiling toolbox.cxx from
LibreOffice 4.3.5.

Reported by:	kwm
2015-02-07 12:50:33 +00:00
..
include Upgrade our copy of clang and llvm to 3.5.1 release. This is a bugfix 2015-01-18 14:14:47 +00:00
lib Pull in r224884 from upstream llvm trunk (by Keno Fischer): 2015-02-07 12:50:33 +00:00
patches Belatedly add the clang patch corresponding to r277423. 2015-02-02 20:05:52 +00:00
tools Pull in r227062 from upstream clang trunk (by Renato Golin): 2015-01-26 21:19:24 +00:00
utils/TableGen Upgrade our copy of clang and llvm to 3.5.1 release. This is a bugfix 2015-01-18 14:14:47 +00:00
LICENSE.TXT Merge llvm 3.5.0 release from ^/vendor/llvm/dist, resolve conflicts, and 2014-11-24 17:02:24 +00:00