Skip to content

Commit e2763e3

Browse files
committed
clang format
1 parent 4861682 commit e2763e3

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

llvm/lib/Target/RISCV/RISCVLiveVariables.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class RISCVLiveVariables : public MachineFunctionPass {
101101
void print(raw_ostream &OS, const Module *M = nullptr) const override;
102102

103103
void verifyLiveness(MachineFunction &MF) const;
104+
104105
private:
105106
/// Compute local liveness information (Use and Def sets) for each block
106107
void computeLocalLiveness(MachineFunction &MF);
@@ -160,8 +161,8 @@ bool RISCVLiveVariables::isTrackableRegister(
160161
}
161162

162163
void RISCVLiveVariables::processInstruction(const MachineInstr &MI,
163-
LivenessInfo &Info,
164-
const TargetRegisterInfo *TRI) {
164+
LivenessInfo &Info,
165+
const TargetRegisterInfo *TRI) {
165166
std::vector<Register> GenVec;
166167
for (const MachineOperand &MO : MI.operands()) {
167168
if (!MO.isReg() || !MO.getReg())
@@ -174,7 +175,8 @@ void RISCVLiveVariables::processInstruction(const MachineInstr &MI,
174175
continue;
175176

176177
if (MO.isUse()) {
177-
// This is a use - only add to Use set if not already defined in this block
178+
// This is a use - only add to Use set if not already defined in this
179+
// block
178180
if (Info.Gen.find(Reg) == Info.Gen.end()) {
179181
Info.Use.insert(Reg);
180182

@@ -205,8 +207,8 @@ void RISCVLiveVariables::processInstruction(const MachineInstr &MI,
205207
Info.Gen.insert(Reg);
206208
if (Reg.isPhysical()) {
207209
for (MCSubRegIterator SubRegs(Reg, TRI, /*IncludeSelf=*/false);
208-
SubRegs.isValid(); ++SubRegs) {
209-
Info.Gen.insert(*SubRegs);
210+
SubRegs.isValid(); ++SubRegs) {
211+
Info.Gen.insert(*SubRegs);
210212
}
211213
}
212214
}
@@ -324,8 +326,7 @@ void RISCVLiveVariables::computeGlobalLiveness(MachineFunction &MF) {
324326
}
325327
}
326328

327-
bool RISCVLiveVariables::isLiveAt(Register Reg,
328-
const MachineInstr &MI) const {
329+
bool RISCVLiveVariables::isLiveAt(Register Reg, const MachineInstr &MI) const {
329330
const MachineBasicBlock *MBB = MI.getParent();
330331
auto It = BlockLiveness.find(MBB);
331332

llvm/lib/Target/RISCV/RISCVTargetMachine.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ static cl::opt<bool>
103103
cl::desc("Enable Machine Pipeliner for RISC-V"),
104104
cl::init(false), cl::Hidden);
105105

106-
static cl::opt<bool>
107-
EnableRISCVLiveVariables("riscv-live-variables",
108-
cl::desc("Enable Live Variable Analysis for RISC-V"),
109-
cl::init(false), cl::Hidden);
106+
static cl::opt<bool> EnableRISCVLiveVariables(
107+
"riscv-enable-live-variables",
108+
cl::desc("Enable Live Variable Analysis for RISC-V"), cl::init(false),
109+
cl::Hidden);
110110

111111
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeRISCVTarget() {
112112
RegisterTargetMachine<RISCVTargetMachine> X(getTheRISCV32Target());

llvm/test/CodeGen/RISCV/machine-live-variables.mir

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
# RUN: llc -mtriple=riscv64 -verify-machineinstrs -run-pass=riscv-live-variables -debug < %s | FileCheck %s
1+
# RUN: llc -x mir -mtriple=riscv64 -verify-machineinstrs -run-pass=riscv-live-variables -debug < %s 2>&1 \
2+
# RUN: | FileCheck %s
23

34
# REQUIRES: asserts
45

5-
;CHECK: Block: (Number: 1)
6-
;CHECK: Live-In: { }
7-
;CHECK: Live-Out: { }
8-
;CHECK: Use: { }
9-
;CHECK: Def: { $x10 $x11 $x12 $x13 $x14 $x15 $x16 $x10_h $x11_h $x12_h $x13_h $x14_h $x15_h $x16_h $x10_w $x11_w $x12_w $x13_w $x14_w $x15_w $x16_w }
10-
;CHECK:
11-
;CHECK: Block: (Number: 0)
12-
;CHECK: Live-In: { $x11 $x12 $x13 $x14 $x15 $x16 $x17 $x11_h $x12_h $x13_h $x14_h $x15_h $x16_h $x17_h $x11_w $x12_w $x13_w $x14_w $x15_w $x16_w $x17_w }
13-
;CHECK: Live-Out: { }
14-
;CHECK: Use: { $x11 $x12 $x13 $x14 $x15 $x16 $x17 $x11_h $x12_h $x13_h $x14_h $x15_h $x16_h $x17_h $x11_w $x12_w $x13_w $x14_w $x15_w $x16_w $x17_w }
15-
;CHECK: Def: { $x10 $x11 $x12 $x10_h $x11_h $x12_h $x10_w $x11_w $x12_w }
6+
# CHECK: Block: (Number: 0)
7+
# CHECK: Live-In: { $x11 $x12 $x13 $x14 $x15 $x16 $x17 $x11_h $x12_h $x13_h $x14_h $x15_h $x16_h $x17_h $x11_w $x12_w $x13_w $x14_w $x15_w $x16_w $x17_w }
8+
# CHECK: Live-Out: { }
9+
# CHECK: Use: { $x11 $x12 $x13 $x14 $x15 $x16 $x17 $x11_h $x12_h $x13_h $x14_h $x15_h $x16_h $x17_h $x11_w $x12_w $x13_w $x14_w $x15_w $x16_w $x17_w }
10+
# CHECK: Def: { $x10 $x11 $x12 $x10_h $x11_h $x12_h $x10_w $x11_w $x12_w }
1611

1712
--- |
1813

@@ -77,3 +72,5 @@ body: |
7772
SW killed renamable $x12, %stack.0.va, 4 :: (store (s32) into %ir.va + 4)
7873
renamable $x10 = LW killed renamable $x10, 0 :: (load (s32) from %ir.argp.cur)
7974
PseudoRET implicit $x10
75+
76+
...

0 commit comments

Comments
 (0)