Skip to content

Commit 78ae082

Browse files
committed
address comments
1 parent ee6e09c commit 78ae082

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5219,11 +5219,6 @@ static SDValue combineADDRSPACECAST(SDNode *N,
52195219
// Fold asc[B -> A](asc[A -> B](x)) -> x
52205220
if (ASCN1->getDestAddressSpace() == ASCN2->getSrcAddressSpace())
52215221
return ASCN2->getOperand(0);
5222-
5223-
// Fold asc[B -> C](asc[A -> B](x)) -> asc[A -> C](x)
5224-
return DCI.DAG.getAddrSpaceCast(
5225-
SDLoc(N), N->getValueType(0), ASCN2->getOperand(0),
5226-
ASCN2->getSrcAddressSpace(), ASCN1->getDestAddressSpace());
52275222
}
52285223

52295224
return SDValue();

llvm/test/CodeGen/NVPTX/addrspacecast-folding.ll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ define ptr @test1(ptr %p) {
2121
define ptr addrspace(1) @test2(ptr addrspace(5) %p) {
2222
; CHECK-LABEL: test2(
2323
; CHECK: {
24-
; CHECK-NEXT: .reg .b64 %rd<2>;
24+
; CHECK-NEXT: .reg .b64 %rd<4>;
2525
; CHECK-EMPTY:
2626
; CHECK-NEXT: // %bb.0:
2727
; CHECK-NEXT: ld.param.u64 %rd1, [test2_param_0];
28+
; CHECK-NEXT: cvta.local.u64 %rd2, %rd1;
29+
; CHECK-NEXT: cvta.to.global.u64 %rd3, %rd2;
30+
; CHECK-NEXT: st.param.b64 [func_retval0], %rd3;
2831
; CHECK-NEXT: ret;
2932
%a = addrspacecast ptr addrspace(5) %p to ptr
3033
%b = addrspacecast ptr %a to ptr addrspace(1)

0 commit comments

Comments
 (0)