Issue 149654
Summary [AArch64] Invalid size request on a scalable vector: DAGCombiner::visitSHL
Labels new issue
Assignees
Reporter sjoerdmeijer
    This input:

```
#include <algorithm>
short a;
void b(signed c, short d, long long e[]) {
  for (bool f = 0; f < d; f = 1)
#pragma clang loop vectorize(enable)
    for (char g = 0; g < 11; g += (3 > c) + 1)
      a = std::min(e[g] ? e[f] : 0, (long long)0);
}
```

compiled with `-std=c++11 -Ofast -msve-vector-bits=128 -mcpu=grace`, results in this error:

```
fatal error: error in backend: Invalid size request on a scalable vector.
```

Stack trace:

```
 #0 0x0000000003c8d7b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3c8d7b8)
 #1 0x0000000003c8b18c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3c8b18c)
 #2 0x0000000003bdb9d3 llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3bdb9d3)
 #3 0x0000000003c829de llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3c829de)
 #4 0x0000000000dae62b LLVMErrorHandler(void*, char const*, bool) cc1_main.cpp:0:0
 #5 0x0000000003be5903 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3be5903)
 #6 0x0000000003be5a68 (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3be5a68)
 #7 0x0000000003c326cd (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3c326cd)
 #8 0x0000000003c326ec llvm::TypeSize::operator unsigned long() const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3c326ec)
 #9 0x0000000000f95d6c llvm::AArch64TargetLowering::shouldFoldConstantShiftPairToMask(llvm::SDNode const*, llvm::CombineLevel) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0xf95d6c)
#10 0x00000000050ebf29 (anonymous namespace)::DAGCombiner::visitSHL(llvm::SDNode*) DAGCombiner.cpp:0:0
#11 0x000000000512bfe6 (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*) DAGCombiner.cpp:0:0
#12 0x000000000512e405 (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) DAGCombiner.cpp:0:0
#13 0x000000000512f4c6 llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::BatchAAResults*, llvm::CodeGenOptLevel) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x512f4c6)
#14 0x000000000525afd2 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x525afd2)
#15 0x000000000525db1d llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x525db1d)
#16 0x000000000525f976 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x525f976)
#17 0x000000000524c3f1 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x524c3f1)
```

See also: https://godbolt.org/z/1YoMWbWv8

This looks different than https://github.com/llvm/llvm-project/issues/148387, first of all because this one is still failing, and second, that one was about `DAGCombiner::visitOR` and this one looks to come from `DAGCombiner::visitSHL`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to