[DAGCombiner] Fix a regression in method SimplifyVBinOp accidentally introduced by r199135.

Juergen Ributzka juergen at apple.com
Wed Jan 15 11:07:22 PST 2014


Hi Andrea,

that was a big think-o on my side. Thanks for catching this.

In your patch the test case only checks if the code compiles. In this case we don't really need the FileCheck.
Otherwise the patch LGTM.

Cheers,
Juergen

On Jan 15, 2014, at 4:50 AM, Andrea Di Biagio <andrea.dibiagio at gmail.com> wrote:

> Hi,
> 
> this patch fixes a bug introduced by revision 199135 in method
> DAGCombiner::SimplifyVBinOp'.
> 
> Revision 199135 tried to simplify part of the logic in method
> DAGCombiner::SimplifyVBinOp' introducing calls to method
> 'BuildVectorSDNode::isConstant().
> 
> However, that revision wrongly changed the check performed by method
> DAGCombiner::SimplifyVBinOp to identify dag nodes that can be folded.
> 
> Before revision 199135, that method only tried to simplify vector
> binary operations if both operands were build_vector of
> Constant/ConstantFP/Undef only.
> 
> After revision 199135, method 'SimplifyVBinOp' behaves differently; it
> attempts to simplify vector binary operations even if only one of the
> two operands is a constant.
> 
> The regression was originally reported by Patrik Hägglund H.
> I reduced the original test case provided by Patrik and adapted it to
> the regression suite (see file
> test/CodeGen/X86/vbinop-simplify-bug.ll).
> 
> Please let me know if ok to submit.
> 
> Thanks,
> Andrea Di Biagio
> SN Systems - Sony Computer Entertainment Group.
> <patch-simplify-vbinop.diff>





More information about the llvm-commits mailing list