[llvm-bugs] [Bug 38436] New: [AVX] masked store for <3 x i32> triggers an assertion

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 3 02:51:49 PDT 2018


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

            Bug ID: 38436
           Summary: [AVX] masked store for <3 x i32> triggers an assertion
           Product: libraries
           Version: 6.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: gideon.smeding at 3ds.com
                CC: llvm-bugs at lists.llvm.org

Consider the following bitcode:

declare void @llvm.masked.store.v3i32(<3 x i32>, <3 x i32>*, i32, <3 x i1>)

define void @use_masked_store(<3 x i32> %v, <3 x i32>* %p, <3 x i1> %mask) {
    call void @llvm.masked.store.v3i32(<3 x i32> %v, <3 x i32>* %p, i32 16, <3
x i1> %mask)
    ret void
}

While this compiles without fault for sse targets, i.e., 

$ llc -mattr=+sse2 /tmp/llvm_masked_store_bug.bc

runs perfectly, it bails out for avx:

$ llc -mattr=+avx /tmp/llvm_masked_store_bug.bc

with the following assertion:

llc:
/home/gideon/Sources/artifact_builder.git/llvm/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:3560:
llvm::SDValue llvm::DAGTypeLegalizer::WidenVecOp_MSTORE(llvm::SDNode*, unsigned
int): Assertion `OpNo == 3 && "Can widen only data operand of mstore"' failed.
#0 0x000000000150e64a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x150e64a)
#1 0x000000000150c77e llvm::sys::RunSignalHandlers()
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x150c77e)
#2 0x000000000150c8f4 SignalHandler(int)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x150c8f4)
#3 0x00007feb041f1390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007feb03375428 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35428)
#5 0x00007feb0337702a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3702a)
#6 0x00007feb0336dbd7 (/lib/x86_64-linux-gnu/libc.so.6+0x2dbd7)
#7 0x00007feb0336dc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x0000000001441ebc llvm::DAGTypeLegalizer::WidenVecOp_MSTORE(llvm::SDNode*,
unsigned int)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x1441ebc)
#9 0x00000000014442e5 llvm::DAGTypeLegalizer::WidenVectorOperand(llvm::SDNode*,
unsigned int)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x14442e5)
#10 0x000000000141977e llvm::DAGTypeLegalizer::run()
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x141977e)
#11 0x000000000141a448 llvm::SelectionDAG::LegalizeTypes()
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x141a448)
#12 0x00000000013d5939 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x13d5939)
#13 0x00000000013df21b
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x13df21b)
#14 0x00000000013e158e
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone
.part.1172]
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x13e158e)
#15 0x00000000007a05e4 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x7a05e4)
#16 0x0000000000c68275
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0xc68275)
#17 0x0000000000f9eae3 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0xf9eae3)
#18 0x0000000000f9eb9c llvm::FPPassManager::runOnModule(llvm::Module&)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0xf9eb9c)
#19 0x0000000000f9f44a llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0xf9f44a)
#20 0x000000000071e87a compileModule(char**, llvm::LLVMContext&)
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x71e87a)
#21 0x00000000006db83c main
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x6db83c)
#22 0x00007feb03360830 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#23 0x0000000000712859 _start
(/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc+0x712859)
Stack dump:
0.      Program arguments:
/tmp/artifactory/llvm-linux64-centos60-6.0.1-ocaml4.06-3/bin/llc -mattr=+avx
/tmp/llvm_masked_store_bug.bc
1.      Running pass 'Function Pass Manager' on module
'/tmp/llvm_masked_store_bug.bc'.
2.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@use_masked_store'
Aborted (core dumped)

This is a regression w.r.t llvm 4.0.1

-- 
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/20180803/22d6f513/attachment.html>


More information about the llvm-bugs mailing list