This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Constant fold multiplies in deriveStaticUpperBound.
ClosedPublic

Authored by tpopp on Apr 8 2020, 5:31 AM.

Details

Summary

This operation occurs during collapseParallelLoops, so we constant fold
them also to allow more situations of determining a loop invariant upper
bound when lowering to the GPU dialect from the Loop dialect.

Diff Detail

Event Timeline

tpopp created this revision.Apr 8 2020, 5:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2020, 5:31 AM
pifon2a accepted this revision.Apr 9 2020, 6:27 AM

Thank you!

mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
509

nit: s/ConstantIndexOp op/auto op/

522

nit: s/MulIOp multiplyOp/auto multiplyOp

in general, I think there is/was even a clang-tidy check that suggests to use
auto name = bla.cast<Type>;
instead of
Type name = bla.cast<Type>;

This revision is now accepted and ready to land.Apr 9 2020, 6:27 AM
tpopp updated this revision to Diff 257236.Apr 14 2020, 2:10 AM

Replace some types with auto.

This revision was automatically updated to reflect the committed changes.