<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - loop-vectorize assertion failure "argument of incompatible type""
   href="https://bugs.llvm.org/show_bug.cgi?id=48340">48340</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>loop-vectorize assertion failure "argument of incompatible type"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>URL</th>
          <td>https://github.com/rust-lang/rust/issues/79564
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tomasz.miasko@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat a.ll

; ModuleID = 'a.ll'
source_filename = "a.6dqf8b0y-cgu.0"
target datalayout =
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%0 = type { i32 }
%1 = type { i64 }

define void @a() unnamed_addr #0 {
  br label %1

1:                                                ; preds = %1, %0
  %2 = phi i64* [ undef, %0 ], [ %3, %1 ]
  %3 = getelementptr inbounds i64, i64* %2, i64 2
  %4 = bitcast i64* %2 to %0**
  %5 = load %0*, %0** %4, align 8
  %6 = icmp eq i64* %3, undef
  br i1 %6, label %7, label %1

7:                                                ; preds = %1
  ret void
}

define void @b() unnamed_addr #0 {
  br label %1

1:                                                ; preds = %1, %0
  %2 = phi i64* [ undef, %0 ], [ %3, %1 ]
  %3 = getelementptr inbounds i64, i64* %2, i64 2
  %4 = bitcast i64* %2 to %1**
  %5 = load %1*, %1** %4, align 8
  %6 = icmp eq i64* %3, undef
  br i1 %6, label %7, label %1

7:                                                ; preds = %1
  ret void
}

attributes #0 = { "target-cpu"="skylake" }

!llvm.module.flags = !{!0}

!0 = !{i32 2, !"RtLibUseGOT", i32 1}

$ opt a.ll -loop-vectorize
opt: llvm-project/llvm/include/llvm/Support/Casting.h:269: typename
llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::Function; Y =
llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::Function*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments: llvm-project/build/bin/opt a.ll -loop-vectorize
1.      Running pass 'Function Pass Manager' on module 'a.ll'.
2.      Running pass 'Loop Vectorization' on function '@b'
 #8 0x0000000002219130 matchIntrinsicType(llvm::Type*,
llvm::ArrayRef<llvm::Intrinsic::IITDescriptor>&,
llvm::SmallVectorImpl<llvm::Type*>&,
llvm::SmallVectorImpl<std::pair<llvm::Type*,
llvm::ArrayRef<llvm::Intrinsic::IITDescriptor> > >&, bool)
(llvm-project/build/bin/opt+0x2219130)
 #9 0x0000000002221bd4 llvm::IRBuilderBase::CreateMaskedIntrinsic(unsigned int,
llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::Type*>, llvm::Twine const&)
(llvm-project/build/bin/opt+0x2221bd4)
#10 0x0000000002221f42 llvm::IRBuilderBase::CreateMaskedGather(llvm::Value*,
llvm::Align, llvm::Value*, llvm::Value*, llvm::Twine const&)
(llvm-project/build/bin/opt+0x2221f42)
#11 0x0000000002cbefeb
llvm::InnerLoopVectorizer::vectorizeMemoryInstruction(llvm::Instruction*,
llvm::VPTransformState&, llvm::VPValue*, llvm::VPValue*, llvm::VPValue*,
llvm::VPValue*) (llvm-project/build/bin/opt+0x2cbefeb)
#12 0x0000000002cbf391
llvm::VPWidenMemoryInstructionRecipe::execute(llvm::VPTransformState&)
(llvm-project/build/bin/opt+0x2cbf391)
#13 0x0000000002d35fc7 llvm::VPBasicBlock::execute(llvm::VPTransformState*)
(llvm-project/build/bin/opt+0x2d35fc7)
#14 0x0000000002d39ac4 llvm::VPlan::execute(llvm::VPTransformState*)
(llvm-project/build/bin/opt+0x2d39ac4)
#15 0x0000000002cd3258
llvm::LoopVectorizationPlanner::executePlan(llvm::InnerLoopVectorizer&,
llvm::DominatorTree*) (llvm-project/build/bin/opt+0x2cd3258)
#16 0x0000000002ce2d9a llvm::LoopVectorizePass::processLoop(llvm::Loop*)
(llvm-project/build/bin/opt+0x2ce2d9a)
#17 0x0000000002ce5031 llvm::LoopVectorizePass::runImpl(llvm::Function&,
llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&,
llvm::DominatorTree&, llvm::BlockFrequencyInfo&, llvm::TargetLibraryInfo*,
llvm::DemandedBits&, llvm::AAResults&, llvm::AssumptionCache&,
std::function<llvm::LoopAccessInfo const& (llvm::Loop&)>&,
llvm::OptimizationRemarkEmitter&, llvm::ProfileSummaryInfo*)
(llvm-project/build/bin/opt+0x2ce5031)
#18 0x0000000002ce5567 (anonymous
namespace)::LoopVectorize::runOnFunction(llvm::Function&)
(llvm-project/build/bin/opt+0x2ce5567)
#19 0x000000000226f628 llvm::FPPassManager::runOnFunction(llvm::Function&)
(llvm-project/build/bin/opt+0x226f628)
#20 0x000000000226fca1 llvm::FPPassManager::runOnModule(llvm::Module&)
(llvm-project/build/bin/opt+0x226fca1)
#21 0x000000000226e573 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(llvm-project/build/bin/opt+0x226e573)
#22 0x000000000066e85d main (llvm-project/build/bin/opt+0x66e85d)
#23 0x00007fc35fe08ba2 __libc_start_main (/lib64/libc.so.6+0x27ba2)
#24 0x000000000072eafe _start (llvm-project/build/bin/opt+0x72eafe)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>