[llvm] Add late optimization pass for riscv (PR #117060)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 22 09:28:16 PST 2024
preames wrote:
A couple of random thoughts on possible fixes. There's aren't exclusive, it's possible we can/should do multiple or none of these.
If we have zicond, the whole problem goes away. There may also be an arithmetic lowering available for this particular select - I haven't closely looked.
The problematic branch is created by MachineBlockPlacement when duplicating the tail. It seems odd to me that it appears to make no effort to simplify after duplicating. This would seem to unblock additional transformations.
I can't find any target which implements this "trivially evaluated cond branch -> unconditional branch" in analyzeBranch, but I also can't find any reason why you can't do this if AllowModify=true.
https://github.com/llvm/llvm-project/pull/117060
More information about the llvm-commits
mailing list