https://bugs.llvm.org/show_bug.cgi?id=34696
Bug ID: 34696
Summary: "Deduce function attributes" calculates different
attributes if dbg.value is present. -g affects
generated code
Product: new-bugs
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedb...@nondot.org
Reporter: mikael.hol...@ericsson.com
CC: llvm-bugs@lists.llvm.org
Created attachment 19183
--> https://bugs.llvm.org/attachment.cgi?id=19183&action=edit
reproducer
opt -disable-basicaa -S -globals-aa -functionattrs -o - attrs.ll
gives
; Function Attrs: nounwind
define void @f1() #0 {
and
; Function Attrs: nounwind readnone
define void @f0() #1 {
with
attributes #0 = { nounwind }
attributes #1 = { nounwind readnone }
However, if we remove the call to dbg.value in f0 we instead get
; Function Attrs: norecurse nounwind readnone
define void @f1() #0 {
and
; Function Attrs: norecurse nounwind readnone
define void @f0() #0 {
with
attributes #0 = { norecurse nounwind readnone }
so the call to dbg.value in f0 makes -functionattrs deduce different attributes
on both f1 and f2.
If we then run e.g. -early-cse on the output, we will get different code
because
the call to f0 in f1 will or will not be removed depending on the function
attributes, so code generation is different depending on if we have compiled
with -g or not which is quite unfortunate.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs