Skip to content

Commit 0a340b5

Browse files
committed
[Hexagon] Use LiveRegUnits
1 parent 99512b1 commit 0a340b5

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

llvm/lib/Target/Hexagon/HexagonGenMux.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "llvm/ADT/DenseMap.h"
2727
#include "llvm/ADT/SmallVector.h"
2828
#include "llvm/ADT/StringRef.h"
29-
#include "llvm/CodeGen/LivePhysRegs.h"
29+
#include "llvm/CodeGen/LiveRegUnits.h"
3030
#include "llvm/CodeGen/MachineBasicBlock.h"
3131
#include "llvm/CodeGen/MachineFunction.h"
3232
#include "llvm/CodeGen/MachineFunctionPass.h"
@@ -346,14 +346,8 @@ bool HexagonGenMux::genMuxInBlock(MachineBasicBlock &B) {
346346

347347
// Fix up kill flags.
348348

349-
LivePhysRegs LPR(*HRI);
349+
LiveRegUnits LPR(*HRI);
350350
LPR.addLiveOuts(B);
351-
auto IsLive = [&LPR, this](unsigned Reg) -> bool {
352-
for (MCPhysReg S : HRI->subregs_inclusive(Reg))
353-
if (LPR.contains(S))
354-
return true;
355-
return false;
356-
};
357351
for (MachineInstr &I : llvm::reverse(B)) {
358352
if (I.isDebugInstr())
359353
continue;
@@ -365,7 +359,7 @@ bool HexagonGenMux::genMuxInBlock(MachineBasicBlock &B) {
365359
if (!Op.isReg() || !Op.isUse())
366360
continue;
367361
assert(Op.getSubReg() == 0 && "Should have physical registers only");
368-
bool Live = IsLive(Op.getReg());
362+
bool Live = !LPR.available(Op.getReg());
369363
Op.setIsKill(!Live);
370364
}
371365
LPR.stepBackward(I);

0 commit comments

Comments
 (0)