Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 7,325 Lines • ▼ Show 20 Lines | if (!Alignment) | ||||
Alignment = DAG.getEVTAlign(VT); | Alignment = DAG.getEVTAlign(VT); | ||||
AAMDNodes AAInfo = VPIntrin.getAAMetadata(); | AAMDNodes AAInfo = VPIntrin.getAAMetadata(); | ||||
const MDNode *Ranges = VPIntrin.getMetadata(LLVMContext::MD_range); | const MDNode *Ranges = VPIntrin.getMetadata(LLVMContext::MD_range); | ||||
SDValue LD; | SDValue LD; | ||||
bool AddToChain = true; | bool AddToChain = true; | ||||
if (!IsGather) { | if (!IsGather) { | ||||
// Do not serialize variable-length loads of constant memory with | // Do not serialize variable-length loads of constant memory with | ||||
// anything. | // anything. | ||||
MemoryLocation ML; | MemoryLocation ML = MemoryLocation::getAfter(PtrOperand, AAInfo); | ||||
simoll: Not intimately familiar with MemoryLocations, but conceptually, for fixed size, we should be… | |||||
Not Done ReplyInline ActionsWe're re-using MemoryLocation::UnknownSize, but I don't think MachineMemOperand uses MemoryLocation or LocationSize in its underlying implementation. craig.topper: We're re-using MemoryLocation::UnknownSize, but I don't think MachineMemOperand uses… | |||||
Not Done ReplyInline ActionsYeah, it's really stored as a LLT, where the size is passed along to AA. MemoryLocation::UnknownSize creates an invalid LLT. dmgreen: Yeah, it's really stored as a LLT, where the size is passed along to AA. MemoryLocation… | |||||
if (VT.isScalableVector()) | |||||
ML = MemoryLocation::getAfter(PtrOperand); | |||||
else | |||||
ML = MemoryLocation( | |||||
PtrOperand, | |||||
LocationSize::precise( | |||||
DAG.getDataLayout().getTypeStoreSize(VPIntrin.getType())), | |||||
AAInfo); | |||||
AddToChain = !AA || !AA->pointsToConstantMemory(ML); | AddToChain = !AA || !AA->pointsToConstantMemory(ML); | ||||
SDValue InChain = AddToChain ? DAG.getRoot() : DAG.getEntryNode(); | SDValue InChain = AddToChain ? DAG.getRoot() : DAG.getEntryNode(); | ||||
MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( | MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( | ||||
MachinePointerInfo(PtrOperand), MachineMemOperand::MOLoad, | MachinePointerInfo(PtrOperand), MachineMemOperand::MOLoad, | ||||
VT.getStoreSize().getKnownMinSize(), *Alignment, AAInfo, Ranges); | MemoryLocation::UnknownSize, *Alignment, AAInfo, Ranges); | ||||
LD = DAG.getLoadVP(VT, DL, InChain, OpValues[0], OpValues[1], OpValues[2], | LD = DAG.getLoadVP(VT, DL, InChain, OpValues[0], OpValues[1], OpValues[2], | ||||
MMO, false /*IsExpanding */); | MMO, false /*IsExpanding */); | ||||
} else { | } else { | ||||
unsigned AS = | unsigned AS = | ||||
PtrOperand->getType()->getScalarType()->getPointerAddressSpace(); | PtrOperand->getType()->getScalarType()->getPointerAddressSpace(); | ||||
MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( | MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( | ||||
MachinePointerInfo(AS), MachineMemOperand::MOLoad, | MachinePointerInfo(AS), MachineMemOperand::MOLoad, | ||||
MemoryLocation::UnknownSize, *Alignment, AAInfo, Ranges); | MemoryLocation::UnknownSize, *Alignment, AAInfo, Ranges); | ||||
Show All 34 Lines | void SelectionDAGBuilder::visitVPStoreScatter(const VPIntrinsic &VPIntrin, | ||||
MaybeAlign Alignment = VPIntrin.getPointerAlignment(); | MaybeAlign Alignment = VPIntrin.getPointerAlignment(); | ||||
if (!Alignment) | if (!Alignment) | ||||
Alignment = DAG.getEVTAlign(VT); | Alignment = DAG.getEVTAlign(VT); | ||||
AAMDNodes AAInfo = VPIntrin.getAAMetadata(); | AAMDNodes AAInfo = VPIntrin.getAAMetadata(); | ||||
SDValue ST; | SDValue ST; | ||||
if (!IsScatter) { | if (!IsScatter) { | ||||
MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( | MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( | ||||
MachinePointerInfo(PtrOperand), MachineMemOperand::MOStore, | MachinePointerInfo(PtrOperand), MachineMemOperand::MOStore, | ||||
VT.getStoreSize().getKnownMinSize(), *Alignment, AAInfo); | MemoryLocation::UnknownSize, *Alignment, AAInfo); | ||||
ST = | ST = | ||||
DAG.getStoreVP(getMemoryRoot(), DL, OpValues[0], OpValues[1], | DAG.getStoreVP(getMemoryRoot(), DL, OpValues[0], OpValues[1], | ||||
OpValues[2], OpValues[3], MMO, false /* IsTruncating */); | OpValues[2], OpValues[3], MMO, false /* IsTruncating */); | ||||
} else { | } else { | ||||
unsigned AS = | unsigned AS = | ||||
PtrOperand->getType()->getScalarType()->getPointerAddressSpace(); | PtrOperand->getType()->getScalarType()->getPointerAddressSpace(); | ||||
MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( | MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( | ||||
MachinePointerInfo(AS), MachineMemOperand::MOStore, | MachinePointerInfo(AS), MachineMemOperand::MOStore, | ||||
▲ Show 20 Lines • Show All 3,858 Lines • Show Last 20 Lines |
Not intimately familiar with MemoryLocations, but conceptually, for fixed size, we should be able to use an imprecise MemoryLocation here, quoting from the MemLoc header: