Define a function that takes 2 dictionaries as its parameters and returns a dictionary. The dictionary should have all the keys of the original dictionaries and common keys should have the sum of their values.
Example:
Input
d1 = {'a': 100, 'b': 200, 'c':300}
d2 = {'a': 300, 'b': 200, 'd':400}
Output
{'b': 400, 'd': 400, 'a': 400, 'c': 300}