[InstCombine] trunc (binop X, C) --> binop (trunc X, C')

Note that one-use and shouldChangeType() are checked ahead of the switch.

Without the narrowing folds, we can produce inferior vector code as shown in PR35299:
https://bugs.llvm.org/show_bug.cgi?id=35299



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318323 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed