llvm-6502/test
Chandler Carruth bfed08e41f [x86] Start fixing a really subtle and terrible form of miscompile in
these DAG combines.

The DAG auto-CSE thing is truly terrible. Due to it, when RAUW-ing
a node with its operand, you can cause its uses to CSE to itself, which
then causes their uses to become your uses which causes them to be
picked up by the RAUW. For nodes that are determined to be "no-ops",
this is "fine". But if the RAUW is one of several steps to enact
a transformation, this causes the DAG to really silently eat an discard
nodes that you would never expect. It took days for me to actually
pinpoint a test case triggering this and a really frustrating amount of
time to even comprehend the bug because I never even thought about the
ability of RAUW to iteratively consume nodes due to CSE-ing them into
itself.

To fix this, we have to build up a brand-new chain of operations any
time we are combining across (potentially) intervening nodes. But once
the logic is added to do this, another issue surfaces: CombineTo eagerly
deletes the one node combined, *but no others*. This is... really
frustrating. If deleting it makes its operands become dead, those
operand nodes often won't go onto the worklist in the
order you would want -- they're already on it and not near the top. That
means things higher on the worklist will get combined prior to these
dead nodes being GCed out of the worklist, and if the chain is long, the
immediate users won't be enough to re-detect where the root of the chain
is that became single-use again after deleting the dead nodes. The
better way to do this is to never immediately delete nodes, and instead
to just enqueue them so we can recursively delete them. The
combined-from node is typically not on the worklist anyways by virtue of
having been popped off.... But that in turn breaks other tests that
*require* CombineTo to delete unused nodes. :: sigh ::

Fortunately, there is a better way. This whole routine should have been
returning the replacement rather than using CombineTo which is quite
hacky. Switch to that, and all the pieces fall together.

I suspect the same kind of miscompile is possible in the half-shuffle
folding code, and potentially the recursive folding code. I'll be
switching those over to a pattern more like this one for safety's sake
even though I don't immediately have any test cases for them. Note that
the only way I got a test case for this instance was with *heavily* DAG
combined 256-bit shuffle sequences generated by my fuzzer. ;]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216319 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 10:25:15 +00:00
..
Analysis
Assembler IR: Implement uselistorder assembly directives 2014-08-19 21:30:15 +00:00
Bindings
Bitcode verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
BugPoint
CodeGen [x86] Start fixing a really subtle and terrible form of miscompile in 2014-08-23 10:25:15 +00:00
DebugInfo Use DILexicalBlockFile, rather than DILexicalBlock, to track discriminator changes to ensure discriminator changes don't introduce new DWARF DW_TAG_lexical_blocks. 2014-08-21 22:45:21 +00:00
ExecutionEngine [MCJIT] Add an i386 RuntimeDyldMachO test case. 2014-08-19 21:26:36 +00:00
Feature
FileCheck
Instrumentation [dfsan] Fix non-determinism bug in non-zero label check annotator. 2014-08-22 01:18:18 +00:00
Integer
JitListener
Linker Set comdats when lazily linking functions. 2014-08-15 20:17:08 +00:00
LTO
MC [mips] Add assembler support for .set arch=x directive. 2014-08-19 14:22:52 +00:00
Object llvm-objdump: don't print relocations in non-relocatable files. 2014-08-17 19:09:37 +00:00
Other
TableGen llvm/test/TableGen/*Foreach*.td: Remove XFAIL:vg_leak. They have not been failing since r215176. 2014-08-12 14:06:21 +00:00
tools llvm-cov: test: add xfail for the big-endian buildbots 2014-08-23 00:47:24 +00:00
Transforms Add a test case for SROA where the store size is bigger than slice size. The 2014-08-22 23:27:04 +00:00
Unit
Verifier
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg
lit.site.cfg.in
Makefile Delete support for AuroraUX. 2014-08-14 15:15:09 +00:00
Makefile.tests
TestRunner.sh