[PATCH] D25485: [x86] use 'neg' for negation of bool

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 14:03:43 PDT 2016


spatel created this revision.
spatel added reviewers: hfinkel, zvi, delena, mkuper.
spatel added a subscriber: llvm-commits.
Herald added a subscriber: mcrosier.

Given that this is a common pattern for any ISA that has a 'neg' instruction ( https://llvm.org/bugs/show_bug.cgi?id=30660, https://llvm.org/bugs/show_bug.cgi?id=30661 ), ideally I don't think this should be an x86-specific solution?

But I had problems trying to make this happen as a 'combine' rather than a 'lower' (it interfered with other pattern matching), so this is a minimal solution to hopefully allow progress on adding other transforms for selects of constants.


https://reviews.llvm.org/D25485

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/negate-i1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25485.74289.patch
Type: text/x-patch
Size: 4373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161011/7d8af1be/attachment.bin>


More information about the llvm-commits mailing list