You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CodeGen] Don't create combine loops for PTRADD with opaque constants
We were implicitly assuming here that, if one of Y or Z is a constant,
either the other is not or we will have already (in the nested PTRADD
case) constant-folded both of them into one, and thus don't need to
consider the possibility. However, opaque constants exist and do not get
constant-folded, so we can end up cycling between PTRADD+ADD and
PTRADD+PTRADD. Catch this case by checking the other is not a constant
and skipping all but one combine if so.
No test is provided since I've yet to be able to trigger it in CHERI
LLVM, only downstream in Codasip LLVM and Morello LLVM (and only when
targeting CHERI-RISC-V even in Morello LLVM), both of which enable SCEV
and thus do interesting loop transformations.
Fixes: 05fd67a ("[CodeGen][CHERI-Generic] Support commuting capability offsets when safe")
0 commit comments