[PATCH] D26923: [CodeGenPrepare] Don't sink non-cheap addrspacecasts.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 11:36:48 PST 2016


jlebar added inline comments.


================
Comment at: llvm/test/Transforms/CodeGenPrepare/NVPTX/dont-sink-nop-addrspacecast.ll:14
+  ; CHECK-LABEL: l2:
+  ; CHECK-NOT: addrspacecast
+  %v2 = load i64, i64 addrspace(1)* %ptr_as1
----------------
tra wrote:
> jlebar wrote:
> > tra wrote:
> > > Could that be changed for a positive check at the location where you *do* want to see that addrspacecast?
> > > 
> > What problem would this solve?
> Not having addrspacecast here does not prove that it's where it should be.
> I don't know what exactly codegenprepare does, but what if sinking of addrspacecast did happen and for whatever reason it created its own BB just ahead of l2? The test would pass. This scenario is may be too far-fetched, so I'm OK with the test either way.
No, I think that's reasonable.  I added explicit checks that I think should catch this case, thanks.

@arsenm, I would still like your review on this, since you're the impetus for isCheapAddrSpaceCast as opposed to isNoopAddrSpaceCast.


https://reviews.llvm.org/D26923





More information about the llvm-commits mailing list