This is an archive of the discontinued LLVM Phabricator instance.

[AArch64]Fix an assertion failure caused by v1i64 in DAGCombiner shrink
Needs ReviewPublic

Authored by HaoLiu on May 26 2014, 3:46 AM.

Details

Reviewers
t.p.northover
Summary

Hi Tim and other reviewers,

An assertion fails in TargetLoweringOpt::ShrinkDemandedOp() when trying to create a truncate from v1i64 to i32. This patch fixes this problem. As isZExtFree() and isTrancateFree() are not only used in ShrinkDemandedOp(), this patch also modifies isZExtFree() and isTrancateFree() to make the code more robust.

This case exposes that Type::isIntegerTy() and EVT::isInteger() have different semantics, which is quite confusing. EVT::isInteger() is currently like isIntOrIntVectorTy(). There is on function can check if an EVT is an scalar integer. Anyway, as I don't know whether it is proper to rename a function and add a function in EVT, and this will affect a lot of code, I don't do this in the patch.

Thanks,
-Hao

Diff Detail

Event Timeline

HaoLiu updated this revision to Diff 9797.May 26 2014, 3:46 AM
HaoLiu retitled this revision from to [AArch64]Fix an assertion failure caused by v1i64 in DAGCombiner shrink.
HaoLiu updated this object.
HaoLiu edited the test plan for this revision. (Show Details)
HaoLiu added a reviewer: t.p.northover.
HaoLiu added a subscriber: Unknown Object (MLST).
HaoLiu updated this revision to Diff 9799.May 26 2014, 3:52 AM
t.p.northover edited edge metadata.May 28 2014, 6:58 AM

Hi Hao,

This looks fine to me.

Cheers.

Tim.