[all-commits] [llvm/llvm-project] d01470: [llvm][Mips] Use a Target ISD opcode for PseudoD_S...

Roger Ferrer Ibáñez via All-commits all-commits at lists.llvm.org
Tue Mar 12 17:30:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d014708a217beaef04f9533d311c68bda71a52f7
      https://github.com/llvm/llvm-project/commit/d014708a217beaef04f9533d311c68bda71a52f7
  Author: Roger Ferrer Ibáñez <roger.ferrer at bsc.es>
  Date:   2024-03-13 (Wed, 13 Mar 2024)

  Changed paths:
    M llvm/lib/Target/Mips/MipsISelLowering.cpp
    M llvm/lib/Target/Mips/MipsISelLowering.h
    M llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp

  Log Message:
  -----------
  [llvm][Mips] Use a Target ISD opcode for PseudoD_SELECT (#84294)

The Mips target uses two TargetOpcode enumerators called
`PseudoD_SELECT_I` and `PseudoD_SELECT_I64`. A SDAG node is created
using these enumerators which is manually selected in
`MipsSEISelDAGToDAG.cpp` and ultimately expanded in
`EmitInstrWithCustomInserter` in `MipsISelLowering.cpp`.

This is not causing any upstream build to fail at the moment but it is
not guaranteed that these enumerators do not clash with Target ISD nodes
(i.e. those in the `MipsISD` namespace). We have seen this happening in
our downstream builds in which `Mips::PseudoD_SELECT_I` ends having the
same integer value as `MipsISD::VEXTRACT_ZEXT_ELT`. This confuses the
function `trySelect` in `MipsSEISelDAGToDAG.cpp` and causes a crash in 3
tests.

This change adds a new Target ISD opcode for these two cases and uses
them for the SDAG nodes. No test is included because this is a potential
error in the future not one that can be demonstrated in the current
codebase.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list