[PATCH] D86878: [AMDGPU] Fix a miscompile with S_ADD/S_SUB

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 08:30:17 PDT 2020


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:1059-1063
+      bool SkipMasking = (Opc == ISD::SETCC || Opc == AMDGPUISD::FP_CLASS);
+      SkipMasking |= (Opc == ISD::AND || Opc == ISD::OR || Opc == ISD::XOR) &&
+                     (CI->getOperand(0).getOpcode() == ISD::SETCC &&
+                      CI->getOperand(1).getOpcode() == ISD::SETCC);
+
----------------
piotr wrote:
> arsenm wrote:
> > Should reuse isBoolSGPR
> isBoolSGPR() does not work for my case - I need to distinguish between two groups (AND/OR/XOR) and (SETCC/FP_CLASS), but that function returns true for both.
Currently isBoolSGPR returns true for any and/or/xor, without recursively checking that the operands are boolean. But perhaps it should be fixed? Then you could use it here too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86878/new/

https://reviews.llvm.org/D86878



More information about the llvm-commits mailing list