aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-02-18 07:13:48 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-02-18 07:13:48 +0000
commit55553f52993664cfccf859af04861b32520084af (patch)
tree64c467b59417c381e769f8110bc3f6f528c8dfb1 /llvm/lib/CodeGen/MachineBlockPlacement.cpp
parent1348f1720519aa48bbf65a1d498a08d4ca029465 (diff)
downloadllvm-55553f52993664cfccf859af04861b32520084af.zip
llvm-55553f52993664cfccf859af04861b32520084af.tar.gz
llvm-55553f52993664cfccf859af04861b32520084af.tar.bz2
[x86] Rewrite the byte shift detection to not use boolean variables to
track state. I didn't like this in the code review because the pattern tends to be error prone, but I didn't see a clear way to rewrite it. Turns out that there were bugs here, I found them when fuzz testing our shuffle lowering for correctness on x86. The core of the problem is that we need to consistently test all our preconditions for the same directionality of shift and the same input vector. Instead, formulate this as two predicates (one doesn't depend on the input in any way), pass things like the directionality and input vector as inputs, and loop over the alternatives. This fixes a pattern of very rare miscompiles coming out of this code. Turned up roughly 4 out of every 1 million v8 shuffles in my fuzz testing. The new code is over half a million test runs with no failures yet. I've also fuzzed every other function in the lowering code with over 3.5 million test cases and not discovered any other miscompiles. llvm-svn: 229642
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
0 files changed, 0 insertions, 0 deletions