[PATCH] D70978: Revert "AMDGPU: Try to commute sub of boolean ext"

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 13:02:34 PST 2019


tpr created this revision.
Herald added subscribers: llvm-commits, hiraditya, t-tye, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, arsenm.
Herald added a project: LLVM.

This reverts commit 69fcfb7d3597e0cdb5554b4e672e9032b411b167 <https://reviews.llvm.org/rG69fcfb7d3597e0cdb5554b4e672e9032b411b167>.

As shown in the test I attached to this commit, the change I reverted
causes a problem with "zext(cc1) - zext(cc2)". It commuted
the operands to the sub and used different logic to select the addc/subc
instruction:

  sub zext (setcc), x => addcarry 0, x, setcc
  sub sext (setcc), x => subcarry 0, x, setcc

... but that is bogus. I believe it is not possible to fold those commuted
patterns into any form of addcarry or subcarry. It may have worked as
intended before "AMDGPU: Change boolean content type to 0 or 1" because
the setcc was considered to be -1 rather than 1.

Change-Id: If2139421aa6c935cbd1d925af58fe4a4aa9e8f43


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70978

Files:
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/test/CodeGen/AMDGPU/combine-cond-add-sub.ll
  llvm/test/CodeGen/AMDGPU/sub-zext-cc-zext-cc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70978.231967.patch
Type: text/x-patch
Size: 5015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191203/2d85bf47/attachment.bin>


More information about the llvm-commits mailing list