After reducing the size of an operation in the DAG we zero-extend the reduced
authorNadav Rotem <nrotem@apple.com>
Wed, 19 Dec 2012 07:39:08 +0000 (07:39 +0000)
committerNadav Rotem <nrotem@apple.com>
Wed, 19 Dec 2012 07:39:08 +0000 (07:39 +0000)
commit33360d8ae92e5b2a48bc83f0d0358093a61101df
tree7646c6d01cb30bb42c1c9e88f20ad8ff4e242495
parentaf14a3f20b5a7facebfa58e8ac87581b535747ce
After reducing the size of an operation in the DAG we zero-extend the reduced
bitwidth op back to the original size. If we reduce ANDs then this can cause
an endless loop. This patch changes the ZEXT to ANY_EXTEND if the demanded bits
are equal or smaller than the size of the reduced operation.

llvm-svn: 170505
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/Generic/dag-combine-crash.ll [new file with mode: 0644]