This patch stops the trunc, rint, round, floor and ceil intrinsics from blocking tail predication.
Details
Diff Detail
Event Timeline
llvm/lib/Target/ARM/MVETailPredication.cpp | ||
---|---|---|
361 | Um, you might be fixing my bug here, but can you make it so that the floating point instructions only tail predicate when Subtarget->hasMVEEFloatOps() is true? Otherwise in integer only MVE we could start trying to and tail predicate where it will end up expanding the instruction (which probably isn't a huge deal, but we should try and get it correct). | |
llvm/test/CodeGen/Thumb2/LowOverheadLoops/tail-pred-intrinsic-round.ll | ||
4 | Can you also add a test for nearbyint too, to show that it _doesn't_ get tail predicated (I think it gets expanded to a multiple scalar instructions. | |
259 | I think you can remove all this and the code below. It complains about stuff then use -mattr=+mve.fp in the run line. You will probably have to remove the !tbaa info too. |
Only tail predicate if the subtarget has float ops, add nearbyint test and clean up the test file.
llvm/test/CodeGen/Thumb2/LowOverheadLoops/tail-pred-intrinsic-round.ll | ||
---|---|---|
259 | I did try removing them before but ran into an abort, which https://reviews.llvm.org/D82292 has since fixed. |
llvm/lib/Target/ARM/MVETailPredication.cpp | ||
---|---|---|
112 | It would have my preference not to pass ST around all the time; just set it as a class member or get it in IsPredicatedVectorLoop. |
llvm/lib/Target/ARM/MVETailPredication.cpp | ||
---|---|---|
345–346 | fma can go into the float block too. | |
llvm/test/CodeGen/Thumb2/LowOverheadLoops/tail-pred-intrinsic-round.ll | ||
230 | You can use the same test code as floor, for example, but with floor replaced by nearbyint. This won't test that the vecotrizer does or doesn't tail predicate it, but will test that we expand to something non-tail predicated still. |
Thanks. LGTM with one nit.
llvm/lib/Target/ARM/MVETailPredication.cpp | ||
---|---|---|
345–346 | I think you may need to add a LLVM_FALLTHROUGH (or a extra break) to stop a warning from cropping up. |
Add LLVM_FALLTHROUGH
llvm/lib/Target/ARM/MVETailPredication.cpp | ||
---|---|---|
345–346 | Thanks. Well spotted. |
It would have my preference not to pass ST around all the time; just set it as a class member or get it in IsPredicatedVectorLoop.