[llvm-bugs] [Bug 34523] New: LoopVectorizer crashing with 'Assertion `Val && "isa<> used on a null pointer"' failed.'

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 7 22:25:33 PDT 2017


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

            Bug ID: 34523
           Summary: LoopVectorizer crashing with 'Assertion `Val && "isa<>
                    used on a null pointer"' failed.'
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19119
  --> https://bugs.llvm.org/attachment.cgi?id=19119&action=edit
reproducer

opt -loop-vectorize -S -o /dev/null tr14424.ll

hits an assert

Assertion `Val && "isa<> used on a null pointer"' failed.

(gdb) where
#0  0x00007ffff67bbc37 in __GI_raise (sig=sig at entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff67bf028 in __GI_abort () at abort.c:89
#2  0x00007ffff67b4bf6 in __assert_fail_base (fmt=0x7ffff6909018 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n", assertion=assertion at entry=0x3afa184 "Val &&
\"isa<> used on a null pointer\"", file=file at entry=0x3afa1aa
"../include/llvm/Support/Casting.h", line=line at entry=106,
function=function at entry=0x3b10ba4 "static bool
llvm::isa_impl_cl<llvm::Constant, const llvm::Value *>::doit(const From *) [To
= llvm::Constant, From = const llvm::Value *]") at assert.c:92
#3  0x00007ffff67b4ca2 in __GI___assert_fail (assertion=0x3afa184 "Val &&
\"isa<> used on a null pointer\"", file=0x3afa1aa
"../include/llvm/Support/Casting.h", line=106, function=0x3b10ba4 "static bool
llvm::isa_impl_cl<llvm::Constant, const llvm::Value *>::doit(const From *) [To
= llvm::Constant, From = const llvm::Value *]") at assert.c:101
#4  0x0000000000b96f2e in llvm::isa_impl_cl<llvm::Constant, llvm::Value
const*>::doit (Val=0x0) at ../include/llvm/Support/Casting.h:106
#5  0x0000000000b96ed8 in llvm::isa_impl_wrap<llvm::Constant, llvm::Value
const*, llvm::Value const*>::doit (Val=@0x7fffffffa030: 0x0) at
../include/llvm/Support/Casting.h:133
#6  0x0000000000b96eb2 in llvm::isa_impl_wrap<llvm::Constant, llvm::Value*
const, llvm::Value const*>::doit (Val=@0x7fffffffa078: 0x0) at
../include/llvm/Support/Casting.h:123
#7  0x0000000000b96aa5 in llvm::isa<llvm::Constant, llvm::Value*>
(Val=@0x7fffffffa078: 0x0) at ../include/llvm/Support/Casting.h:143
#8  0x0000000000bb3c58 in llvm::dyn_cast<llvm::Constant, llvm::Value> (Val=0x0)
at ../include/llvm/Support/Casting.h:334
#9  0x0000000000fcaaa7 in llvm::IRBuilder<llvm::ConstantFolder,
llvm::IRBuilderDefaultInserter>::CreateSelect (this=0x7fffffffafd8, C=0x0,
True=0x5d96a40, False=0x5d96a40, Name="", MDFrom=0x0) at
../include/llvm/IR/IRBuilder.h:1691
#10 0x000000000326b980 in llvm::InnerLoopVectorizer::widenPHIInstruction
(this=0x7fffffffaf78, PN=0x5d97978, UF=1, VF=4) at
../lib/Transforms/Vectorize/LoopVectorize.cpp:4532
#11 0x0000000003292235 in (anonymous namespace)::VPWidenPHIRecipe::execute
(this=0x5dcfd80, State=...) at
../lib/Transforms/Vectorize/LoopVectorize.cpp:7744
#12 0x00000000032f8256 in llvm::VPBasicBlock::execute (this=0x5dcfcf0,
State=0x7fffffffa960) at ../lib/Transforms/Vectorize/VPlan.cpp:161
#13 0x00000000032f888f in llvm::VPlan::execute (this=0x5dcaca0,
State=0x7fffffffa960) at ../lib/Transforms/Vectorize/VPlan.cpp:228
#14 0x000000000326e70b in llvm::LoopVectorizationPlanner::executePlan
(this=0x7fffffffbbc8, ILV=..., DT=0x5d947a0) at
../lib/Transforms/Vectorize/LoopVectorize.cpp:7559
#15 0x000000000327250c in llvm::LoopVectorizePass::processLoop (this=0x5d94710,
L=0x5db6620) at ../lib/Transforms/Vectorize/LoopVectorize.cpp:8614
#16 0x0000000003276a8f in 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&) (this=0x5d94710, F=..., SE_=..., LI_=...,
TTI_=..., DT_=..., BFI_=..., TLI_=0x5d98cb0, DB_=..., AA_=..., AC_=...,
GetLAA_=..., ORE_=...) at ../lib/Transforms/Vectorize/LoopVectorize.cpp:8695
#17 0x0000000003293c02 in (anonymous namespace)::LoopVectorize::runOnFunction
(this=0x5d946f0, F=...) at ../lib/Transforms/Vectorize/LoopVectorize.cpp:2368
#18 0x00000000028f583d in llvm::FPPassManager::runOnFunction (this=0x5d9ad00,
F=...) at ../lib/IR/LegacyPassManager.cpp:1514
#19 0x00000000028f5b75 in llvm::FPPassManager::runOnModule (this=0x5d9ad00,
M=...) at ../lib/IR/LegacyPassManager.cpp:1535
#20 0x00000000028f635e in (anonymous namespace)::MPPassManager::runOnModule
(this=0x5d987a0, M=...) at ../lib/IR/LegacyPassManager.cpp:1591
#21 0x00000000028f5e5b in llvm::legacy::PassManagerImpl::run (this=0x5d982b0,
M=...) at ../lib/IR/LegacyPassManager.cpp:1694
#22 0x00000000028f68a1 in llvm::legacy::PassManager::run (this=0x7fffffffd4f8,
M=...) at ../lib/IR/LegacyPassManager.cpp:1725
#23 0x0000000000b54c45 in main (argc=7, argv=0x7fffffffda98) at
../tools/opt/opt.cpp:757

So we pass nullptr to CreateSelect at

          Entry[Part] = Builder.CreateSelect(Cond[Part], In0, In0);

in InnerLoopVectorizer::widenPHIInstruction, which it isn't very happy about.

It seems to start happening with commit

 [LV] Avoid redundant operations manipulating masks

but the funny thing is that I can't seem to make the crash go away on trunk now
even if I revert that commit.

-- 
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/20170908/77691df1/attachment-0001.html>


More information about the llvm-bugs mailing list