This teaches AArch64TargetLowering::shouldSinkOperands to sink the operands of aarch64_neon_pmull intrinsic.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for the patch! Can the test be stripped down? Does there need an actual loop or would just 2 different basic blocks be enough? I realise the test of a related patch is also similar, but ideally we would have more compact tests.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
12188 | This falls through to trying to treat the instruction like an indexed pmul, which isn't an instruction available in AArch64. This could do with a test case and possibly being guarded against. | |
llvm/test/CodeGen/AArch64/neon-vmull-high-p8.ll | ||
2 | Can you run update_llc_test_checks on the file. It's useful in cases like this to show all the output | |
27 | I think you can likely remove this too. |
llvm/test/CodeGen/AArch64/neon-vmull-high-p8.ll | ||
---|---|---|
9 | When would sinking not happen? I've read the code, but it seems it's always sinking unless the operand is phi nod . |
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
12188 | IIUC there's still a test case missing to guard against the original issue mentioned by @dmgreen. | |
llvm/test/CodeGen/AArch64/neon-vmull-high-p8.ll | ||
9 | You are right, users in different BBs do not limit sinking, because the instructions are duplicated in that case. One case where sinking won't happen is if one operand has a high mask and one a low mask for example. But it might be better to test for something like that in llvm/test/Transforms/CodeGenPrepare/AArch64/sink-free-instructions.ll | |
13 | You could use -asm-verbose=0 to trim down the output a bit. | |
21 | it's slightly easier to read if there's a newline after the terminators. |
Looks like a good patch, from what I can see. Thanks
LGTM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
12201 | You don't need brackets around single statements in llvm. I would personally also invert the condition - if (thing) doathing() seems clearer in intent to me, but I do see that other cases here work the other way arounds already. |
Thanks! Can you commit on my behalf?
Author name: sunho
Author email: ksunhokim123@gmail.com
Commit message: [AARCH64][NEON] Allow to sink operands for aarch64_neon_pmull.
This falls through to trying to treat the instruction like an indexed pmul, which isn't an instruction available in AArch64. This could do with a test case and possibly being guarded against.