[llvm] [SimplifyQuery] Include a context-function (NFC) (PR #225369)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 07:25:44 PDT 2026


================
@@ -7744,7 +7741,7 @@ static Value *simplifyInstructionWithOperands(Instruction *I,
                                               const SimplifyQuery &SQ,
                                               unsigned MaxRecurse) {
   assert(I->getFunction() && "instruction should be inserted in a function");
-  assert((!SQ.CxtI || SQ.CxtI->getFunction() == I->getFunction()) &&
+  assert((!SQ.getFunction() || SQ.getFunction() == I->getFunction()) &&
----------------
paulwalker-arm wrote:

```suggestion
  assert(SQ.getFunction() == I->getFunction() &&
```
The first assert handles the nullptr case.

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


More information about the llvm-commits mailing list