[llvm-bugs] [Bug 40294] New: DAGCombiner doesn't check legality for merging stores with noimplicitfloat
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Jan 11 11:54:00 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=40294
Bug ID: 40294
Summary: DAGCombiner doesn't check legality for merging stores
with noimplicitfloat
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Common Code Generator Code
Assignee: unassignedbugs at nondot.org
Reporter: nemanja.i.ibm at gmail.com
CC: llvm-bugs at lists.llvm.org
This can be reproduced as follows:
$ cat a.ll
define dso_local void @test(i64* nocapture %arr1) local_unnamed_addr #0 {
entry:
%arrayidx = getelementptr inbounds i64, i64* %arr1, i64 2
%0 = load i64, i64* %arrayidx, align 8
store i64 %0, i64* %arr1, align 8
%arrayidx2 = getelementptr inbounds i64, i64* %arr1, i64 3
%1 = load i64, i64* %arrayidx2, align 8
%arrayidx3 = getelementptr inbounds i64, i64* %arr1, i64 1
store i64 %1, i64* %arrayidx3, align 8
ret void
}
attributes #0 = { noimplicitfloat }
$ llc a.ll -mtriple=powerpc64le-unknown-unknown
llc:
/home/nemanjai/llvm/llvm-clean/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:970:
void {anonymous}::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*): Assertion
`(TLI.getTypeAction(*DAG.getContext(), Op.getValueType()) ==
TargetLowering::TypeLegal || TLI.isTypeLegal(Op.getValueType()) ||
Op.getOpcode() == ISD::TargetConstant || Op.getOpcode() == ISD::Register) &&
"Unexpected illegal type!"' failed.
The problem is that PPC does not override
TargetLowering::mergeStoresAfterLegalization() and the merging will produce an
i128 which isn't legal.
It will of course produce it prior to legalization as well, but the legalizer
will undo that, the problem is after legalization.
Note that without the noimplicitfloat attribute, things work because using
vectors is allowed and then it will find a corresponding vector type.
--
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/20190111/a8a2c52b/attachment-0001.html>
More information about the llvm-bugs
mailing list