This is an archive of the discontinued LLVM Phabricator instance.

AArch64: Relax assert about large shift sizes.
ClosedPublic

Authored by MatzeB on Jan 12 2015, 3:28 PM.

Details

Summary

Shift sizes larger than the size of the value in bits can happen if
constant folding fails.

Testcase based on rdar://19211454

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 18054.Jan 12 2015, 3:28 PM
MatzeB retitled this revision from to AArch64: Relax assert about large shift sizes..
MatzeB updated this object.
MatzeB edited the test plan for this revision. (Show Details)
MatzeB added a subscriber: Unknown Object (MLST).

Hi Matthias,

I am wondering if we shouldn’t generate an undef node in Selection DAG for such shifts, unless the semantic is properly defined there.

What do you think?

ab added a subscriber: ab.Jan 12 2015, 4:17 PM

So.. I'm curious, what happens now? (i.e.: how about a little more explicit testcase?)
I guess since it's undefined, we care even less anyway..

Also, you mention it in the comment: I would have expected this to be folded to undef, why didn't it?

-Ahmed

The radar mentions "llvm-stress --seed=29856" as the source of that program, maybe that just doesn't perform any combining/constant folding. In each case I don't know if we should always rely on constant folding/combining happening, what is with clang -O0 for example?
In any case having an instruction with an undefined result in the IR is no reason for a target to fail an assertion IMO.

Greeting
Matthias

MatzeB abandoned this revision.Jan 12 2015, 7:06 PM

Abandoning in favor of http://reviews.llvm.org/D6946

This revision was automatically updated to reflect the committed changes.