Skip to content

Commit f3c111e

Browse files
committed
address PR comments
1 parent ec1bc6b commit f3c111e

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18644,6 +18644,7 @@ Intrinsic::ID getFirstBitHighIntrinsic(CGHLSLRuntime &RT, QualType QT) {
1864418644
return RT.getFirstBitSHighIntrinsic();
1864518645
}
1864618646

18647+
assert(QT->hasUnsignedIntegerRepresentation());
1864718648
return RT.getFirstBitUHighIntrinsic();
1864818649
}
1864918650

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,8 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
19061906
<< 1 << /* integer ty */ 6 << ArgTy;
19071907
return true;
19081908
}
1909+
1910+
TheCall->setType(ArgTy);
19091911
break;
19101912
}
19111913
case Builtin::BI__builtin_hlsl_select: {

llvm/lib/Target/DirectX/DXIL.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def CBits : DXILOp<31, unary> {
564564
let attributes = [Attributes<DXIL1_0, [ReadNone]>];
565565
}
566566

567-
def FBH : DXILOp<33, unary> {
567+
def FirstbitHi : DXILOp<33, unaryBits> {
568568
let Doc = "Returns the location of the first set bit starting from "
569569
"the highest order bit and working downward.";
570570
let LLVMIntrinsic = int_dx_firstbituhigh;
@@ -576,7 +576,7 @@ def FBH : DXILOp<33, unary> {
576576
let attributes = [Attributes<DXIL1_0, [ReadNone]>];
577577
}
578578

579-
def FBSH : DXILOp<34, unary> {
579+
def FirstbitSHi : DXILOp<34, unaryBits> {
580580
let Doc = "Returns the location of the first set bit from "
581581
"the highest order bit based on the sign.";
582582
let LLVMIntrinsic = int_dx_firstbitshigh;

llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2557,9 +2557,9 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg,
25572557
return selectExtInst(ResVReg, ResType, I, CL::rsqrt, GL::InverseSqrt);
25582558
case Intrinsic::spv_sign:
25592559
return selectSign(ResVReg, ResType, I);
2560-
case Intrinsic::spv_firstbituhigh:
2560+
case Intrinsic::spv_firstbituhigh: // There is no CL equivalent of FindUMsb
25612561
return selectExtInst(ResVReg, ResType, I, GL::FindUMsb);
2562-
case Intrinsic::spv_firstbitshigh:
2562+
case Intrinsic::spv_firstbitshigh: // There is no CL equivalent of FindSMsb
25632563
return selectExtInst(ResVReg, ResType, I, GL::FindSMsb);
25642564
case Intrinsic::spv_lifetime_start:
25652565
case Intrinsic::spv_lifetime_end: {

0 commit comments

Comments
 (0)