Details
- Reviewers
arsenm vpykhtin - Commits
- rG9ef166e65748: [AMDGPU] Fix FoldImmediate for 16 bit operand
Diff Detail
Event Timeline
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | ||
---|---|---|
2514 | I think just checking op 0 is sufficient | |
llvm/test/CodeGen/AMDGPU/fold_16bit_imm.mir | ||
1 | Probably should generate these checks | |
12 | Adding a use instruction for all of these wouldn't hurt in case peephole-opt ever decides to prune dead instructions | |
109 | Needs test with skipped hi16 |
Addressed review comments.
Added processing of hi16 src subreg, it is just an imm shift.
Always drop target flags on source operand. SubReg and TargetFlags share the same field changing the meaning depending on the operand type. If I do not drop it I get something like:
S_MOV_B32 target-flags(amdgpu-gotprel32-lo) 2048
Technically it could happen with 32 subregs as well, although does not seem to happen.
I think just checking op 0 is sufficient