[llvm-bugs] [Bug 48651] New: [Hexagon] Suspicious 'dead store' in SplatB pattern

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 4 04:47:36 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=48651

            Bug ID: 48651
           Summary: [Hexagon] Suspicious 'dead store' in SplatB pattern
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: Hexagon
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: kparzysz at quicinc.com, llvm-bugs at lists.llvm.org

def SplatB: SDNodeXForm<imm, [{
  uint32_t V = N->getZExtValue();
  assert(isUInt<8>(V) || V >> 8 == 0xFFFFFF);
  uint32_t S = V << 24 | V << 16 | V << 8 | V;
  V &= 0xFF;
  return CurDAG->getTargetConstant(S, SDLoc(N), MVT::i32);
}]>;

clang static analyzer reports this as a dead store - but isn't the problem that
we need to mask V's bottom 8 bits before S 'splats' it across the 32-bits:

def SplatB: SDNodeXForm<imm, [{
  uint32_t V = N->getZExtValue();
  assert(isUInt<8>(V) || V >> 8 == 0xFFFFFF);
  V &= 0xFF;
  uint32_t S = V << 24 | V << 16 | V << 8 | V;
  return CurDAG->getTargetConstant(S, SDLoc(N), MVT::i32);
}]>;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210104/dc473f10/attachment-0001.html>


More information about the llvm-bugs mailing list