[PATCH] D88026: [X86][SSE2] Follow up patch for D87236 to avoid the regression regarding horizontal unsigned 16 bit minimums and maximums.

Tom Hender via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 08:34:10 PDT 2020


TomHender created this revision.
TomHender added reviewers: RKSimon, craig.topper.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
TomHender requested review of this revision.

This is a follow up patch for D87236 <https://reviews.llvm.org/D87236> based on the comments about the test regressions.

The new code is even slightly better than it was originally because the first sign bit flip is pulled before the first shuffle. Maybe this should also be done for lowering for 8 bit signed minimums and maximums.

An entirely alternative approach to fix the regression might be to switch to the "sign bit flip" method depending on some heuristic based on the number of chained UMIN/UMAX instructions. For example when calculating the median of 3 integers via max(min(x, y), min(max(x, y), z)), we also want to use the old way, I think. However this is more complex to implement.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88026

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/horizontal-reduce-umax.ll
  llvm/test/CodeGen/X86/horizontal-reduce-umin.ll
  llvm/test/CodeGen/X86/vector-reduce-umax.ll
  llvm/test/CodeGen/X86/vector-reduce-umin.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88026.293176.patch
Type: text/x-patch
Size: 35445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200921/befccfc4/attachment.bin>


More information about the llvm-commits mailing list