[llvm] [AArch64][GlobalISel] Extend scalar lrint legalization. (PR #88360)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 12 06:53:52 PDT 2024
================
@@ -1059,6 +1061,26 @@ LegalizerHelper::libcall(MachineInstr &MI, LostDebugLocObserver &LocObserver) {
return Status;
break;
}
+ case TargetOpcode::G_INTRINSIC_LRINT: {
+ LLT LLTy = MRI.getType(MI.getOperand(1).getReg());
+ unsigned Size = LLTy.getSizeInBits();
+ Type *HLTy = getFloatTypeForLLT(Ctx, LLTy);
+ Type *ITy = IntegerType::get(
+ Ctx, MRI.getType(MI.getOperand(0).getReg()).getSizeInBits());
+ if (!HLTy || (Size != 32 && Size != 64 && Size != 80 && Size != 128)) {
+ LLVM_DEBUG(dbgs() << "No libcall available for type " << LLTy << ".\n");
+ return UnableToLegalize;
+ }
+ auto Libcall = getRTLibDesc(MI.getOpcode(), Size);
+ SmallVector<CallLowering::ArgInfo, 2> Args;
+ Args.push_back({MI.getOperand(1).getReg(), HLTy, 0});
----------------
arsenm wrote:
Can do this in the initializer. Also don't need 2 size list for 1 element?
https://github.com/llvm/llvm-project/pull/88360
More information about the llvm-commits
mailing list