This is an archive of the discontinued LLVM Phabricator instance.

[Polly][Fix] Non i1 typed select condition for weird pw aff functions.
ClosedPublic

Authored by jdoerfert on Oct 6 2014, 10:46 AM.

Details

Summary
In case the pieceweise affine function used to create an isl_ast_expr
had empty cases (e.g., with contradicting constraints on the
parameters), it was possible that the condition of the isl_ast_expr
select was not a comparison but a constant (thus of type i64).

This patch does two thing:
 1) Handle the case the condition of a select is not a i1 type like C.
 2) Try to simplify the pieceweise affine functions for the min/max
    access when we generate runtime alias checks. That step can often
    remove empty or redundant cases as well as redundant constrains.

This fixes bug: http://llvm.org/bugs/show_bug.cgi?id=21167

Diff Detail

Event Timeline

jdoerfert updated this revision to Diff 14463.Oct 6 2014, 10:46 AM
jdoerfert retitled this revision from to [Polly][Fix] Non i1 typed select condition for weird pw aff functions..
jdoerfert updated this object.
jdoerfert added subscribers: Restricted Project, Unknown Object (MLST).
grosser accepted this revision.Oct 6 2014, 11:13 AM
grosser edited edge metadata.

Nice patch! LGTM.

Tobias

http://llvm.org/bugs/show_bug.cgi?id=21167

You can reference bug reports with http://llvm.org/PR21167

test/Isl/CodeGen/test-invalid-operands-for-select-2.ll
3

If you could add a one sentence explanation of the bug, that would be great.

This revision is now accepted and ready to land.Oct 6 2014, 11:13 AM
jdoerfert closed this revision.Oct 7 2014, 7:48 AM
jdoerfert updated this revision to Diff 14512.

Closed by commit rL219208 (authored by @jdoerfert).