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
[RISCV] Match indices based on significant bits when forming strided ops
When checking to see if our index expressions can be converted into strided operations, we previously gave up if the index type wasn't an exact match for the intptrty for the address. Instead, we can ask known bits how many bits are needed, and proceed as long as the number of required bits fits in intptrty.
Note that the motivation of this is mostly test cleanup. We canonicalize at IR such that the gep index will match the intptrty. This is mostly useful so that we can write both RV32 and RV64 tests from the same source. Its also helpful in preventing confusion - I've stumbled across this at least four times now and wasted time each one.
Interestingly, this does appear to catch some loop cases that O3 does not canonicalize. I don't think the vectorizer is likely to emit indices narrower that intptr, but if another frontend did, this might pick them up.
This may also pick up some pass ordering problems, but that's a happy accident at best.
0 commit comments