[PATCH] Add intrinsic definitions for unary op AVX instructions [x86]

Sanjay Patel spatel at rotateright.com
Wed Feb 18 16:41:32 PST 2015


Patch updated to include new intrinsics in the memory folding table. Also added AVX test cases for load folding of each unary op.

In the interest of patch minimalism, I'm not fixing the SSE variants of these in this patch. The loads in the new test cases are not getting folded without -mattr=avx. Presumably this is because we don't have patterns to match those and/or the load folding tables have holes. It's still not clear to me exactly when the pattern is matched vs. peephole pass load folding is needed.

I also did not add the new intrinsics to the switch in hasUndefRegUpdate(). Please correct me if I'm misunderstanding, but these additions are AVX-only and don't have any partial update problem. It seems like a bug to me that the existing AVX unop instructions are in that switch because the destination register is not partially updated - the 2nd source operand high bits are passed through, so the destination register is always fully updated.


http://reviews.llvm.org/D6958

Files:
  lib/Target/X86/X86InstrInfo.cpp
  lib/Target/X86/X86InstrSSE.td
  test/CodeGen/X86/fold-load-unops.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6958.20234.patch
Type: text/x-patch
Size: 7352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150219/20dfa844/attachment.bin>


More information about the llvm-commits mailing list