llvm-6502/lib
Chandler Carruth 5bce4d8edf [x86] Fix PR20355 (for real). There are many layers to this bug.
The tale starts with r212808 which attempted to fix inversion of the low
and high bits when lowering MUL_LOHI. Sadly, that commit did not include
any positive test cases, and just removed some operations from a test
case where the actual logic being changed isn't fully visible from the
test.

What this commit did was two things. First, it reversed the low and high
results in the formation of the MERGE_VALUES node for the multiple
results. This is entirely correct.

Second it changed the shuffles for extracting the low and high
components from the i64 results of the multiplies to extract them
assuming a big-endian-style encoding of the multiply results. This
second change is wrong. There is no big-endian encoding in x86, the
results of the multiplies are normal v2i64s: when cast to v4i32, the low
i32s are at offsets 0 and 2, and the high i32s are at offsets 1 and 3.

However, the first change wasn't enough to actually fix the bug, which
is (I assume) why the second change was also made. There was another bug
in the MERGE_VALUES formation: we weren't using a VTList, and so were
getting a single result node! When grabbing the *second* result from the
node, we got... well.. colud be anything. I think this *appeared* to
invert things, but had to be causing other problems as well.

Fortunately, I fixed the MERGE_VALUES issue in r213931, so we should
have been fine, right? NOOOPE! Because the core bug was never addressed,
the test in vector-idiv failed when I fixed the MERGE_VALUES node.
Because there are essentially no docs for this node, I had to guess at
how to fix it and tried swapping the operands, restoring the order of
the original code before r212808. While this "fixed" the test case (in
that we produced the write instructions) we were still extracting the
wrong elements of the i64s, and thus PR20355 was still broken.

This commit essentially reverts the big-endian-style extraction part of
r212808 and goes back to the original masks which were correct. Now that
the MERGE_VALUES node formation is also correct, everything works. I've
also included a more detailed test from PR20355 to make sure this stays
fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214011 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-26 03:46:57 +00:00
..
Analysis Add @llvm.assume, lowering, and some basic properties 2014-07-25 21:13:35 +00:00
AsmParser AsmParser: remove deprecated LLIR support 2014-07-23 18:09:31 +00:00
Bitcode Bitcode: Don't optimize constants when preserving use-list order 2014-07-25 16:13:16 +00:00
CodeGen Add @llvm.assume, lowering, and some basic properties 2014-07-25 21:13:35 +00:00
DebugInfo Revert "Introduce a string_ostream string builder facilty" 2014-06-26 22:52:05 +00:00
ExecutionEngine Remove dead code. 2014-07-24 16:02:28 +00:00
IR Fix MSVC2012 build error in UseListOrder.cpp 2014-07-25 16:22:13 +00:00
IRReader Update the MemoryBuffer API to use ErrorOr. 2014-07-06 17:43:13 +00:00
LineEditor [CMake] Use LINK_LIBS instead of target_link_libraries(). 2014-02-26 06:41:29 +00:00
Linker Include <tuple> to make buildbots happy 2014-06-27 18:38:12 +00:00
LTO AArch64: remove arm64 triple enumerator. 2014-07-23 12:32:47 +00:00
MC Reapply "DebugInfo: Don't put fission type units in comdat sections." 2014-07-25 17:11:58 +00:00
Object AArch64: remove arm64 triple enumerator. 2014-07-23 12:32:47 +00:00
Option Generic: add range-adapter for option parsing. 2014-07-09 13:03:37 +00:00
ProfileData coverage: remove empty mapping regions 2014-07-25 22:22:24 +00:00
Support Remove dead code. 2014-07-25 19:06:39 +00:00
TableGen [TableGen] Allow shift operators to take bits<n> 2014-07-17 17:04:27 +00:00
Target [x86] Fix PR20355 (for real). There are many layers to this bug. 2014-07-26 03:46:57 +00:00
Transforms Canonicalization for @llvm.assume 2014-07-25 21:45:17 +00:00
CMakeLists.txt ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00
LLVMBuild.txt ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00
Makefile ProfileData: Introduce the InstrProfReader interface and a text reader 2014-03-21 17:24:48 +00:00