freebsd-dev/contrib/llvm
Dimitry Andric 1324fa835c Pull in r276136 from upstream llvm trunk (by Wei Mi):
Use ValueOffsetPair to enhance value reuse during SCEV expansion.

  In D12090, the ExprValueMap was added to reuse existing value during
  SCEV expansion. However, const folding and sext/zext distribution can
  make the reuse still difficult.

  A simplified case is: suppose we know S1 expands to V1 in
  ExprValueMap, and
    S1 = S2 + C_a
    S3 = S2 + C_b
  where C_a and C_b are different SCEVConstants. Then we'd like to
  expand S3 as V1 - C_a + C_b instead of expanding S2 literally. It is
  helpful when S2 is a complex SCEV expr and S2 has no entry in
  ExprValueMap, which is usually caused by the fact that S3 is
  generated from S1 after const folding.

  In order to do that, we represent ExprValueMap as a mapping from SCEV
  to ValueOffsetPair. We will save both S1->{V1, 0} and S2->{V1, C_a}
  into the ExprValueMap when we create SCEV for V1. When S3 is
  expanded, it will first expand S2 to V1 - C_a because of S2->{V1,
  C_a} in the map, then expand S3 to V1 - C_a + C_b.

  Differential Revision: https://reviews.llvm.org/D21313

This should fix assertion failures when building OpenCV >= 3.1.

PR:		215649
MFC after:	3 days
2017-01-25 17:59:22 +00:00
..
include Pull in r276136 from upstream llvm trunk (by Wei Mi): 2017-01-25 17:59:22 +00:00
lib Pull in r276136 from upstream llvm trunk (by Wei Mi): 2017-01-25 17:59:22 +00:00
patches Undo r289072, which reverted upstream llvm trunk r240144. This is going 2016-01-16 17:57:54 +00:00
projects/libunwind libunwind: add noexec stack annotation 2017-01-07 14:40:58 +00:00
tools Merge llvm, clang, lld, lldb, compiler-rt and libc++ 3.9.1 release 2016-12-16 18:30:53 +00:00
utils/TableGen Update llvm to release_39 branch r276489, and resolve conflicts. 2016-08-16 21:02:59 +00:00
FREEBSD-Xlist Update FREEBSD-Xlist files for llvm and clang. 2015-05-27 20:58:54 +00:00
LICENSE.TXT Update llvm to release_39 branch r278877. 2016-08-17 19:41:29 +00:00