[llvm] [AArch64] Drop poison-generating flags in `genSubAdd2SubSub` combiner (PR #90028)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 08:18:18 PDT 2024


antoniofrighetto wrote:

Thanks for reviewing it!

> It might be worth having the switch at
> 
> https://github.com/llvm/llvm-project/blob/fe47e8ff3ae7fc8975eaade6bfa6679737c28b93/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp#L6969
> 
> return as opposed to break, so that we don't run the code that is intended for mul+add. Either way this looks correct now, but it would mean that this code doesn't need to modify Root.

Right, although clearing the flags makes explicit the semantic of dropping flags in the combiner. I'd personally leave the `break`, as we would need to anticipate the following in both SUBADD_OP1/SUBADD_OP2 cases otherwise, no strong concerns though.

https://github.com/llvm/llvm-project/blob/fe47e8ff3ae7fc8975eaade6bfa6679737c28b93/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp#L7876


https://github.com/llvm/llvm-project/pull/90028


More information about the llvm-commits mailing list