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); }]>;
Fixed in https://reviews.llvm.org/rGc55b609b777d.