[llvm] [LoongArch] Add `isSafeToMove` hook to prevent unsafe instruction motion (PR #163725)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 5 04:49:32 PST 2025
================
@@ -1993,6 +1994,10 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
// Hard to reason about register liveness with predicated instruction.
break;
+ if (!TII->isSafeToMove(*TIB, MBB, MF))
+ // Don't hoist the instruction if it isn't safe to move.
+ break;
+
----------------
heiher wrote:
@OCHyams mind taking a look at the changes here when you get a chance? Thanks!
https://github.com/llvm/llvm-project/pull/163725
More information about the llvm-commits
mailing list