[llvm] 74cc0fa - [IR][AutoUpgrade] Merge x86 mask load intrinsic upgrades. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 3 08:54:40 PST 2021
Author: Simon Pilgrim
Date: 2021-12-03T16:53:59Z
New Revision: 74cc0fa1db74d678436020a64a8ca0e9e99954d1
URL: https://github.com/llvm/llvm-project/commit/74cc0fa1db74d678436020a64a8ca0e9e99954d1
DIFF: https://github.com/llvm/llvm-project/commit/74cc0fa1db74d678436020a64a8ca0e9e99954d1.diff
LOG: [IR][AutoUpgrade] Merge x86 mask load intrinsic upgrades. NFC.
Helps appease MSVC which is complaining about "fatal error C1061: compiler limit: blocks nested too deeply" - we already do the same thing for avx512.mask.store intrinsics.
This is only a stopgap solution until another else-if case needs adding - we really need to refactor this chain of ifs properly.
Added:
Modified:
llvm/lib/IR/AutoUpgrade.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 2216cfe4ea1f..b8ad2b294b87 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -2407,14 +2407,12 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
if (CI->arg_size() >= 3)
Rep = EmitX86Select(Builder, CI->getArgOperand(2), Rep,
CI->getArgOperand(1));
- } else if (IsX86 && (Name.startswith("avx512.mask.loadu."))) {
- Rep = UpgradeMaskedLoad(Builder, CI->getArgOperand(0),
- CI->getArgOperand(1), CI->getArgOperand(2),
- /*Aligned*/false);
- } else if (IsX86 && (Name.startswith("avx512.mask.load."))) {
- Rep = UpgradeMaskedLoad(Builder, CI->getArgOperand(0),
- CI->getArgOperand(1),CI->getArgOperand(2),
- /*Aligned*/true);
+ } else if (IsX86 && Name.startswith("avx512.mask.load")) {
+ // "avx512.mask.loadu." or "avx512.mask.load."
+ bool Aligned = Name[16] != 'u'; // "avx512.mask.loadu".
+ Rep =
+ UpgradeMaskedLoad(Builder, CI->getArgOperand(0), CI->getArgOperand(1),
+ CI->getArgOperand(2), Aligned);
} else if (IsX86 && Name.startswith("avx512.mask.expand.load.")) {
auto *ResultTy = cast<FixedVectorType>(CI->getType());
Type *PtrTy = ResultTy->getElementType();
More information about the llvm-commits
mailing list