Skip to content

Commit c79fbcd

Browse files
committed
[Hexagon] Silence warnings with MSVC
Fixes: ``` [3400/4469] Building CXX object lib\Target\Hexagon\CMakeFiles\LLVMHexagonCodeGen.dir\HexagonVectorCombine.cpp.obj C:\git\llvm-project\llvm\lib\Target\Hexagon\HexagonVectorCombine.cpp(2698): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) C:\git\llvm-project\llvm\lib\Target\Hexagon\HexagonVectorCombine.cpp(2724): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) ```
1 parent 92e343e commit c79fbcd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2695,7 +2695,8 @@ auto HvxIdioms::processFxpMulChopped(IRBuilderBase &Builder, Instruction &In,
26952695
// Do full-precision multiply and shift.
26962696
Value *Prod32 = createMul16(Builder, Op.X, Op.Y);
26972697
if (Rounding) {
2698-
Value *RoundVal = ConstantInt::get(Prod32->getType(), 1 << *Op.RoundAt);
2698+
Value *RoundVal =
2699+
ConstantInt::get(Prod32->getType(), 1ull << *Op.RoundAt);
26992700
Prod32 = Builder.CreateAdd(Prod32, RoundVal, "add");
27002701
}
27012702

@@ -2721,7 +2722,7 @@ auto HvxIdioms::processFxpMulChopped(IRBuilderBase &Builder, Instruction &In,
27212722
Value *Zero = Constant::getNullValue(WordX[0]->getType());
27222723
SmallVector<Value *> RoundV(WordP.size(), Zero);
27232724
RoundV[*Op.RoundAt / 32] =
2724-
ConstantInt::get(HvxWordTy, 1 << (*Op.RoundAt % 32));
2725+
ConstantInt::get(HvxWordTy, 1ull << (*Op.RoundAt % 32));
27252726
WordP = createAddLong(Builder, WordP, RoundV);
27262727
}
27272728

0 commit comments

Comments
 (0)