[Mlir-commits] [clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

Stephen Tozer llvmlistbot at llvm.org
Mon Jun 24 08:56:33 PDT 2024


================
@@ -637,8 +637,7 @@ void ARMParallelDSP::InsertParallelMACs(Reduction &R) {
         Intrinsic::getDeclaration(M, Intrinsic::arm_smlad) :
         Intrinsic::getDeclaration(M, Intrinsic::arm_smlald);
 
-    IRBuilder<NoFolder> Builder(InsertAfter->getParent(),
-                                BasicBlock::iterator(InsertAfter));
+    IRBuilder<NoFolder> Builder((BasicBlock::iterator(InsertAfter)));
----------------
SLTozer wrote:

Funnily enough, that doesn't actually work:
```
./llvm/lib/Target/ARM/ARMParallelDSP.cpp:640:32: warning: parentheses were disambiguated as a function declaration [-Wvexing-parse]
  640 |     IRBuilder<NoFolder> Builder(BasicBlock::iterator(InsertAfter));
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Hence the weird double parentheses - however having looked back at this I can see `InsertAfter` is always non-null, so `->getIterator()` is safe.

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


More information about the Mlir-commits mailing list