[llvm] [NVPTX] Propagate truncate to operands (PR #98666)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 15 13:31:52 PDT 2024
Artem-B wrote:
> It expects one of the parameters of the binop to be constant.
I see. I guess the assumption is that if one of the argument is a constant, then truncation for it is free, so it never increases the number of truncates and assumes that the logical op is the same cost, regardless of the size.
I think adding a new target-specific check here would be appropriate. Considering that register pressure is a pretty common issue for NVPTX, something fairly generic like `TLI.shouldReduceRegisterPressure()` may be useful here and likely in other places where we may need to adjust optimizer assumptions for NVPTX.
https://github.com/llvm/llvm-project/pull/98666
More information about the llvm-commits
mailing list