Skip to content

Commit 5a815ac

Browse files
committed
Remove rudiment and apply formating
1 parent c579488 commit 5a815ac

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

llvm/lib/CodeGen/MachineLICM.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,8 @@ void MachineLICMBase::HoistOutOfLoop(MachineDomTreeNode *HeaderN,
794794

795795
for (auto *MBB : CurLoop->blocks()) {
796796
for (auto &MI : *MBB) {
797-
if (MI.mayStore() || MI.isCall() || (MI.mayLoad() && MI.hasOrderedMemoryRef())) {
797+
if (MI.mayStore() || MI.isCall() ||
798+
(MI.mayLoad() && MI.hasOrderedMemoryRef())) {
798799
for (MachineLoop *L = MLI->getLoopFor(MI.getParent()); L != CurLoop;
799800
L = L->getParentLoop())
800801
AllowedToHoistLoads[L] = false;
@@ -813,19 +814,6 @@ void MachineLICMBase::HoistOutOfLoop(MachineDomTreeNode *HeaderN,
813814

814815
// Process the block
815816
SpeculationState = SpeculateUnknown;
816-
817-
auto CanMoveLoad = [](MachineLoop *L) -> bool {
818-
dbgs() << L << "\n";
819-
for (auto *MBB : L->blocks()) {
820-
for (auto &MI : *MBB) {
821-
// Taken from MachineInstr::isSafeToMove
822-
if (MI.mayStore() || MI.isCall() || (MI.mayLoad() && MI.hasOrderedMemoryRef()))
823-
return false;
824-
}
825-
}
826-
return true;
827-
};
828-
829817
bool SafeToMoveLoad = HoistConstLoads && AllowedToHoistLoads[CurLoop];
830818
for (MachineInstr &MI : llvm::make_early_inc_range(*MBB)) {
831819
unsigned HoistRes = HoistResult::NotHoisted;

0 commit comments

Comments
 (0)