[llvm] [CodeGen] Merge lowerConstantIntrinsics into pre-isel lowering (PR #97727)
Björn Pettersson via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 8 01:27:56 PDT 2024
================
@@ -285,6 +311,16 @@ bool PreISelIntrinsicLowering::lowerIntrinsics(Module &M) const {
case Intrinsic::load_relative:
Changed |= lowerLoadRelative(F);
break;
+ case Intrinsic::is_constant:
+ case Intrinsic::objectsize:
+ Changed |= forEachCall(F, [&](CallInst *CI) {
+ Function *Parent = CI->getParent()->getParent();
+ TargetLibraryInfo &TLI = LookupTLI(*Parent);
+ bool Changed = lowerConstantIntrinsics(*Parent, TLI, /*DT=*/nullptr);
+ assert(Changed && "lowerConstantIntrinsics did not lower intrinsic");
----------------
bjope wrote:
This assert fails for input like this
```
define void @bbi_97828() {
ret void
dead:
%x = call i32 @llvm.objectsize.i32.p21(ptr addrspace(21) null, i1 false, i1 false, i1 false)
br label %dead
}
```
since lowerConstantIntrinsics is doing an RPOT traversal to find out which intrinsics to lower. So it may fail to find CI, and then there is no changes.
https://github.com/llvm/llvm-project/pull/97727
More information about the llvm-commits
mailing list