[all-commits] [llvm/llvm-project] 4e3ede: Use pragmas to work around MSVC x86_32 debug misco...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Thu Sep 10 14:50:24 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e3edef4b8b637c0c76897497eb7c66f00157210
      https://github.com/llvm/llvm-project/commit/4e3edef4b8b637c0c76897497eb7c66f00157210
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
    M llvm/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp

  Log Message:
  -----------
  Use pragmas to work around MSVC x86_32 debug miscompile bug

Halide users reported this here: https://llvm.org/pr46176
I reported the issue to MSVC here:
https://developercommunity.visualstudio.com/content/problem/1179643/msvc-copies-overaligned-non-trivially-copyable-par.html

This codepath is apparently not covered by LLVM's unit tests, so I added
coverage in a unit test.

If we want to support this configuration going forward, it means that is
in general not safe to pass a SmallVector<T, N> by value if alignof(T)
is greater than 4. This doesn't appear to come up often because passing
a SmallVector by value is inefficient and not idiomatic: it copies the
inline storage. In this case, the SmallVector<LLT,4> is captured by
value by a lambda, and the lambda is passed by value into std::function,
and that's how we hit the bug.

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




More information about the All-commits mailing list