[llvm-bugs] [Bug 48340] New: loop-vectorize assertion failure "argument of incompatible type"

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 30 14:42:38 PST 2020


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

            Bug ID: 48340
           Summary: loop-vectorize assertion failure "argument of
                    incompatible type"
           Product: new-bugs
           Version: trunk
          Hardware: PC
               URL: https://github.com/rust-lang/rust/issues/79564
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: tomasz.miasko at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

$ 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 https://bugs.llvm.org/ 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)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201130/ccb1270a/attachment.html>


More information about the llvm-bugs mailing list