Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp =================================================================== --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -7608,11 +7608,9 @@ EVT MemVT = LN00->getMemoryVT(); if (TLI.isLoadExtLegal(ISD::SEXTLOAD, VT, MemVT) && LN00->getExtensionType() != ISD::ZEXTLOAD && LN00->isUnindexed()) { - bool DoXform = true; SmallVector SetCCs; - if (!N0.hasOneUse()) - DoXform = ExtendUsesToFormExtLoad(N, N0.getOperand(0), ISD::SIGN_EXTEND, - SetCCs, TLI); + bool DoXform = ExtendUsesToFormExtLoad(N, N0.getOperand(0), + ISD::SIGN_EXTEND, SetCCs, TLI); if (DoXform) { SDValue ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, SDLoc(LN00), VT, LN00->getChain(), LN00->getBasePtr(), @@ -7914,10 +7912,10 @@ if (isAndLoadExtLoad(AndC, LN00, LoadResultTy, ExtVT)) DoXform = false; } - if (DoXform) - DoXform = ExtendUsesToFormExtLoad(N, N0.getOperand(0), - ISD::ZERO_EXTEND, SetCCs, TLI); } + if (DoXform) + DoXform = ExtendUsesToFormExtLoad(N, N0.getOperand(0), + ISD::ZERO_EXTEND, SetCCs, TLI); if (DoXform) { SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, SDLoc(LN00), VT, LN00->getChain(), LN00->getBasePtr(), Index: test/CodeGen/NVPTX/param-load-store.ll =================================================================== --- test/CodeGen/NVPTX/param-load-store.ll +++ test/CodeGen/NVPTX/param-load-store.ll @@ -23,10 +23,11 @@ ; CHECK: .func (.param .b32 func_retval0) ; CHECK-LABEL: test_i1( ; CHECK-NEXT: .param .b32 test_i1_param_0 -; CHECK: ld.param.u8 [[A8:%r[0-9]+]], [test_i1_param_0]; -; CHECK: and.b32 [[A:%r[0-9]+]], [[A8]], 1; +; CHECK: ld.param.u8 [[A8:%rs[0-9]+]], [test_i1_param_0]; +; CHECK: and.b16 [[A:%rs[0-9]+]], [[A8]], 1; +; CHECK: cvt.u32.u16 [[B:%r[0-9]+]], [[A]] ; CHECK: .param .b32 param0; -; CHECK: st.param.b32 [param0+0], [[A]] +; CHECK: st.param.b32 [param0+0], [[B]] ; CHECK: .param .b32 retval0; ; CHECK: call.uni ; CHECK-NEXT: test_i1,