[SDAG] Handle LowerOperation returning its input consistently
authorHal Finkel <hfinkel@anl.gov>
Tue, 24 Feb 2015 12:59:47 +0000 (12:59 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 24 Feb 2015 12:59:47 +0000 (12:59 +0000)
commitcccfe54933eb66c64ff1767a0894b2a638fa29cb
tree4c9e5580dfe834d3a251a118700f28ff594dada4
parent41ecf2b99e5c855611c9d80d499b67a183605d9f
[SDAG] Handle LowerOperation returning its input consistently

For almost all node types, if the target requested custom lowering, and
LowerOperation returned its input, we'd treat the original node as legal. This
did not work, however, for many loads and stores, because they follow
slightly different code paths, and we did not account for the possibility of
LowerOperation returning its input at those call sites.

I think that we now handle this consistently everywhere. At the call sites in
LegalizeDAG, we used to assert in this case, so there's no functional change
for any existing code there. For the call sites in LegalizeVectorOps, this
really only affects whether or not we set Changed = true, but I think makes the
semantics clearer.

No test case here, but it will be covered by an upcoming PowerPC commit adding
QPX support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230332 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp