This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Only canonicalize forall_index if it can be erased
ClosedPublic

Authored by jeanPerier on May 25 2023, 12:38 PM.

Details

Summary

It seems the canonicalization was not correct: it cannot return that
it failed if it did modify the IR.
This was exposed by a new MLIR sanity check added in
https://reviews.llvm.org/D144552.
I am not sure it is legit to return success if the operation being
canonicalized is not modified either. So only remove the loads if
they are the only uses of the forall_index.

Should fix (intermittent?) bot failures like
https://lab.llvm.org/buildbot/#/builders/179/builds/6251
since the new MLIR check was added.

Diff Detail

Event Timeline

jeanPerier created this revision.May 25 2023, 12:38 PM
jeanPerier requested review of this revision.May 25 2023, 12:38 PM
This revision is now accepted and ready to land.May 25 2023, 1:50 PM
vzakhari accepted this revision.May 25 2023, 9:59 PM