diff options
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp index 92cf7f38efa..27aabe6ba0b 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp @@ -11,7 +11,7 @@ /// This file converts any remaining registers into WebAssembly locals. /// /// After register stackification and register coloring, convert non-stackified -/// registers into locals, inserting explicit get_local and set_local +/// registers into locals, inserting explicit local.get and local.set /// instructions. /// //===----------------------------------------------------------------------===// @@ -96,54 +96,54 @@ static unsigned getDropOpcode(const TargetRegisterClass *RC) { llvm_unreachable("Unexpected register class"); } -/// Get the appropriate get_local opcode for the given register class. +/// Get the appropriate local.get opcode for the given register class. static unsigned getGetLocalOpcode(const TargetRegisterClass *RC) { if (RC == &WebAssembly::I32RegClass) - return WebAssembly::GET_LOCAL_I32; + return WebAssembly::LOCAL_GET_I32; if (RC == &WebAssembly::I64RegClass) - return WebAssembly::GET_LOCAL_I64; + return WebAssembly::LOCAL_GET_I64; if (RC == &WebAssembly::F32RegClass) - return WebAssembly::GET_LOCAL_F32; + return WebAssembly::LOCAL_GET_F32; if (RC == &WebAssembly::F64RegClass) - return WebAssembly::GET_LOCAL_F64; + return WebAssembly::LOCAL_GET_F64; if (RC == &WebAssembly::V128RegClass) - return WebAssembly::GET_LOCAL_V128; + return WebAssembly::LOCAL_GET_V128; if (RC == &WebAssembly::EXCEPT_REFRegClass) - return WebAssembly::GET_LOCAL_EXCEPT_REF; + return WebAssembly::LOCAL_GET_EXCEPT_REF; llvm_unreachable("Unexpected register class"); } -/// Get the appropriate set_local opcode for the given register class. +/// Get the appropriate local.set opcode for the given register class. static unsigned getSetLocalOpcode(const TargetRegisterClass *RC) { if (RC == &WebAssembly::I32RegClass) - return WebAssembly::SET_LOCAL_I32; + return WebAssembly::LOCAL_SET_I32; if (RC == &WebAssembly::I64RegClass) - return WebAssembly::SET_LOCAL_I64; + return WebAssembly::LOCAL_SET_I64; if (RC == &WebAssembly::F32RegClass) - return WebAssembly::SET_LOCAL_F32; + return WebAssembly::LOCAL_SET_F32; if (RC == &WebAssembly::F64RegClass) - return WebAssembly::SET_LOCAL_F64; + return WebAssembly::LOCAL_SET_F64; if (RC == &WebAssembly::V128RegClass) - return WebAssembly::SET_LOCAL_V128; + return WebAssembly::LOCAL_SET_V128; if (RC == &WebAssembly::EXCEPT_REFRegClass) - return WebAssembly::SET_LOCAL_EXCEPT_REF; + return WebAssembly::LOCAL_SET_EXCEPT_REF; llvm_unreachable("Unexpected register class"); } -/// Get the appropriate tee_local opcode for the given register class. +/// Get the appropriate local.tee opcode for the given register class. static unsigned getTeeLocalOpcode(const TargetRegisterClass *RC) { if (RC == &WebAssembly::I32RegClass) - return WebAssembly::TEE_LOCAL_I32; + return WebAssembly::LOCAL_TEE_I32; if (RC == &WebAssembly::I64RegClass) - return WebAssembly::TEE_LOCAL_I64; + return WebAssembly::LOCAL_TEE_I64; if (RC == &WebAssembly::F32RegClass) - return WebAssembly::TEE_LOCAL_F32; + return WebAssembly::LOCAL_TEE_F32; if (RC == &WebAssembly::F64RegClass) - return WebAssembly::TEE_LOCAL_F64; + return WebAssembly::LOCAL_TEE_F64; if (RC == &WebAssembly::V128RegClass) - return WebAssembly::TEE_LOCAL_V128; + return WebAssembly::LOCAL_TEE_V128; if (RC == &WebAssembly::EXCEPT_REFRegClass) - return WebAssembly::TEE_LOCAL_EXCEPT_REF; + return WebAssembly::LOCAL_TEE_EXCEPT_REF; llvm_unreachable("Unexpected register class"); } @@ -233,8 +233,8 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { if (MI.isDebugInstr() || MI.isLabel()) continue; - // Replace tee instructions with tee_local. The difference is that tee - // instructions have two defs, while tee_local instructions have one def + // Replace tee instructions with local.tee. The difference is that tee + // instructions have two defs, while local.tee instructions have one def // and an index of a local to write to. if (WebAssembly::isTee(MI)) { assert(MFI.isVRegStackified(MI.getOperand(0).getReg())); @@ -253,7 +253,7 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { MFI.stackifyVReg(NewReg); } - // Replace the TEE with a TEE_LOCAL. + // Replace the TEE with a LOCAL_TEE. unsigned LocalId = getLocalId(Reg2Local, CurLocal, MI.getOperand(1).getReg()); unsigned Opc = getTeeLocalOpcode(RC); @@ -267,7 +267,7 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { continue; } - // Insert set_locals for any defs that aren't stackified yet. Currently + // Insert local.sets for any defs that aren't stackified yet. Currently // we handle at most one def. assert(MI.getDesc().getNumDefs() <= 1); if (MI.getDesc().getNumDefs() == 1) { @@ -297,7 +297,7 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { } MI.getOperand(0).setReg(NewReg); // This register operand of the original instruction is now being used - // by the inserted drop or set_local instruction, so make it not dead + // by the inserted drop or local.set instruction, so make it not dead // yet. MI.getOperand(0).setIsDead(false); MFI.stackifyVReg(NewReg); @@ -305,7 +305,7 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { } } - // Insert get_locals for any uses that aren't stackified yet. + // Insert local.gets for any uses that aren't stackified yet. MachineInstr *InsertPt = &MI; for (MachineOperand &MO : reverse(MI.explicit_uses())) { if (!MO.isReg()) @@ -327,7 +327,7 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { } // If we see a stackified register, prepare to insert subsequent - // get_locals before the start of its tree. + // local.gets before the start of its tree. if (MFI.isVRegStackified(OldReg)) { InsertPt = findStartOfTree(MO, MRI, MFI); continue; @@ -343,7 +343,7 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { continue; } - // Insert a get_local. + // Insert a local.get. unsigned LocalId = getLocalId(Reg2Local, CurLocal, OldReg); const TargetRegisterClass *RC = MRI.getRegClass(OldReg); unsigned NewReg = MRI.createVirtualRegister(RC); |