Index: llvm/lib/Target/AMDGPU/SOPInstructions.td =================================================================== --- llvm/lib/Target/AMDGPU/SOPInstructions.td +++ llvm/lib/Target/AMDGPU/SOPInstructions.td @@ -558,19 +558,19 @@ >; def S_NAND_B32 : SOP2_32 <"s_nand_b32", - [(set i32:$sdst, (not (and_oneuse i32:$src0, i32:$src1)))] + [(set i32:$sdst, (UniformUnaryFrag (and_oneuse i32:$src0, i32:$src1)))] >; def S_NAND_B64 : SOP2_64 <"s_nand_b64", - [(set i64:$sdst, (not (and_oneuse i64:$src0, i64:$src1)))] + [(set i64:$sdst, (UniformUnaryFrag (and_oneuse i64:$src0, i64:$src1)))] >; def S_NOR_B32 : SOP2_32 <"s_nor_b32", - [(set i32:$sdst, (not (or_oneuse i32:$src0, i32:$src1)))] + [(set i32:$sdst, (UniformUnaryFrag (or_oneuse i32:$src0, i32:$src1)))] >; def S_NOR_B64 : SOP2_64 <"s_nor_b64", - [(set i64:$sdst, (not (or_oneuse i64:$src0, i64:$src1)))] + [(set i64:$sdst, (UniformUnaryFrag (or_oneuse i64:$src0, i64:$src1)))] >; } // End isCommutable = 1 Index: llvm/lib/Target/AMDGPU/VOP3Instructions.td =================================================================== --- llvm/lib/Target/AMDGPU/VOP3Instructions.td +++ llvm/lib/Target/AMDGPU/VOP3Instructions.td @@ -667,6 +667,14 @@ def : VOPBinOpClampPat; def : VOPBinOpClampPat; +def : GCNPat<(getDivergentFrag.ret (or_oneuse i64:$src0, i64:$src1), i64:$src2), + (REG_SEQUENCE VReg_64, + (V_OR3_B32_e64 (i32 (EXTRACT_SUBREG $src0, sub0)), + (i32 (EXTRACT_SUBREG $src1, sub0)), + (i32 (EXTRACT_SUBREG $src2, sub0))), sub0, + (V_OR3_B32_e64 (i32 (EXTRACT_SUBREG $src0, sub1)), + (i32 (EXTRACT_SUBREG $src1, sub1)), + (i32 (EXTRACT_SUBREG $src2, sub1))), sub1)>; // FIXME: Probably should hardcode clamp bit in pseudo and avoid this. class OpSelBinOpClampPat