[llvm] [CodeGen] Fix PreISelLowering not reporting changes (PR #102184)
Alexis Engelke via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 6 10:10:57 PDT 2024
https://github.com/aengelke created https://github.com/llvm/llvm-project/pull/102184
expandVectorPredication may change code, even if the intrinsic itself remains in the code. Report changes whenever such an intrinsic is encountered, because code could have been changed.
Another follow-up fix for #101652 to fix expensive-checks-only failure.
>From 5ca67b6ef6c8afabb16be2f99bc07b8a96dcf268 Mon Sep 17 00:00:00 2001
From: Alexis Engelke <engelke at in.tum.de>
Date: Tue, 6 Aug 2024 17:07:01 +0000
Subject: [PATCH] [CodeGen] Fix PreISelLowering not reporting changes
expandVectorPredication may change code, even if the intrinsic itself
remains in the code. Report changes whenever such an intrinsic is
encountered, because code could have been changed.
---
llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp b/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp
index 6418c54f0b18f..0d3dd650b8ee6 100644
--- a/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp
+++ b/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp
@@ -357,12 +357,14 @@ bool PreISelIntrinsicLowering::lowerIntrinsics(Module &M) const {
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, MASKPOS, VLENPOS) \
case Intrinsic::VPID:
#include "llvm/IR/VPIntrinsics.def"
- Changed |= forEachCall(F, [&](CallInst *CI) {
+ forEachCall(F, [&](CallInst *CI) {
Function *Parent = CI->getParent()->getParent();
const TargetTransformInfo &TTI = LookupTTI(*Parent);
auto *VPI = cast<VPIntrinsic>(CI);
return expandVectorPredicationIntrinsic(*VPI, TTI);
});
+ // Not all intrinsics are removed, but the code is changed in any case.
+ Changed = true;
break;
case Intrinsic::objc_autorelease:
Changed |= lowerObjCCall(F, "objc_autorelease");
More information about the llvm-commits
mailing list