[all-commits] [llvm/llvm-project] 35def3: [GlobalIsel][X86] Regenerate legalize-phi.mir

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Jun 13 02:43:32 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 35def3034f1e94e9ea461335a8029147539fc355
      https://github.com/llvm/llvm-project/commit/35def3034f1e94e9ea461335a8029147539fc355
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2023-06-13 (Tue, 13 Jun 2023)

  Changed paths:
    M llvm/test/CodeGen/X86/GlobalISel/legalize-phi.mir

  Log Message:
  -----------
  [GlobalIsel][X86] Regenerate legalize-phi.mir


  Commit: 7fcc35b7a389058149b92be3de26548c76bed752
      https://github.com/llvm/llvm-project/commit/7fcc35b7a389058149b92be3de26548c76bed752
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2023-06-13 (Tue, 13 Jun 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86LegalizerInfo.cpp

  Log Message:
  -----------
  [GlobalIsel][X86] Update legalization of G_PHI/G_BRCOND

Replace the legacy legalizer versions - still WIP but matches existing features, plus handles legal vector types.


  Commit: e61bb1e541ffe3622712e3475c765f51ba88adfb
      https://github.com/llvm/llvm-project/commit/e61bb1e541ffe3622712e3475c765f51ba88adfb
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2023-06-13 (Tue, 13 Jun 2023)

  Changed paths:
    M llvm/lib/CodeGen/MachineFunction.cpp
    M llvm/test/CodeGen/X86/pr63108.ll

  Log Message:
  -----------
  MachineConstantPool::getConstantPoolIndex - don't reuse mismatched constants contained undef/poison (Issue #63108)

This patch fixes an issue where we were reusing constant pool entries that contained undef elements, despite the additional uses of the 'equivalent constant' requiring some/all of the elements to be zero.

The CanShareConstantPoolEntry helper function uses ConstantFoldCastOperand to bitcast the type mismatching constants to integer representations to allow comparison, but unfortunately this treats undef elements as zero (which they will be written out as in the final asm). This caused an issue where the original constant pool entry contained undef elements, which was shared with a later constant that required the elements to be zero. This then caused a later analysis pass to incorrectly discard these undef elements.

Ideally we need a more thorough analysis/merging of the constant pool entries so the elements are forced to real zero elements, but for now we just prevent reuse of the constant pool entry entirely if the constants don't have matching undef/poison elements.

Fixes #63108

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


Compare: https://github.com/llvm/llvm-project/compare/56bf960629cb...e61bb1e541ff


More information about the All-commits mailing list