[all-commits] [llvm/llvm-project] 00a1a4: [mlir][llvmir][debug] Correctly generate location ...

Abid Qadeer via All-commits all-commits at lists.llvm.org
Thu Aug 22 02:08:26 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 00a1a45a7dcdcd8b1f969958a6d927b595567090
      https://github.com/llvm/llvm-project/commit/00a1a45a7dcdcd8b1f969958a6d927b595567090
  Author: Abid Qadeer <haqadeer at amd.com>
  Date:   2024-08-22 (Thu, 22 Aug 2024)

  Changed paths:
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    A mlir/test/Target/LLVMIR/llvmir-phi-loc.mlir

  Log Message:
  -----------
  [mlir][llvmir][debug] Correctly generate location for phi nodes. (#105534)

In
[convertBlockImpl](https://github.com/llvm/llvm-project/blob/87eeed1f0ebe57abffde560c25dd9829dc6038f3/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp#L959),
the debug location is set on the builder before the op is processed.
This results in correct location being given to corresponding llvm
instructions. But same is not done when phi nodes are created a few
lines above. This result is phi nodes getting whatever the current debug
location of the builder is. It can be nothing or in worst case a stale
location. Fixed by calling SetCurrentDebugLocation before generating phi
nodes.



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