Skip to content

Commit 45dbfb1

Browse files
committed
fix formatting
1 parent 3de2cdf commit 45dbfb1

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,13 @@ static Value *expandRadiansIntrinsic(CallInst *Orig) {
544544
return Builder.CreateFMul(X, PiOver180);
545545
}
546546

547-
static Value* createCombinedi32toi64Expansion(IRBuilder<> &Builder, Value *LoBytes, Value *HighBytes) {
547+
static Value *createCombinedi32toi64Expansion(IRBuilder<> &Builder,
548+
Value *LoBytes,
549+
Value *HighBytes) {
548550
// For int64, manually combine two int32s
549551
// First, zero-extend both values to i64
550552
Value *Lo = Builder.CreateZExt(LoBytes, Builder.getInt64Ty());
551-
Value *Hi =
552-
Builder.CreateZExt(HighBytes, Builder.getInt64Ty());
553+
Value *Hi = Builder.CreateZExt(HighBytes, Builder.getInt64Ty());
553554
// Shift the high bits left by 32 bits
554555
Value *ShiftedHi = Builder.CreateShl(Hi, Builder.getInt64(32));
555556
// OR the high and low bits together
@@ -591,14 +592,14 @@ static bool expandTypedBufferLoadIntrinsic(CallInst *Orig) {
591592
Value *Result = PoisonValue::get(BufferTy);
592593
for (unsigned I = 0; I < ExtractNum; I += 2) {
593594
Value *Combined = nullptr;
594-
if (IsDouble)
595+
if (IsDouble)
595596
// For doubles, use dx_asdouble intrinsic
596597
Combined =
597598
Builder.CreateIntrinsic(Builder.getDoubleTy(), Intrinsic::dx_asdouble,
598599
{ExtractElements[I], ExtractElements[I + 1]});
599600
else
600-
Combined =
601-
createCombinedi32toi64Expansion(Builder, ExtractElements[I], ExtractElements[I + 1]);
601+
Combined = createCombinedi32toi64Expansion(Builder, ExtractElements[I],
602+
ExtractElements[I + 1]);
602603

603604
if (ExtractNum == 4)
604605
Result = Builder.CreateInsertElement(Result, Combined,
@@ -654,7 +655,7 @@ static bool expandTypedBufferStoreIntrinsic(CallInst *Orig) {
654655
Type *Int32Ty = Builder.getInt32Ty();
655656
Type *ResultTy = VectorType::get(Int32Ty, IsVector ? 4 : 2, false);
656657
Value *Val = PoisonValue::get(ResultTy);
657-
658+
658659
// Handle double type(s)
659660
Type *SplitElementTy = Int32Ty;
660661
if (IsVector)
@@ -672,7 +673,7 @@ static bool expandTypedBufferStoreIntrinsic(CallInst *Orig) {
672673
} else {
673674
// Handle int64 type(s)
674675
Value *InputVal = Orig->getOperand(2);
675-
Constant *ShiftAmt = Builder.getInt64(32);
676+
Constant *ShiftAmt = Builder.getInt64(32);
676677
if (IsVector)
677678
ShiftAmt = ConstantVector::getSplat(ElementCount::getFixed(2), ShiftAmt);
678679

@@ -683,13 +684,13 @@ static bool expandTypedBufferStoreIntrinsic(CallInst *Orig) {
683684
}
684685

685686
if (IsVector) {
686-
// For vector doubles, use shuffle to create the final vector
687-
Val = Builder.CreateShuffleVector(LowBits, HighBits, {0, 2, 1, 3});
688-
} else {
689-
// For scalar doubles, insert the elements
690-
Val = Builder.CreateInsertElement(Val, LowBits, Builder.getInt32(0));
691-
Val = Builder.CreateInsertElement(Val, HighBits, Builder.getInt32(1));
692-
}
687+
// For vector doubles, use shuffle to create the final vector
688+
Val = Builder.CreateShuffleVector(LowBits, HighBits, {0, 2, 1, 3});
689+
} else {
690+
// For scalar doubles, insert the elements
691+
Val = Builder.CreateInsertElement(Val, LowBits, Builder.getInt32(0));
692+
Val = Builder.CreateInsertElement(Val, HighBits, Builder.getInt32(1));
693+
}
693694

694695
// Create the final intrinsic call
695696
Builder.CreateIntrinsic(Builder.getVoidTy(),

0 commit comments

Comments
 (0)