[llvm-bugs] [Bug 47295] New: Invalid error on long long literal -9223372036854775808LL as a long long array value

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47295

Bug ID: 47295
   Summary: Invalid error on  long long literal
-9223372036854775808LL as a  long long array value
   Product: clang
   Version: 6.0
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: francis.andre.kampb...@orange.fr
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

Hello

Compiling the sample below;
static const long long jjlonglong = -9223372036854775808LL;
static const long long jjlonglong1 = 0x;

static const long long jjCharData[][41] = {
{2LL, 1LL, -9223372036854775808LL}
};

int main() {
return 0;
}

Clang is producing those messages
x.cpp:2:38: warning: integer literal is too large to be represented in a signed
integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
static const long long jjlonglong = -9223372036854775808LL;
 ^
x.cpp:6:14: warning: integer literal is too large to be represented in a signed
integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
{2LL, 1LL, -9223372036854775808LL}
^
x.cpp:6:13: error: constant expression evaluates to 9223372036854775808 which
cannot be narrowed to type 'long long' [-Wc++11-narrowing]
{2LL, 1LL, -9223372036854775808LL}
   ^~
x.cpp:6:13: note: insert an explicit cast to silence this issue
{2LL, 1LL, -9223372036854775808LL}
   ^~
   static_cast( )


The same long long literal as -9223372036854775808LL should produce the same
warning, be used as initializer of a simple variable or a long long array
member.

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47296] New: [BDCE] does not salvage/invalidate debuginfo when rewriting sext as zext

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47296

Bug ID: 47296
   Summary: [BDCE] does not salvage/invalidate debuginfo when
rewriting sext as zext
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: bjorn.a.petters...@ericsson.com
CC: llvm-bugs@lists.llvm.org

The patch from https://reviews.llvm.org/D60413 (commit 7bf168390fd05460b1c0df)
teached bit-tracking dead code elimination to rewrite:

  %6 = sext i32 %5 to i64, !dbg !26
  call void @llvm.dbg.value(metadata i64 %6, metadata !18, metadata
!DIExpression()), !dbg !27

as

  %6 = zext i32 %5 to i64, !dbg !26
  call void @llvm.dbg.value(metadata i64 %6, metadata !18, metadata
!DIExpression()), !dbg !27

when no uses of %6 depended on the most significant bits.

However, since the metadata references in the dbg.value intrinsics aren't dealt
with in any special way, a debugger would print the wrong value for variable
!18 (showing a zero extended value instead of a sign extended value).

I figure that it would be more correct to invalidate the debug-uses (presenting
an undef value), or somehow magically "salvage" the correct value by some fancy
DIExpression based on %5.


Here is an example with full IR (compile with "opt -bdce"):

;-
; ModuleID = './example.ll'
source_filename = "./example.ll"

; Function Attrs: nounwind uwtable
define i32 @foo(i32 %0, i32 %1, i32* %2, i32* %3) #0 !dbg !7 {
  %5 = add nsw i32 %0, 2, !dbg !25
  %6 = sext i32 %5 to i64, !dbg !26
  call void @llvm.dbg.value(metadata i64 %6, metadata !18, metadata
!DIExpression()), !dbg !27
  %7 = icmp sgt i32 %1, 0, !dbg !28
  br i1 %7, label %8, label %11, !dbg !29

8:; preds = %4
  %9 = or i64 %6, 5, !dbg !30
  call void @llvm.dbg.value(metadata i64 %9, metadata !20, metadata
!DIExpression()), !dbg !31
  %10 = trunc i64 %9 to i32, !dbg !32
  store i32 %10, i32* %2, align 4, !dbg !33, !tbaa !34
  br label %14, !dbg !38

11:   ; preds = %4
  %12 = add nsw i64 %6, 3, !dbg !39
  call void @llvm.dbg.value(metadata i64 %12, metadata !23, metadata
!DIExpression()), !dbg !40
  %13 = trunc i64 %12 to i32, !dbg !41
  store i32 %13, i32* %3, align 4, !dbg !42, !tbaa !34
  br label %14

14:   ; preds = %11, %8
  ret i32 undef, !dbg !43
}

; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #1

attributes #0 = { nounwind uwtable }
attributes #1 = { nounwind readnone speculatable willreturn }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6}

!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang
version 12.0.0 (https://github.com/llvm/llvm-project.git
2b37174b9a5db235e493cb72e4454cc08a1b1791)", isOptimized: true, runtimeVersion:
0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false,
nameTableKind: None)
!1 = !DIFile(filename: "example.c", directory: "/home/ce")
!2 = !{}
!3 = !{i32 7, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"wchar_size", i32 4}
!6 = !{!"clang version 12.0.0 (https://github.com/llvm/llvm-project.git
2b37174b9a5db235e493cb72e4454cc08a1b1791)"}
!7 = distinct !DISubprogram(name: "foo", scope: !8, file: !8, line: 2, type:
!9, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags:
DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !13)
!8 = !DIFile(filename: "", directory: "/home/ce")
!9 = !DISubroutineType(types: !10)
!10 = !{!11, !11, !11, !12, !12}
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64)
!13 = !{!14, !15, !16, !17, !18, !20, !23}
!14 = !DILocalVariable(name: "X", arg: 1, scope: !7, file: !8, line: 2, type:
!11)
!15 = !DILocalVariable(name: "Y", arg: 2, scope: !7, file: !8, line: 2, type:
!11)
!16 = !DILocalVariable(name: "Z", arg: 3, scope: !7, file: !8, line: 2, type:
!12)
!17 = !DILocalVariable(name: "W", arg: 4, scope: !7, file: !8, line: 2, type:
!12)
!18 = !DILocalVariable(name: "LX", scope: !7, file: !8, line: 3, type: !19)
!19 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)
!20 = !DILocalVariable(name: "T", scope: !21, file: !8, line: 5, type: !19)
!21 = distinct !DILexicalBlock(scope: !22, file: !8, line: 4, column: 16)
!22 = distinct !DILexicalBlock(scope: !7, file: !8, line: 4, column: 9)
!23 = !DILocalVariable(name: "T", scope: !24, file: !8, line: 8, type: !19)
!24 = distinct !DILexicalBlock(scope: !22, file: !8, line: 7, column: 12)
!25 = !DILocation(line: 3, column

[llvm-bugs] [Bug 46268] Comparison against fixed-point type leads to crash

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46268

Bevin Hansson  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|CONFIRMED   |RESOLVED
 CC||bevin.hans...@ericsson.com

--- Comment #10 from Bevin Hansson  ---
Fixed in d4408fe17f33.

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] Issue 25158 in oss-fuzz: llvm:clang-fuzzer: Stack-overflow in llvm::detail::IEEEFloat::IEEEFloat

2020-08-24 Thread ClusterFuzz-External via monorail via llvm-bugs
Updates:
Labels: ClusterFuzz-Verified
Status: Verified

Comment #1 on issue 25158 by ClusterFuzz-External: llvm:clang-fuzzer: 
Stack-overflow in llvm::detail::IEEEFloat::IEEEFloat
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25158#c1

ClusterFuzz testcase 4867275684052992 is verified as fixed in 
https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=202008230608:202008240603

If this is incorrect, please file a bug on 
https://github.com/google/oss-fuzz/issues/new

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47297] New: Assertion `false && "Pass modifies its input and doesn't report it."' for -jump-threading pass

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47297

Bug ID: 47297
   Summary: Assertion `false && "Pass modifies its input and
doesn't report it."' for -jump-threading pass
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: david.stenb...@ericsson.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

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

LLVM commit: ada2e8ea67393aa8c44fe8e9d46be62df6d1c702

Requires an expensive checks build to reproduce.

$ opt -S -jump-threading jump-threading.ll
Pass modifies its input and doesn't report it: Jump Threading
opt: ../lib/IR/LegacyPassManager.cpp:1593: bool
llvm::FPPassManager::runOnFunction(llvm::Function &): Assertion `false && "Pass
modifies its input and doesn't report it."' failed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47276] Crash when running clang-tidy

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47276

Eugene Zelenko  changed:

   What|Removed |Added

   Assignee|unassignedclangbugs@nondot. |dcough...@apple.com
   |org |
 CC||dcough...@apple.com,
   ||eugene.zele...@gmail.com,
   ||llvm-bugs@lists.llvm.org
Product|clang-tools-extra   |clang
  Component|clang-tidy  |Static Analyzer

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47123] lld fails to build on targets that need -latomic

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47123

Hans Wennborg  changed:

   What|Removed |Added

 CC||h...@chromium.org
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #5 from Hans Wennborg  ---
Cherry-picked to 11.x as 1708358fbbf58d4a870be015ef21eeea9adae87b. Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 46725] [meta] 11.0.0 Release Blockers

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46725
Bug 46725 depends on bug 47123, which changed state.

Bug 47123 Summary: lld fails to build on targets that need -latomic
https://bugs.llvm.org/show_bug.cgi?id=47123

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47222] Merge ca77ab49 into 11.0 branch: Disable use of _ExtInt with '__atomic' builtins

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47222

Hans Wennborg  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Hans Wennborg  ---
Pushed to 11.x as 82e48a579024d0ffbc352702ec0c52b47a6fe691. Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47259] PowerPC64: Incorrect codegen for mtsprg[0-3] on powerpc64 breaks FreeBSD powerpc64 kernel

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47259

Hans Wennborg  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 CC||h...@chromium.org
 Resolution|--- |FIXED

--- Comment #3 from Hans Wennborg  ---
Cherry-picked to 11.x as dcdf2aff02a154f9f862d6f01feff3de1389cc47.

Shouldn't this be covered by tests?

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 46725] [meta] 11.0.0 Release Blockers

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46725
Bug 46725 depends on bug 47259, which changed state.

Bug 47259 Summary: PowerPC64: Incorrect codegen for mtsprg[0-3] on powerpc64 
breaks FreeBSD powerpc64 kernel
https://bugs.llvm.org/show_bug.cgi?id=47259

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 46725] [meta] 11.0.0 Release Blockers

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46725
Bug 46725 depends on bug 47284, which changed state.

Bug 47284 Summary: [lldb] Merge 1ce07cd614be into 11.0
https://bugs.llvm.org/show_bug.cgi?id=47284

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47284] [lldb] Merge 1ce07cd614be into 11.0

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47284

Hans Wennborg  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
 CC||h...@chromium.org

--- Comment #1 from Hans Wennborg  ---
Pushed to 11.x as 6406b6fa5ac8192b0861c343509d98368b555d12.

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47293] Merge 2b37174b9a5db235e493cb72e4454cc08a1b179 into 11.0

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47293

Hans Wennborg  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 CC||h...@chromium.org
 Status|NEW |RESOLVED

--- Comment #1 from Hans Wennborg  ---
Pushed to 11.x as 0c001a171c7d671f0129d69c6a47b159544cdca6.

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 46725] [meta] 11.0.0 Release Blockers

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46725
Bug 46725 depends on bug 47293, which changed state.

Bug 47293 Summary: Merge 2b37174b9a5db235e493cb72e4454cc08a1b179 into 11.0
https://bugs.llvm.org/show_bug.cgi?id=47293

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47294] Merge bf3577ef64c300ba7841a90a4e09e1e305271976 into 11.0

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47294

Hans Wennborg  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||h...@chromium.org
 Resolution|--- |FIXED

--- Comment #1 from Hans Wennborg  ---
Pushed to 11.x as e4f4d48665526c6d8001e8101dc539a7f7653aec.

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 46725] [meta] 11.0.0 Release Blockers

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=46725
Bug 46725 depends on bug 47294, which changed state.

Bug 47294 Summary: Merge bf3577ef64c300ba7841a90a4e09e1e305271976 into 11.0
https://bugs.llvm.org/show_bug.cgi?id=47294

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47298] New: Failure to optimize strlen of string with known length

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47298

Bug ID: 47298
   Summary: Failure to optimize strlen of string with known length
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Support Libraries
  Assignee: unassignedb...@nondot.org
  Reporter: gabrav...@gmail.com
CC: llvm-bugs@lists.llvm.org

bool f()
{
char a[4];
strcpy(a, "123");
return strlen(a) == 3;
}

This can be optimized to `return true;`. This transformation is done by GCC,
but not by LLVM.

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47299] New: llvm.get.active.lane.mask crashes for vl=64

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47299

Bug ID: 47299
   Summary: llvm.get.active.lane.mask crashes for vl=64
   Product: new-bugs
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: ajc...@google.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

Given

declare <16 x i1> @llvm.get.active.lane.mask.v16i1.i64(i64, i64)

define <16 x i1> @create_mask64(i64 %0, i64 %1) {
  %3 = call <16 x i1> @llvm.get.active.lane.mask.v16i1.i64(i64 %0, i64 %1)
  ret <16 x i1> %3
}

and compiling this for avx512 yields the following code without issues

vpbroadcastqzmm0, rsi
vpbroadcastqzmm1, rdi
vpaddq  zmm2, zmm1, zmmword ptr [rip + .LCPI0_0]
vpcmpleuq   k0, zmm2, zmm0
vpaddq  zmm3, zmm1, zmmword ptr [rip + .LCPI0_1]
vpcmpleuq   k1, zmm3, zmm0
kunpckbwk0, k1, k0
vpcmpltuq   k1, zmm2, zmm1
vpcmpltuq   k2, zmm3, zmm1
kunpckbwk1, k2, k1
kandnw  k0, k1, k0
vpmovm2bxmm0, k0
vzeroupper
ret

However, using a longer vector length, like 64, crashes the backend

declare <64 x i1> @llvm.get.active.lane.mask.v64i1.i64(i64, i64)

define <64 x i1> @create_mask64(i64 %0, i64 %1) {
  %3 = call <64 x i1> @llvm.get.active.lane.mask.v64i1.i64(i64 %0, i64 %1)
  ret <64 x i1> %3
}

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.  Program arguments: PATH/llvm/llvm-project/build/bin/llc -O3
--x86-asm-syntax=intel -mtriple=x86_64-grtev4-linux-gnu -march=x86-64
-mcpu=skylake-avx512 -mattr=fma,avx512f 
1.  Running pass 'Function Pass Manager' on module ''.
2.  Running pass 'X86 DAG->DAG Instruction Selection' on function
'@create_mask64'
 #0 0x5581034306a6 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
PATH/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:563:22
 #1 0x558103430739 PrintStackTraceSignalHandler(void*)
PATH/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:624:1
 #2 0x55810342e806 llvm::sys::RunSignalHandlers()
PATH/llvm/llvm-project/llvm/lib/Support/Signals.cpp:70:20
 #3 0x5581034300f0 SignalHandler(int)
PATH/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:405:1
 #4 0x7f956d292110 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14110)
 #5 0x558100bf3d9e llvm::Type::getTypeID() const
PATH/llvm/llvm-project/llvm/include/llvm/IR/Type.h:135:37
 #6 0x558100bfa344 llvm::Type::isVectorTy() const
PATH/llvm/llvm-project/llvm/include/llvm/IR/Type.h:232:46
 #7 0x55810292fb34 llvm::EVT::isExtendedVector() const
PATH/llvm/llvm-project/llvm/lib/CodeGen/ValueTypes.cpp:75:1
 #8 0x55810292fe16 llvm::EVT::isExtendedScalableVector() const
PATH/llvm/llvm-project/llvm/lib/CodeGen/ValueTypes.cpp:114:29
 #9 0x558100cc0710 llvm::EVT::isScalableVector() const
PATH/llvm/llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h:163:74
#10 0x5581031faae0 FoldBUILD_VECTOR(llvm::SDLoc const&, llvm::EVT,
llvm::ArrayRef, llvm::SelectionDAG&)
PATH/llvm/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:4296:3
#11 0x55810321010b llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc
const&, llvm::EVT, llvm::ArrayRef, llvm::SDNodeFlags)
PATH/llvm/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:7512:56
#12 0x558100d32f32 llvm::SelectionDAG::getBuildVector(llvm::EVT,
llvm::SDLoc const&, llvm::ArrayRef)
PATH/llvm/llvm-project/llvm/include/llvm/CodeGen/SelectionDAG.h:775:50
#13 0x5581031b6d2f
llvm::SelectionDAGBuilder::visitIntrinsicCall(llvm::CallInst const&, unsigned
int)
PATH/llvm/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6911:65


-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47300] New: [Loop Idiom Recognize] Degrade performance when arrays are replaced by memset/memcpy

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47300

Bug ID: 47300
   Summary: [Loop Idiom Recognize] Degrade performance when arrays
are replaced by memset/memcpy
   Product: libraries
   Version: trunk
  Hardware: Other
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Loop Optimizer
  Assignee: unassignedb...@nondot.org
  Reporter: anhtu...@ca.ibm.com
CC: llvm-bugs@lists.llvm.org

Created attachment 23888
  --> https://bugs.llvm.org/attachment.cgi?id=23888&action=edit
The IR file of work.c when LIRP is not run.

If the trip count is "small", LIPR should not replace legal stores with
memset/memcpy. The following testcase can be used to demonstrate how Loop Idiom
Recognize Pass (LIRP) degrades the performance. 

1) Compiler work.c to an IR file called work.ll. 

2) Call opt with -loop-idiom to produce an IR file containing memset
instruction
   opt -basic-aa -loop-idiom -S work.ll -o work.yes.ll

3) Inspect to make sure LIRP did replace store with memset in work.yes.ll, but
not in work.ll

5) Compile the test.c, and link it with the IR from (1) and then the IR from
(2). 

clang++ -c test.c
clang++ test.o work.ll -o no
clang++ test.o work.yes.ll -o yes


6) Run both the executables on a quiet machine. On my performance machine,
times spent are:
With memset: **Time elapsed: 1.4215**
Without memset: **Time elapsed: 1.3611**


test.c

```
#include 
#include 

int work(int A[], int sizeI, int sizeL);

int main() {
  int A[3] = {1, 2, 3};
  int res = 1;
  clock_t begin = clock();
  res = work(A, , 3);
  clock_t end = clock();
  double time_spent = (double)(end - begin) / CLOCKS_PER_SEC;

  printf("Time elapsed: %4.4f\n", time_spent);
  return res;
}
```

work.c
```
int work(int A[], int sizeI, int arraySize) {

for (int i = 0; i < sizeI; ++i)
  for (int j = 0; j < sizeI; ++j)
for (int k = 0; k < arraySize; ++k)
  A[k] = 0;

  return A[arraySize - 1];
}
```

IR before calling opt with **-loop-idiom**
```
; ModuleID = './work.ll'
source_filename = "work.c"
target datalayout = "e-m:e-i64:64-n32:64"
target triple = "powerpc64le-unknown-linux-gnu"

; Function Attrs: noinline nounwind
define dso_local signext i32 @_Z4workPiii(i32* %A, i32 signext %sizeI, i32
signext %arraySize)  #0 {
entry:
  %cmp6 = icmp slt i32 0, %sizeI
  br i1 %cmp6, label %for.body.preheader, label %for.end12

for.body.preheader:   ; preds = %entry
  br label %for.body

for.body: ; preds =
%for.body.preheader, %for.inc10
  %i.07 = phi i32 [ %inc11, %for.inc10 ], [ 0, %for.body.preheader ]
  %cmp23 = icmp slt i32 0, %sizeI
  br i1 %cmp23, label %for.body3.preheader, label %for.inc10

for.body3.preheader:  ; preds = %for.body
  br label %for.body3

for.body3:; preds =
%for.body3.preheader, %for.inc7
  %j.04 = phi i32 [ %inc8, %for.inc7 ], [ 0, %for.body3.preheader ]
  %cmp51 = icmp slt i32 0, %arraySize
  br i1 %cmp51, label %for.body6.preheader, label %for.inc7

for.body6.preheader:  ; preds = %for.body3
  br label %for.body6

for.body6:; preds =
%for.body6.preheader, %for.body6
  %k.02 = phi i32 [ %inc, %for.body6 ], [ 0, %for.body6.preheader ]
  %idxprom = sext i32 %k.02 to i64
  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
  store i32 0, i32* %arrayidx, align 4
  %inc = add nsw i32 %k.02, 1
  %cmp5 = icmp slt i32 %inc, %arraySize
  br i1 %cmp5, label %for.body6, label %for.inc7.loopexit

for.inc7.loopexit:; preds = %for.body6
  br label %for.inc7

for.inc7: ; preds = %for.inc7.loopexit,
%for.body3
  %inc8 = add nsw i32 %j.04, 1
  %cmp2 = icmp slt i32 %inc8, %sizeI
  br i1 %cmp2, label %for.body3, label %for.inc10.loopexit

for.inc10.loopexit:   ; preds = %for.inc7
  br label %for.inc10

for.inc10:; preds =
%for.inc10.loopexit, %for.body
  %inc11 = add nsw i32 %i.07, 1
  %cmp = icmp slt i32 %inc11, %sizeI
  br i1 %cmp, label %for.body, label %for.end12.loopexit

for.end12.loopexit:   ; preds = %for.inc10
  br label %for.end12

for.end12:; preds =
%for.end12.loopexit, %entry
  %sub = sub nsw i32 %arraySize, 1
  %idxprom13 = sext i32 %sub to i64
  %arrayidx14 = getelementptr inbounds i32, i32* %A, i64 %idxprom13
  %0 = load i32, i32* %arrayidx14, align 4
  ret i32 %0
}

attributes #0 = { noinline nounwind
"correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false"
"frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0"
"no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false"
"no-

[llvm-bugs] [Bug 47301] New: clang coverage shows incorrect number of macro expansions

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47301

Bug ID: 47301
   Summary: clang coverage shows incorrect number of macro
expansions
   Product: clang
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++
  Assignee: unassignedclangb...@nondot.org
  Reporter: zequa...@google.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

In the following code example, it shows the macro executed 4 times, but it
should be 1. It also generates 4 identical regions, File 1, 4:15 -> 4:24 = #0 ,
which I believe is the cause for that.



$ clang++ -fcoverage-mapping -fprofile-instr-generate b.cpp -Xclang
-dump-coverage-mapping && ./a.out && llvm-profdata merge -sparse
default.profraw -o a.profdata && llvm-cov show -color ./a.out
-instr-profile=a.profdata  -debug-only=coverage-mapping

main:
  File 0, 3:12 -> 7:2 = #0
  Expansion,File 0, 5:5 -> 5:6 = #0 (Expanded file = 1)
  File 1, 4:15 -> 4:24 = #0
  File 1, 4:15 -> 4:24 = #0
  File 1, 4:15 -> 4:24 = #0
  File 1, 4:15 -> 4:24 = #0
Counter in file 0 3:12 -> 7:2, #0
Counter in file 0 5:5 -> 5:6, Expands to file 1
Counter in file 1 4:15 -> 4:24, #0
Counter in file 1 4:15 -> 4:24, #0
Counter in file 1 4:15 -> 4:24, #0
Counter in file 1 4:15 -> 4:24, #0
Emitting segments for file:
/usr/local/google/home/zequanwu/llvm-project/build/master/b.cpp
Combined regions:
  3:12 -> 7:2 (count=1)
  4:15 -> 4:24 (count=4)
  5:5 -> 5:6 (count=1)
Segment at 3:12 (count = 1), RegionEntry
Segment at 4:15 (count = 4), RegionEntry
Segment at 4:24 (count = 1)
Segment at 5:5 (count = 1), RegionEntry
Segment at 5:6 (count = 1)
Segment at 7:2 (count = 0), Skipped
1|   |#include 
2|   |
3|  1|int main() {
4|  4|#define O std::cout
5|  1|O << "" << "" << "";
6|  1|return 0;
7|  1|}

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] Issue 25199 in oss-fuzz: llvm:clang-fuzzer: Stack-overflow in ComplexExprEvaluator::VisitBinaryOperator

2020-08-24 Thread ClusterFuzz-External via monorail via llvm-bugs
Status: New
Owner: 
CC: k...@google.com, masc...@google.com, jdevlieg...@apple.com, 
igm...@gmail.com, d...@google.com, mit...@google.com, bigchees...@gmail.com, 
eney...@google.com, llvm-b...@lists.llvm.org, j...@chromium.org, 
v...@apple.com, mitchphi...@outlook.com, xpl...@gmail.com, akils...@apple.com 
Labels: ClusterFuzz Stability-Memory-AddressSanitizer Reproducible 
Engine-libfuzzer OS-Linux Proj-llvm Reported-2020-08-25
Type: Bug

New issue 25199 by ClusterFuzz-External: llvm:clang-fuzzer: Stack-overflow in 
ComplexExprEvaluator::VisitBinaryOperator
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25199

Detailed Report: https://oss-fuzz.com/testcase?key=5661313114832896

Project: llvm
Fuzzing Engine: libFuzzer
Fuzz Target: clang-fuzzer
Job Type: libfuzzer_asan_llvm
Platform Id: linux

Crash Type: Stack-overflow
Crash Address: 0x7ffc0706d800
Crash State:
  ComplexExprEvaluator::VisitBinaryOperator
  clang::StmtVisitorBase::Visit
  Evaluate
  
Sanitizer: address (ASAN)

Regressed: 
https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=201912130427:201912200437

Reproducer Testcase: https://oss-fuzz.com/download?testcase_id=5661313114832896

Issue filed automatically.

See https://google.github.io/oss-fuzz/advanced-topics/reproducing for 
instructions to reproduce this bug locally.
When you fix this bug, please
  * mention the fix revision(s).
  * state whether the bug was a short-lived regression or an old bug in any 
stable releases.
  * add any other useful information.
This information can help downstream consumers.

If you need to contact the OSS-Fuzz team with a question, concern, or any other 
feedback, please file an issue at https://github.com/google/oss-fuzz/issues. 
Comments on individual Monorail issues are not monitored.

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 47302] New: mingw-w64: std::wcout after _setmode(_fileno(stdout), _O_WTEXT) doesn't work

2020-08-24 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=47302

Bug ID: 47302
   Summary: mingw-w64: std::wcout after _setmode(_fileno(stdout),
_O_WTEXT) doesn't work
   Product: libc++
   Version: 10.0
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: unassignedclangb...@nondot.org
  Reporter: nguyen.long.908...@gmail.com
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

Take this code snippet:
#include 
#include 
#include 

int wmain(int argc, const wchar_t* argv[])
{
_setmode(_fileno(stdout), _O_WTEXT);
std::wcout << L"Thử nghiệm\n";
return 0;
}

On MS STL, this correctly outputs the string, but on libc++ it outputs nothing.

Additional notes:
Add -municode when compiling with clang, and add /utf-8 when compiling with
MSVC

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs