Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp
Show First 20 Lines • Show All 448 Lines • ▼ Show 20 Lines | return expandAuipcInstPair(MBB, MBBI, NextMBBI, RISCVII::MO_PCREL_HI, | ||||
RISCV::ADDI); | RISCV::ADDI); | ||||
} | } | ||||
bool RISCVPreRAExpandPseudo::expandLoadAddress( | bool RISCVPreRAExpandPseudo::expandLoadAddress( | ||||
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, | MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, | ||||
MachineBasicBlock::iterator &NextMBBI) { | MachineBasicBlock::iterator &NextMBBI) { | ||||
MachineFunction *MF = MBB.getParent(); | MachineFunction *MF = MBB.getParent(); | ||||
assert(MF->getTarget().isPositionIndependent()); | |||||
const auto &STI = MF->getSubtarget<RISCVSubtarget>(); | const auto &STI = MF->getSubtarget<RISCVSubtarget>(); | ||||
// When HWASAN is used and tagging of global variables is enabled | |||||
// they should be accessed via the GOT, since the tagged address of a global | |||||
// is incompatible with existing code models. This also applies to non-pic | |||||
luismarques: Nit: (spellchecking only)
```
// When HWASAN is used and tagging of global variables is enabled… | |||||
fixed, thanks smd: fixed, thanks | |||||
// mode. | |||||
assert(MF->getTarget().isPositionIndependent() || STI.allowTaggedGlobals()); | |||||
unsigned SecondOpcode = STI.is64Bit() ? RISCV::LD : RISCV::LW; | unsigned SecondOpcode = STI.is64Bit() ? RISCV::LD : RISCV::LW; | ||||
return expandAuipcInstPair(MBB, MBBI, NextMBBI, RISCVII::MO_GOT_HI, | return expandAuipcInstPair(MBB, MBBI, NextMBBI, RISCVII::MO_GOT_HI, | ||||
SecondOpcode); | SecondOpcode); | ||||
} | } | ||||
bool RISCVPreRAExpandPseudo::expandLoadTLSIEAddress( | bool RISCVPreRAExpandPseudo::expandLoadTLSIEAddress( | ||||
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, | MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, | ||||
MachineBasicBlock::iterator &NextMBBI) { | MachineBasicBlock::iterator &NextMBBI) { | ||||
Show All 29 Lines |
Nit: (spellchecking only)
See my broader patch review comment about the semantics.