This patch is based on the D71178.
We have disscussion here:
https://discourse.llvm.org/t/always-extend-the-integer-parameters-of-callee/61319.
We want to make clang behave just like gcc to avoid compatibility issues
between different compilers. We can't remove zeroext/signext on the front-end,
which will cause compatibility issues between the new clang and the previous clang.
There are many test cases waiting to be fixed. I put this patch here to see if
we can do this.
If you check hasLocalLinkage here, I believe we also need to check hasAddressTaken...
However, I think such optimizations should be done in llvm/lib/Transforms/IPO/*.cpp. instead of here.