llvm-project
205f4bf6 - [NVPTX] Add commutativity to SETP instructions to enable MachineCSE of inverted predicates (#191890)

Commit
115 days ago
[NVPTX] Add commutativity to SETP instructions to enable MachineCSE of inverted predicates (#191890) Inverted predicates can be used freely in PTX. If we can invert a predicate and CSE the generating instruction we can save calculating the inverse. Teach the NVPTX `commuteInstructionImpl` that SETP instructions can be inverted to allow CSEing with previous SETP that match the inverted form. This also inverts the branch users of the predicate to maintain correctness. Currently only allow the SETP inversion if all users are branches. Future work can extend this to `sel` and `not` instructions. Depends on #191889. Assisted-by: Cursor / Claude
Author
Parents
Loading