diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-06-03 18:41:34 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-06-03 18:41:34 +0000 |
commit | 8dbeb9256cb60fe551fdcbd40580589ffce59e37 (patch) | |
tree | a472f6f29858ad482372fcf2d8548c798e0a1003 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | bf37536a351a2db55efe830437866010ae050eea (diff) | |
download | bcm5719-llvm-8dbeb9256cb60fe551fdcbd40580589ffce59e37.tar.gz bcm5719-llvm-8dbeb9256cb60fe551fdcbd40580589ffce59e37.zip |
TTI: Improve default costs for addrspacecast
For some reason multiple places need to do this, and the variant the
loop unroller and inliner use was not handling it.
Also, introduce a new wrapper to be slightly more precise, since on
AMDGPU some addrspacecasts are free, but not no-ops.
llvm-svn: 362436
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 488cfe6b6c8..797064b68c7 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -1140,8 +1140,8 @@ static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI, // Sink only "cheap" (or nop) address-space casts. This is a weaker condition // than sinking only nop casts, but is helpful on some platforms. if (auto *ASC = dyn_cast<AddrSpaceCastInst>(CI)) { - if (!TLI.isCheapAddrSpaceCast(ASC->getSrcAddressSpace(), - ASC->getDestAddressSpace())) + if (!TLI.isFreeAddrSpaceCast(ASC->getSrcAddressSpace(), + ASC->getDestAddressSpace())) return false; } |