[X86] Don't use CombineTo to skip adding new nodes to the DAGCombiner worklist in...
authorCraig Topper <craig.topper@intel.com>
Thu, 26 Jul 2018 05:40:10 +0000 (05:40 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 26 Jul 2018 05:40:10 +0000 (05:40 +0000)
commit4e687d5bb2b9a4dcde599b2563a5edc1aff44e62
treea490fe3384256bd45d2ac3a6baac1faa73f25d7c
parent4b59ed4001dd34f193410b561af001fbee4c2690
[X86] Don't use CombineTo to skip adding new nodes to the DAGCombiner worklist in combineMul.

I'm not sure if this was trying to avoid optimizing the new nodes further or what. Or maybe to prevent a cycle if something tried to reform the multiply? But I don't think its a reliable way to do that. If the user of the expanded multiply is visited by the DAGCombiner after this conversion happens, the DAGCombiner will check its operands, see that they haven't been visited by the DAGCombiner before and it will then add the first node to the worklist. This process will repeat until all the new nodes are visited.

So this seems like an unreliable prevention at best. So this patch just returns the new nodes like any other combine. If this starts causing problems we can try to add target specific nodes or something to more directly prevent optimizations.

Now that we handle the combine normally, we can combine any negates the mul expansion creates into their users since those will be visited now.

llvm-svn: 338007
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/mul-constant-i32.ll