[llvm] 67c5a98 - [IR][NFC] Suppress warnings in ternary operators
Fraser Cormack via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 18 10:17:51 PDT 2024
Author: Fraser Cormack
Date: 2024-03-18T17:17:08Z
New Revision: 67c5a98caea419a9720712d3977d487ab95f6356
URL: https://github.com/llvm/llvm-project/commit/67c5a98caea419a9720712d3977d487ab95f6356
DIFF: https://github.com/llvm/llvm-project/commit/67c5a98caea419a9720712d3977d487ab95f6356.diff
LOG: [IR][NFC] Suppress warnings in ternary operators
Just doing this the same way as in AMDGPUPromoteAlloca.cpp
Added:
Modified:
llvm/lib/IR/AutoUpgrade.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index be0abb4b71dae2..dbea4529456c58 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -647,11 +647,12 @@ static bool upgradeArmOrAarch64IntrinsicFunction(bool IsArm, Function *F,
// v16i8 respectively.
if (Name.consume_front("bfdot.")) {
// (arm|aarch64).neon.bfdot.*'.
- Intrinsic::ID ID = StringSwitch<Intrinsic::ID>(Name)
- .Cases("v2f32.v8i8", "v4f32.v16i8",
- IsArm ? Intrinsic::arm_neon_bfdot
- : Intrinsic::aarch64_neon_bfdot)
- .Default(Intrinsic::not_intrinsic);
+ Intrinsic::ID ID =
+ StringSwitch<Intrinsic::ID>(Name)
+ .Cases("v2f32.v8i8", "v4f32.v16i8",
+ IsArm ? (Intrinsic::ID)Intrinsic::arm_neon_bfdot
+ : (Intrinsic::ID)Intrinsic::aarch64_neon_bfdot)
+ .Default(Intrinsic::not_intrinsic);
if (ID != Intrinsic::not_intrinsic) {
size_t OperandWidth = F->getReturnType()->getPrimitiveSizeInBits();
assert((OperandWidth == 64 || OperandWidth == 128) &&
@@ -674,12 +675,15 @@ static bool upgradeArmOrAarch64IntrinsicFunction(bool IsArm, Function *F,
// (arm|aarch64).neon.bfm*.v4f32.v16i8'.
Intrinsic::ID ID =
StringSwitch<Intrinsic::ID>(Name)
- .Case("mla", IsArm ? Intrinsic::arm_neon_bfmmla
- : Intrinsic::aarch64_neon_bfmmla)
- .Case("lalb", IsArm ? Intrinsic::arm_neon_bfmlalb
- : Intrinsic::aarch64_neon_bfmlalb)
- .Case("lalt", IsArm ? Intrinsic::arm_neon_bfmlalt
- : Intrinsic::aarch64_neon_bfmlalt)
+ .Case("mla",
+ IsArm ? (Intrinsic::ID)Intrinsic::arm_neon_bfmmla
+ : (Intrinsic::ID)Intrinsic::aarch64_neon_bfmmla)
+ .Case("lalb",
+ IsArm ? (Intrinsic::ID)Intrinsic::arm_neon_bfmlalb
+ : (Intrinsic::ID)Intrinsic::aarch64_neon_bfmlalb)
+ .Case("lalt",
+ IsArm ? (Intrinsic::ID)Intrinsic::arm_neon_bfmlalt
+ : (Intrinsic::ID)Intrinsic::aarch64_neon_bfmlalt)
.Default(Intrinsic::not_intrinsic);
if (ID != Intrinsic::not_intrinsic) {
NewFn = Intrinsic::getDeclaration(F->getParent(), ID);
More information about the llvm-commits
mailing list