[llvm] [GlobalIsel] Combine cast of const integer. (PR #96139)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 02:15:11 PDT 2024


Thorsten =?utf-8?q?Schütt?= <schuett at gmail.com>,
Thorsten =?utf-8?q?Schütt?= <schuett at gmail.com>,
Thorsten =?utf-8?q?Schütt?= <schuett at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/96139 at github.com>


================
@@ -7428,12 +7428,98 @@ bool CombinerHelper::matchNonNegZext(const MachineOperand &MO,
   LLT SrcTy = MRI.getType(Src);
   const auto &TLI = getTargetLowering();
 
+  const MachineFunction &MF = *MO.getParent()->getMF();
+  LLVMContext &Ctx = MF.getFunction().getContext();
+  auto &DL = MF.getDataLayout();
----------------
arsenm wrote:

```suggestion
  const MachineFunction &MF = B.getMF();
  LLVMContext &Ctx = B..getContext();
  auto &DL = B.getDataLayout();
```

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


More information about the llvm-commits mailing list