[PATCH] D12377: [NVPTX] Let NVPTX backend detect integer min and max patterns.

Bjarke Hammersholt Roune via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 16:14:29 PDT 2015


broune marked an inline comment as done.
broune added a comment.

In http://reviews.llvm.org/D12377#233658, @arsenm wrote:

> If you make the generic min/max nodes legal, you don't need to do this pattern matching yourself


Thanks for the tip and, yes, using the generic min/max nodes would have been my preferred solution. However, I couldn't find documentation that clearly explained how tablegen for NVPTX exactly works and it seemed like I'd need to use tablegen to tell LLVM how to emit code from the generic min/max. Also, the generic code for detecting min/max patterns that I found was in DAGCombiner, which only works for floating point and not, as here, for integers, so I'd have to add that and ensure that I didn't mess up any other backend. DAGCombiner also requires hasOneUse() for the condition, which is not what I wanted here. The direct solution here was by comparison quite straightforward, so this time I decided to go for the easy solution.


http://reviews.llvm.org/D12377





More information about the llvm-commits mailing list