This is an archive of the discontinued LLVM Phabricator instance.

Fix shl folding in DAG combiner.
ClosedPublic

Authored by chfast on Jun 22 2015, 7:58 AM.

Details

Summary

The code responsible for shl folding in the DAGCombiner was assuming incorrectly that all constants are less than 64 bits. This patch simply changes the way values are compared.

Diff Detail

Event Timeline

chfast updated this revision to Diff 28109.Jun 22 2015, 7:58 AM
chfast retitled this revision from to Fix shl folding in DAG combiner..
chfast updated this object.
chfast edited the test plan for this revision. (Show Details)
chfast added a subscriber: Unknown Object (MLST).
andreadb accepted this revision.Jun 22 2015, 8:39 AM
andreadb added a reviewer: andreadb.
andreadb added subscribers: test, andreadb.

Hi Pawel,

The change looks good to me.
You can simplify the test case (see comment below).

Thanks,
Andrea

test/CodeGen/X86/fold-vector-shl-crash.ll
5–9

if you define @test as a function returning a <2 x i256> vector value, then you can get rid of basic block 'Loop' and simply return %B.
Basically, the loop is not needed to reproduce the crash in the dag combiner.

This revision is now accepted and ready to land.Jun 22 2015, 8:39 AM
chfast updated this revision to Diff 28117.Jun 22 2015, 8:53 AM
chfast edited edge metadata.
  • Simplify the regression test.
This revision was automatically updated to reflect the committed changes.