[llvm-bugs] [Bug 43723] New: Instruction combining error with llvm.invariant.end intrinsic
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Oct 19 14:38:53 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=43723
Bug ID: 43723
Summary: Instruction combining error with llvm.invariant.end
intrinsic
Product: libraries
Version: 9.0
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Transformation Utilities
Assignee: unassignedbugs at nondot.org
Reporter: kenner at adacore.com
CC: llvm-bugs at lists.llvm.org
Consider the following small .ll file:
; ModuleID = 'bug17.adb'
source_filename = "bug17.adb"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @_ada_bug17() {
entry:
%tab = alloca [10 x i8], align 16
%0 = bitcast [10 x i8]* %tab to i8*
call void @llvm.memset.p0i8.i64(i8* align 16 %0, i8 9, i64 10, i1 false)
%1= bitcast [10 x i8]* %tab to i8*
%2 = call {}* @llvm.invariant.start.p0i8(i64 10, i8* align 16 %1)
call void @llvm.invariant.end.p0i8({}* %2, i64 10, i8* align 16 %1)
ret void
}
; Function Attrs: argmemonly nounwind
declare void @llvm.memset.p0i8.i64(i8* nocapture nonnull writeonly, i8, i64, i1
immarg) #0
; Function Attrs: argmemonly nounwind
declare {}* @llvm.invariant.start.p0i8(i64 immarg, i8* nocapture nonnull
readonl
y) #0
; Function Attrs: argmemonly nounwind
declare void @llvm.invariant.end.p0i8({}*, i64 immarg, i8* nocapture nonnull
rea
donly) #0
This crashes when being optimized with -O1, producing:
IC: ERASE %0 = call {}* @llvm.invariant.start.p0i8(i64 10, i8* align 16
undef)
opt:
/llvm.a/gnat-llvm/llvm/llvm-9.0.0.src/lib/Transforms/InstCombine/InstCombineInternal.h:646:
llvm::Instruction*
llvm::InstCombiner::eraseInstFromFunction(llvm::Instruction&): Assertion
`I.use_empty() && "Cannot erase instruction that is used!"' failed.
--
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/20191019/38d96f7d/attachment.html>
More information about the llvm-bugs
mailing list