[all-commits] [llvm/llvm-project] 05b765: [DXIL] [NFC] Remove dead attribute code paths

Chris B via All-commits all-commits at lists.llvm.org
Wed Apr 27 08:47:16 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 05b765ff69959d546765a001b6e5058cbbea2399
      https://github.com/llvm/llvm-project/commit/05b765ff69959d546765a001b6e5058cbbea2399
  Author: Chris Bieneman <cbieneman at microsoft.com>
  Date:   2022-04-27 (Wed, 27 Apr 2022)

  Changed paths:
    M llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp

  Log Message:
  -----------
  [DXIL] [NFC] Remove dead attribute code paths

DXIL doesn't support attributes added after LLVM 3.7. The DXILPrepare
pass removes those attributes so they should never be present by the
time we reach the DXIL bitcode writer.

In the event that we somehow try to write a newer attribute in the DXIL
writer, we should fail hard (crash), because the output would be
invalid. This case should only be possible if the DXIL writer were
called without DXILPrepare being run first, which shouldn't be possible.

This patch also adds a default case to the switch statement over the
attribute list which covers all the removed cases and any new attribute
kinds that may be added in the future. The default case is handled like
other unsupported cases by a call to llvm_unreachable.




More information about the All-commits mailing list