diff options
| author | Arthur Eubanks <aeubanks@google.com> | 2024-06-27 16:32:27 -0700 |
|---|---|---|
| committer | shawbyoung <shawbyoung@gmail.com> | 2024-06-27 16:32:27 -0700 |
| commit | f5c7df12cacdb84552b36a7ac598a8db41acc680 (patch) | |
| tree | 3b33e941b9bfb88c40c64fd18ee32a633423cbed /llvm/lib/CodeGen/MachineInstr.cpp | |
| parent | 608880c3a7a59c86db82728067e553a8d4665a45 (diff) | |
| parent | 804415825b97e974c96a92580bcbeaf4c7ff0a04 (diff) | |
[𝘀𝗽𝗿] changes introduced through rebaseusers/shawbyoung/spr/main.boltnfc-refactoring-callgraph
Created using spr 1.3.4
[skip ci]
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 02479f31f0b6..f0de2cad2033 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -98,7 +98,7 @@ void MachineInstr::addImplicitDefUseOperands(MachineFunction &MF) { MachineInstr::MachineInstr(MachineFunction &MF, const MCInstrDesc &TID, DebugLoc DL, bool NoImp) : MCID(&TID), NumOperands(0), Flags(0), AsmPrinterFlags(0), - DbgLoc(std::move(DL)), DebugInstrNum(0) { + DbgLoc(std::move(DL)), DebugInstrNum(0), Opcode(TID.Opcode) { assert(DbgLoc.hasTrivialDestructor() && "Expected trivial destructor"); // Reserve space for the expected number of operands. @@ -117,7 +117,8 @@ MachineInstr::MachineInstr(MachineFunction &MF, const MCInstrDesc &TID, /// uniqueness. MachineInstr::MachineInstr(MachineFunction &MF, const MachineInstr &MI) : MCID(&MI.getDesc()), NumOperands(0), Flags(0), AsmPrinterFlags(0), - Info(MI.Info), DbgLoc(MI.getDebugLoc()), DebugInstrNum(0) { + Info(MI.Info), DbgLoc(MI.getDebugLoc()), DebugInstrNum(0), + Opcode(MI.getOpcode()) { assert(DbgLoc.hasTrivialDestructor() && "Expected trivial destructor"); CapOperands = OperandCapacity::get(MI.getNumOperands()); @@ -143,6 +144,7 @@ void MachineInstr::setDesc(const MCInstrDesc &TID) { if (getParent()) getMF()->handleChangeDesc(*this, TID); MCID = &TID; + Opcode = TID.Opcode; } void MachineInstr::moveBefore(MachineInstr *MovePos) { @@ -576,6 +578,11 @@ uint32_t MachineInstr::copyFlagsFromInstruction(const Instruction &I) { MIFlags |= MachineInstr::MIFlag::NoSWrap; if (TI->hasNoUnsignedWrap()) MIFlags |= MachineInstr::MIFlag::NoUWrap; + } else if (const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(&I)) { + if (GEP->hasNoUnsignedSignedWrap()) + MIFlags |= MachineInstr::MIFlag::NoUSWrap; + if (GEP->hasNoUnsignedWrap()) + MIFlags |= MachineInstr::MIFlag::NoUWrap; } // Copy the nonneg flag. |
