Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hexagon] Suspicious 'dead store' in SplatB pattern #47995

Closed
RKSimon opened this issue Jan 4, 2021 · 2 comments
Closed

[Hexagon] Suspicious 'dead store' in SplatB pattern #47995

RKSimon opened this issue Jan 4, 2021 · 2 comments
Assignees
Labels
backend:Hexagon bugzilla Issues migrated from bugzilla

Comments

@RKSimon
Copy link
Collaborator

RKSimon commented Jan 4, 2021

Bugzilla Link 48651
Resolution FIXED
Resolved on Jan 04, 2021 08:48
Version trunk
OS Windows NT
CC @kparzysz-quic

Extended Description

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);
}]>;

@RKSimon
Copy link
Collaborator Author

RKSimon commented Jan 4, 2021

assigned to @kparzysz-quic

@kparzysz-quic
Copy link

Fixed in https://reviews.llvm.org/rGc55b609b777d.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:Hexagon bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants