LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 39483 - Assertion failed: 0 <= InputIdx1 && "Unknown target shuffle input", file E:\work\upstream-llvm\llvm\lib\Target\X86\X86ISelLowering.cpp
Summary: Assertion failed: 0 <= InputIdx1 && "Unknown target shuffle input", file E:\w...
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: X86 (show other bugs)
Version: trunk
Hardware: PC Windows NT
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-29 08:38 PDT by Greg Bedwell
Modified: 2018-11-01 04:55 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s): 345520,345824


Attachments
ll reproducer (1.67 KB, text/plain)
2018-10-29 08:49 PDT, Greg Bedwell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Bedwell 2018-10-29 08:38:19 PDT
r345395 ([X86][SSE] Move 2-input limit up from getFauxShuffleMask to resolveTargetShuffleInputs) introduced a new compiler failure.  This was later reverted in r345451 due to a report of new failures, but without a testcase just yet.

I'm not sure if this is the same failure that was observed, but we found this in our testing so I'm reporting it, as presumably we'll want to re-land r345395 in some form at some point.


$ e:\work\upstream-llvm\build-vs2015-native-ninja\bin\clang.exe --version
clang version 8.0.0 (trunk 345380) (llvm/trunk 345395)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: e:\work\upstream-llvm\build-vs2015-native-ninja\bin

$ cat 1.cpp
struct a {
  float e;
  float f;
  float h;
};
float b(a &c, a &d) { return c.e * d.e + c.f * d.f + c.h * d.h; }
float g[6];
int j;
a *k;
void fn2(a &c) {
  for (int i = 0; i < j; ++i)
    g[i] = b(k[i], c);
}

$ e:\work\upstream-llvm\build-vs2015-native-ninja\bin\clang.exe -c 1.cpp -O2 -march=btver2
Assertion failed: 0 <= InputIdx1 && "Unknown target shuffle input", file E:\work\upstream-llvm\llvm\lib\Target\X86\X86ISelLowering.cpp, line 30877

I would love to provide a reduced .ll input, but bugpoint has decided so far not to be cooperative today.  Regardless, the above should be easily usable for reproducing.
Comment 1 Greg Bedwell 2018-10-29 08:49:46 PDT
Created attachment 21043 [details]
ll reproducer

Managed to convince bugpoint to cooperate.

$ e:\work\upstream-llvm\build-vs2015-native-ninja\bin\llc.exe 2.ll
Assertion failed: 0 <= InputIdx1 && "Unknown target shuffle input", file E:\work\upstream-llvm\llvm\lib\Target\X86\X86ISelLowering.cpp, line 30877
Comment 2 Simon Pilgrim 2018-11-01 04:54:54 PDT
Reapplied with fix at rL345824
Comment 3 Simon Pilgrim 2018-11-01 04:55:35 PDT
Test was added at rL345520