[DAGCombiner] prevent infinite looping by truncating 'and' (PR40793)
authorSanjay Patel <spatel@rotateright.com>
Thu, 21 Feb 2019 16:01:48 +0000 (16:01 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 21 Feb 2019 16:01:48 +0000 (16:01 +0000)
commitba5ee817e9b54bbe343fc4ac94022f7ab603fcd8
treec31b9a640a0ff85d4b2161a6dde2d9777eafad54
parent16d3e1a4d20ace1d4ba7327dab9873a11348795a
[DAGCombiner] prevent infinite looping by truncating 'and' (PR40793)

This fold can occur during legalization, so it can fight with promotion
to the larger type. It apparently takes a special sequence and subtarget
to avoid more basic simplifications that would hide the problem.

But there's a bigger question raised here: why does distributeTruncateThroughAnd()
even exist? It duplicates functionality from a more minimal pattern that we
already have. But getting rid of this function requires some preliminary steps.

https://bugs.llvm.org/show_bug.cgi?id=40793

llvm-svn: 354594
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/trunc-and.ll [new file with mode: 0644]