[flang-commits] [flang] [flang] Fixing code reordering in alloca hoist pass. (PR #95610)

Vijay Kandiah via flang-commits flang-commits at lists.llvm.org
Fri Jun 14 15:12:42 PDT 2024


================
@@ -255,8 +255,10 @@ struct AllocaOpConversion : public fir::FIROpConversion<fir::AllocaOp> {
       mlir::Region *parentRegion = rewriter.getInsertionBlock()->getParent();
       mlir::Block *insertBlock =
           getBlockForAllocaInsert(parentOp, parentRegion);
-      size.getDefiningOp()->moveAfter(insertBlock, insertBlock->begin());
-      rewriter.setInsertionPointAfter(size.getDefiningOp());
+      if (rewriter.getInsertionBlock() != insertBlock) {
----------------
VijayKandiah wrote:

On second thought, I think we would prefer to fix the remaining tests (5 powerpc tests) instead of making another codegen change. I'll go fix those and create a separate merge request to get rid of those lit test failures.

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


More information about the flang-commits mailing list