We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 763cb29 commit 563d80dCopy full SHA for 563d80d
llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
@@ -362,15 +362,8 @@ static std::optional<unsigned> convertAS(unsigned AS) {
362
}
363
364
static unsigned int getCodeAddrSpace(const MemSDNode *N) {
365
- if (const Value *Src = N->getMemOperand()->getValue())
366
- if (auto *PT = dyn_cast<PointerType>(Src->getType()))
367
- if (auto AS = convertAS(PT->getAddressSpace()))
368
- return AS.value();
369
-
370
- if (auto AS = convertAS(N->getMemOperand()->getAddrSpace()))
371
372
373
- return NVPTX::AddressSpace::Generic;
+ return convertAS(N->getMemOperand()->getAddrSpace())
+ .value_or(NVPTX::AddressSpace::Generic);
374
375
376
namespace {
0 commit comments