This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Use known bits to fold extract_vector_elt with const index
AbandonedPublic

Authored by foad on Sep 11 2020, 2:44 AM.

Diff Detail

Event Timeline

foad created this revision.Sep 11 2020, 2:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 11 2020, 2:44 AM
foad requested review of this revision.Sep 11 2020, 2:44 AM
foad added a comment.Sep 11 2020, 2:48 AM

This isn't ready to commit yet:

  1. there are a few code quality regressions in the test cases
  2. it provokes a crash on test/CodeGen/AMDGPU/global-extload-i16.ll which I haven't been able to fix yet
foad added a comment.Sep 11 2020, 6:03 AM
  1. it provokes a crash on test/CodeGen/AMDGPU/global-extload-i16.ll which I haven't been able to fix yet

https://bugs.llvm.org/show_bug.cgi?id=47492

foad updated this revision to Diff 292428.Sep 17 2020, 2:11 AM

Rebase.

This isn't ready to commit yet:

  1. there are a few code quality regressions in the test cases
  2. it provokes a crash on test/CodeGen/AMDGPU/global-extload-i16.ll which I haven't been able to fix yet

Update:

  1. See inline comments on the regressions.
  2. The crash is fixed. See D87757.
llvm/test/CodeGen/Mips/cconv/vector.ll
4206–4248

There are some regressions in this file but also some improvements. I haven't worked out what's going on yet.

llvm/test/CodeGen/Thumb2/mve-vecreduce-mla.ll
177–191

Regression here and in other cases that are now using muls instead of umull/umlal.

llvm/test/CodeGen/X86/vector-fshl-128.ll
188–190

Regression. Quite a few tests are now using pxor+punpckhdq instead of pshufd. I wonder if some kind of combine could spot this case and turn it back into pshufd.

llvm/test/CodeGen/X86/vector-trunc-math.ll
2713

Regression. Perhaps we need better known bits analysis.

foad added inline comments.Sep 18 2020, 9:05 AM
llvm/test/CodeGen/X86/vector-trunc-math.ll
2713

D87912 is my attempt at fixing this.

@foad please can you rebase?

foad updated this revision to Diff 294545.Sep 27 2020, 3:36 AM

Rebase after D88225.

RKSimon added inline comments.Sep 28 2020, 2:04 AM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
17848

Would this be better handled by SimplifyDemandedBits?

foad added inline comments.Sep 30 2020, 7:15 AM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
17848

Good idea. D88569, D88570.

llvm/test/CodeGen/X86/vector-trunc-math.ll
2713

This regression got fixed by D88225.

foad abandoned this revision.Sep 30 2020, 7:21 AM

Abandoning in favour of D88569 + D88570.