[PATCH] D91331: Add hook for target to customize different legalization action according to the input type
Qiu Chaofan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 26 22:19:20 PST 2020
qiucf added a comment.
In D91331#2419402 <https://reviews.llvm.org/D91331#2419402>, @yubing wrote:
> Besides, I found a strange thing:
> In PPCTargetLowering::LowerFP_TO_INT, we will return original op if the input type is fp128, which means in some subtarget , fp128's fptoint is legal and have corresponding instructions.
> But what you are going to do is to do a hack and expand it to libcall at the beginning of legalizeOp(...). It seems there is a conflict here.
If I understand correctly, the situation is:
1. `fptoint` is legal on subtarget `power9`, but needs libcall to implement on `power8` or earlier.
2. We can't set `fptoint` as `Expand` on `power8`, since in this case `Expand` won't fallthrough to libcall.
3. `ConvertNodeToLibcall` can't be referenced in target-specific lowering.
4. Besides, the framework only decides the action of `fptoint` by return-value type. But things like 'double to i32' doesn't need libcall on `power8`.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the llvm-commits