Support NND instruction of Aurora VE. Add hasAndNot function also
for optimization.
Details
- Reviewers
simoll k-ishizaka - Commits
- rG0d989cb6ab54: [VE] Support lowering to NND instruction
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Just one nit.
llvm/lib/Target/VE/VEISelLowering.cpp | ||
---|---|---|
541–547 | Why not return true for all scalar NANDs? Constants can always be pulled through registers if we cannot turn them into immediates. |
Thanks for reviewing. Add reply to your question.
llvm/lib/Target/VE/VEISelLowering.cpp | ||
---|---|---|
541–547 | Because retrieving immediate value uses LEA or aother instruction. Let me explain the background of this function. This hasAndNot function is used in SelectionDAG/DAGCombiner.cpp in order to check conversion from ((x ^ y) & m) ^ y to higher (x & m) | (y & ~m) or ~(~x & m) & (m | y). All of them uses 3 instructions but latter two has better parallelism on pipeline. So, adding new instruction to use and-not instruction is not OK for this case. |
llvm/lib/Target/VE/VEISelLowering.cpp | ||
---|---|---|
541–547 | Thanks for the explanation. |
Rebased.
I've notived that it is possible to use PatFrag instead of writing
(and (not ...)) as new multicalss, so I've updated modifications.
Why not return true for all scalar NANDs? Constants can always be pulled through registers if we cannot turn them into immediates.