Skip to content

Commit eda4743

Browse files
committed
address PR comments
1 parent 6f2f8eb commit eda4743

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
@@ -18772,6 +18772,7 @@ Intrinsic::ID getFirstBitHighIntrinsic(CGHLSLRuntime &RT, QualType QT) {
1877218772
return RT.getFirstBitSHighIntrinsic();
1877318773
}
1877418774

18775+
assert(QT->hasUnsignedIntegerRepresentation());
1877518776
return RT.getFirstBitUHighIntrinsic();
1877618777
}
1877718778

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,6 +1963,8 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
19631963
<< 1 << /* integer ty */ 6 << ArgTy;
19641964
return true;
19651965
}
1966+
1967+
TheCall->setType(ArgTy);
19661968
break;
19671969
}
19681970
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 CountBits : DXILOp<31, unaryBits> {
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
@@ -2676,9 +2676,9 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg,
26762676
return selectExtInst(ResVReg, ResType, I, CL::rsqrt, GL::InverseSqrt);
26772677
case Intrinsic::spv_sign:
26782678
return selectSign(ResVReg, ResType, I);
2679-
case Intrinsic::spv_firstbituhigh:
2679+
case Intrinsic::spv_firstbituhigh: // There is no CL equivalent of FindUMsb
26802680
return selectExtInst(ResVReg, ResType, I, GL::FindUMsb);
2681-
case Intrinsic::spv_firstbitshigh:
2681+
case Intrinsic::spv_firstbitshigh: // There is no CL equivalent of FindSMsb
26822682
return selectExtInst(ResVReg, ResType, I, GL::FindSMsb);
26832683
case Intrinsic::spv_group_memory_barrier_with_group_sync: {
26842684
Register MemSemReg =

0 commit comments

Comments
 (0)