[all-commits] [llvm/llvm-project] f3e76d: [AArch64] Cleanup call-rv-marker.ll test. NFC.

Ahmed Bougacha via All-commits all-commits at lists.llvm.org
Tue Apr 12 10:35:40 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f3e76dcae3dc6fff5e0d3d0932a1287c9337466c
  Author: Ahmed Bougacha <ahmed at bougacha.org>
  Date:   2022-04-12 (Tue, 12 Apr 2022)

  Changed paths:
    M llvm/test/CodeGen/AArch64/call-rv-marker.ll

  Log Message:
  [AArch64] Cleanup call-rv-marker.ll test. NFC.

This was doing -iphoneos instead of -ios. While there,
remove an old TODO and cleanup some alignment.

  Commit: cfa4fe7c51870fe6b480d541938f556cf0736fa2
  Author: Ahmed Bougacha <ahmed at bougacha.org>
  Date:   2022-04-12 (Tue, 12 Apr 2022)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64CollectLOH.cpp
    M llvm/test/CodeGen/AArch64/loh.mir

  Log Message:
  [AArch64][LOH] Don't ignore regmasks in bundles by iterating over instrs.

The LOH pass iterates over instructions to build its custom register
state machine, but it uses the top-level bundle iterator.
This should be okay, because when the wrapper BUNDLE MI is built,
it aggregates the register defs/uses in its instructions into MOs.

However, that doesn't apply to regmasks, and accumulating regmasks
across multiple instructions would be messy business.
There are a couple AnalyzePhysRegInBundle (/Virt) helpers that
do look at regmasks, but those don't fit in very well here.

AArch64 has started to use a few bundle instructions, specifically
as glorified pseudos for variant call instructions, which have regmasks.
So the LOH pass ends up ignoring regmasks.

Concretely, this has been wrong for a while, but, on aarch64, the
most common bundle (rv_marker call) was always followed by the
attached call instruction, a plain BL with a regmask.  Which
was properly detected by the pass.

However, we recently started keeping the attached call in the bundle,
so the regmask is now ignored.  And the pass happily combines ADRPs, of
say, x8, across the bundle, resulting in corrupt pointers later.

Compare: https://github.com/llvm/llvm-project/compare/3337f50625a3...cfa4fe7c5187

More information about the All-commits mailing list