Go to file
Craig Topper d4e37afe45 [DAGCombiner] Discard pointer info when combining extract_vector_elt of a vector load when the index isn't constant
Summary:
If the index isn't constant, this transform inserts a multiply and an add on the index to calculating the base pointer for a scalar load. But we still create a memory operand with an offset of 0 and the size of the scalar access. But the access is really to an unknown offset within the original access size.

This can cause the machine scheduler to incorrectly calculate dependencies between this load and other accesses. In the case we saw, there was a 32 byte vector store that was split into two 16 byte stores, one with offset 0 and one with offset 16. The size of the memory operand for both was 16. The scheduler correctly detected the alias with the offset 0 store, but not the offset 16 store.

This patch discards the pointer info so we don't incorrectly detect aliasing. I wasn't sure if we could keep using the original offset and size without risking some other transform on the load changing the size.

I tried to reduce a test case, but there's still a lot of memory operations needed to get the scheduler to do the bad reordering. So it looked pretty fragile to maintain.

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 353124
2019-02-05 00:22:23 +00:00
clang [Sanitizers] UBSan unreachable incompatible with Kernel ASan 2019-02-04 23:37:50 +00:00
clang-tools-extra [clang-tidy] Handle unions with existing default-member-init 2019-02-04 21:09:31 +00:00
compiler-rt [tsan] Disable fgetpwent_r to work around performance issues 2019-02-04 23:25:55 +00:00
debuginfo-tests Set config.lit_tools_dir, which is needed by lit.llvm.initialize. 2018-11-06 21:54:27 +00:00
libclc Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
libcxx Support tests in freestanding 2019-02-04 20:31:13 +00:00
libcxxabi [CMake] Support CMake variables for setting target, sysroot and toolchain 2019-02-04 20:02:26 +00:00
libunwind [CMake] Support CMake variables for setting target, sysroot and toolchain 2019-02-04 20:02:26 +00:00
lld [WebAssembly] Update test to match new readobj output. NFC. 2019-02-04 22:34:07 +00:00
lldb Update stale comment in lang/c/struct_types/main.c 2019-02-04 20:33:35 +00:00
llgo Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
llvm [DAGCombiner] Discard pointer info when combining extract_vector_elt of a vector load when the index isn't constant 2019-02-05 00:22:23 +00:00
openmp [OMPT] Make sure that OMPT is enabled when accessing internals of the runtime 2019-02-04 15:59:42 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
pstl Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.