[llvm] [GlobalISel] Combiner: Install Observer into MachineFunction (PR #102156)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 08:02:59 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-globalisel

Author: Tobias Stadler (tobias-stadler)

<details>
<summary>Changes</summary>

The Combiner doesn't install the Observer into the MachineFunction.
This probably went unnoticed, because MachineFunction::getObserver() is
currently only used in constrainOperandRegClass(), but this might cause
issues down the line.


---
Full diff: https://github.com/llvm/llvm-project/pull/102156.diff


1 Files Affected:

- (modified) llvm/lib/CodeGen/GlobalISel/Combiner.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/CodeGen/GlobalISel/Combiner.cpp b/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
index 3310ce5455c97..5da9e86b20761 100644
--- a/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
@@ -153,7 +153,7 @@ bool Combiner::combineMachineInstrs() {
     // down RPOT.
     Changed = false;
 
-    RAIIDelegateInstaller DelInstall(MF, ObserverWrapper.get());
+    RAIIMFObsDelInstaller DelInstall(MF, *ObserverWrapper);
     for (MachineBasicBlock *MBB : post_order(&MF)) {
       for (MachineInstr &CurMI :
            llvm::make_early_inc_range(llvm::reverse(*MBB))) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/102156


More information about the llvm-commits mailing list