SelectionDAG: Cleanup and simplify FoldConstantArithmetic
authorMatthias Braun <matze@braunis.de>
Tue, 19 May 2015 01:40:21 +0000 (01:40 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 19 May 2015 01:40:21 +0000 (01:40 +0000)
commit42cff157db9cef189027dc30645c768f632656c4
treef4b4d368e7d782f54be3f2e99cc3473deeb61d50
parentbf27e11e02798832e4d55ff0e3e0368b06ae8895
SelectionDAG: Cleanup and simplify FoldConstantArithmetic

This cleans up the FoldConstantArithmetic code by factoring out the case
of two ConstantSDNodes into an own function. This avoids unnecessary
complexity for many callers who already have ConstantSDNode arguments.

This also avoids an intermeidate SmallVector datastructure and a loop
over that datastructure.

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