Skip to content

Commit 4f34efd

Browse files
committed
address PR comments
1 parent b9894f0 commit 4f34efd

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
@@ -18646,6 +18646,7 @@ Intrinsic::ID getFirstBitHighIntrinsic(CGHLSLRuntime &RT, QualType QT) {
1864618646
return RT.getFirstBitSHighIntrinsic();
1864718647
}
1864818648

18649+
assert(QT->hasUnsignedIntegerRepresentation());
1864918650
return RT.getFirstBitUHighIntrinsic();
1865018651
}
1865118652

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,8 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
19431943
<< 1 << /* integer ty */ 6 << ArgTy;
19441944
return true;
19451945
}
1946+
1947+
TheCall->setType(ArgTy);
19461948
break;
19471949
}
19481950
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)