[all-commits] [llvm/llvm-project] de56a8: [AMDGPU] return Fail instead of SolfFail from addO...

Stanislav Mekhanoshin via All-commits all-commits at lists.llvm.org
Tue Nov 5 10:25:36 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: de56a890725713dffc4ab5bf5fb2f434df27ed4d
      https://github.com/llvm/llvm-project/commit/de56a890725713dffc4ab5bf5fb2f434df27ed4d
  Author: Stanislav Mekhanoshin <Stanislav.Mekhanoshin at amd.com>
  Date:   2019-11-05 (Tue, 05 Nov 2019)

  Changed paths:
    M llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
    A llvm/test/MC/Disassembler/AMDGPU/decode-err.txt

  Log Message:
  -----------
  [AMDGPU] return Fail instead of SolfFail from addOperand()

addOperand() method of AMDGPU disassembler returns SoftFail
on error. All instances which may lead to that place are
an impossible encdoing, not something which is possible to
encode, but semantically incorrect as described for SoftFail.

Then tablegen generates a check of the following form:

if (Decode...(..) == MCDisassembler::Fail) { return MCDisassembler::Fail; }

Since we can only return Success and SoftFail that is dead
code as detected by the static code analyzer.

Solution: return Fail as it should be.

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

Differential Revision: https://reviews.llvm.org/D69819




More information about the All-commits mailing list