The ISel patterns for PFALSE helps recognise the instructions as being
free of side-effects, which helps MachineCSE remove redundant
PFALSE instructions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
It looks like AArch64TargetLowering::LowerSPLAT_VECTOR is using DAG.getMachineNode in an inappropriate way: generally, in SelectionDAG, we shouldn't be creating Machine nodes before isel (AArch64DAGToDAGISel::Select). The "proper" construct is to define AArch64ISD::PFALSE, then add a pattern to lower it during isel.
The reason I bring this up is that hasSideEffects is usually inferred from isel patterns.
Ah that makes a lot of sense! I was a bit puzzled as to why it just worked for PTRUE, but not for PFALSE.
I've reimplemented it now by creating an explicit AArch64ISD node for it instead with patterns.
Thanks. LGTM
llvm/lib/Target/AArch64/SVEInstrFormats.td | ||
---|---|---|
337 | I think it should be fine without, from the use of SDTCVecEltisVT in other backends (and, you know, we only create AArch64ISD::PFALSE for vectors anyway..) |
Add a case here too, so it gets printed nicely in debug output.