[all-commits] [llvm/llvm-project] 337bad: [EarlyIfConverter] Fix reg killed twice after earl...

Shoreshen via All-commits all-commits at lists.llvm.org
Tue Apr 1 03:27:07 PDT 2025


  Branch: refs/heads/revert-133880-revert-130577-narrow-math-for-and-operand
  Home:   https://github.com/llvm/llvm-project
  Commit: 337bad3921356fba89409e03793f7d2df846c0e9
      https://github.com/llvm/llvm-project/commit/337bad3921356fba89409e03793f7d2df846c0e9
  Author: Afanasyev Ivan <ivafanas at gmail.com>
  Date:   2025-04-01 (Tue, 01 Apr 2025)

  Changed paths:
    M llvm/lib/CodeGen/EarlyIfConversion.cpp
    A llvm/test/CodeGen/AArch64/early-ifcvt-on-double-killed-reg.mir
    A llvm/test/CodeGen/Hexagon/early-if-predicator-reg-killed-everywhere.mir

  Log Message:
  -----------
  [EarlyIfConverter] Fix reg killed twice after early-if-predicator and ifcvt (#133554)

Bug relates to `early-if-predicator` and `early-ifcvt` passes. If
virtual register has "killed" flag in both basic blocks to be merged
into head, both instructions in head basic block will have "killed" flag
for this register. It makes MIR incorrect.

Example:

```
  bb.0: ; if
    ...
    %0:intregs = COPY $r0
    J2_jumpf %2, %bb.2, implicit-def dead $pc
    J2_jump %bb.1, implicit-def dead $pc

  bb.1: ; if.then
    ...
    S4_storeiri_io killed %0, 0, 1
    J2_jump %bb.3, implicit-def dead $pc

  bb.2: ; if.else
    ...
    S4_storeiri_io killed %0, 0, 1
    J2_jump %bb.3, implicit-def dead $pc
```

After early-if-predicator will become:

```
  bb.0:
    %0:intregs = COPY $r0
    S4_storeirif_io %1, killed %0, 0, 1
    S4_storeirit_io %1, killed %0, 0, 1
```

Having `killed` flag set twice in bb.0 for `%0` is an incorrect MIR.


  Commit: 4a687024559d5ef10abe6ed10555c5f5c2cfcb40
      https://github.com/llvm/llvm-project/commit/4a687024559d5ef10abe6ed10555c5f5c2cfcb40
  Author: Akshat Oke <Akshat.Oke at amd.com>
  Date:   2025-04-01 (Tue, 01 Apr 2025)

  Changed paths:
    A llvm/include/llvm/CodeGen/XRayInstrumentation.h
    M llvm/include/llvm/InitializePasses.h
    M llvm/include/llvm/Passes/CodeGenPassBuilder.h
    M llvm/include/llvm/Passes/MachinePassRegistry.def
    M llvm/lib/CodeGen/CodeGen.cpp
    M llvm/lib/CodeGen/XRayInstrumentation.cpp
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/test/CodeGen/X86/xray-empty-firstmbb.mir
    M llvm/test/CodeGen/X86/xray-multiplerets-in-blocks.mir

  Log Message:
  -----------
  [CodeGen][NPM] Port XRayInstrumentation to NPM (#129865)


  Commit: fd6b5306b6dd21cef8290eb623aeb42e735c6f06
      https://github.com/llvm/llvm-project/commit/fd6b5306b6dd21cef8290eb623aeb42e735c6f06
  Author: Shoreshen <372660931 at qq.com>
  Date:   2025-04-01 (Tue, 01 Apr 2025)

  Changed paths:
    A llvm/include/llvm/CodeGen/XRayInstrumentation.h
    M llvm/include/llvm/InitializePasses.h
    M llvm/include/llvm/Passes/CodeGenPassBuilder.h
    M llvm/include/llvm/Passes/MachinePassRegistry.def
    M llvm/lib/CodeGen/CodeGen.cpp
    M llvm/lib/CodeGen/EarlyIfConversion.cpp
    M llvm/lib/CodeGen/XRayInstrumentation.cpp
    M llvm/lib/Passes/PassBuilder.cpp
    A llvm/test/CodeGen/AArch64/early-ifcvt-on-double-killed-reg.mir
    A llvm/test/CodeGen/Hexagon/early-if-predicator-reg-killed-everywhere.mir
    M llvm/test/CodeGen/X86/xray-empty-firstmbb.mir
    M llvm/test/CodeGen/X86/xray-multiplerets-in-blocks.mir

  Log Message:
  -----------
  Merge branch 'main' into revert-133880-revert-130577-narrow-math-for-and-operand


Compare: https://github.com/llvm/llvm-project/compare/10bb8da1eed6...fd6b5306b6dd

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