[PATCH] D86878: [AMDGPU] Fix a miscompile in add combine

Piotr Sobczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 31 08:30:05 PDT 2020


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

The Add/Sub combine removes a zext when present on a boolean operation,
which is not safe if the resultant addcarry stays in sgpr (is not
moved to vgpr during si-fix-sgpr-copies). In the abscence of v_cndmask
that is normally generated for such an zext, the resultant vcc can have
bits set for inactive lanes which can produce wrong results.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86878

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86878.288955.patch
Type: text/x-patch
Size: 4518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200831/3dc6fd63/attachment.bin>


More information about the llvm-commits mailing list