[llvm-bugs] [Bug 34448] New: Add braced list formatting options

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34448

Bug ID: 34448
   Summary: Add braced list formatting options
   Product: clang
   Version: unspecified
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Formatter
  Assignee: unassignedclangb...@nondot.org
  Reporter: victor.col...@gmail.com
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org

Currently, braced list initializers are formatted on a single line when short
enought, and using K&R style braces when longer.

Unfortunately, there do not seem to be any configurable way to change this
behavior. It would be really nice to be able to configure the braced list
style, in order to comply with some strict coding styles. This would also make
easier migrating from astyle, which enforces the same braced lists style as
code blocks in most contexts.

I've actually been trying very hard to implement a quick and dirty patch
enforcing Allman braces, but miserably failed to do so. If anybody has a clue
about how to implement this, tell me so that I can give it a shot !

-- 
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


[llvm-bugs] [Bug 33204] void {anonymous}::NewGVN::verifyIterationSettled(llvm::Function&): Assertion `BeforeCC->isEquivalentTo(AfterCC) && "Value number changed after main loop completed!"' failed

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33204

Stephan Bergmann  changed:

   What|Removed |Added

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

--- Comment #12 from Stephan Bergmann 
 ---
This assertion started to hit again with recent trunk (I'm on r312468):

* In the meantime, I've seen LibreOffice built successfully with -enable-newgvn
with some Clang trunk after r311829.

* This issue's original reproducer (attachment 18528 plus
) still
succeeds with r312468.

* What fails now with r312468 is building CoinPackedMatrix.cpp (from building
CoinMP as part of LibreOffice) with -enable-newgvn:

> clang-6.0: 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/Transforms/Scalar/NewGVN.cpp:3123:
>  void {anonymous}::NewGVN::verifyIterationSettled(llvm::Function&): Assertion 
> `BeforeCC->isEquivalentTo(AfterCC) && "Value number changed after main loop 
> completed!"' failed.
> #0 0x020306ea llvm::sys::PrintStackTrace(llvm::raw_ostream&) 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/Support/Unix/Signals.inc:402:0
> #1 0x0202e61e llvm::sys::RunSignalHandlers() 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/Support/Signals.cpp:50:0
> #2 0x0202e76c SignalHandler(int) 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/Support/Unix/Signals.inc:252:0
> #3 0x7fc6757c45b0 __restore_rt (/lib64/libpthread.so.0+0x115b0)
> #4 0x7fc67432c8df __GI_raise 
> /usr/src/debug/glibc-2.24-61-g605e6f9/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
> #5 0x7fc67432e4da __GI_abort 
> /usr/src/debug/glibc-2.24-61-g605e6f9/stdlib/abort.c:91:0
> #6 0x7fc674324d67 __assert_fail_base 
> /usr/src/debug/glibc-2.24-61-g605e6f9/assert/assert.c:92:0
> #7 0x7fc674324e12 (/lib64/libc.so.6+0x2de12)
> #8 0x01f44dc4 verifyIterationSettled 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/Transforms/Scalar/NewGVN.cpp:3122:0
> #9 0x01f44dc4 (anonymous namespace)::NewGVN::runGVN() 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/Transforms/Scalar/NewGVN.cpp:3293:0
> #10 0x01f46167 (anonymous 
> namespace)::NewGVNLegacyPass::runOnFunction(llvm::Function&) [clone 
> .part.1455] 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/Transforms/Scalar/NewGVN.cpp:4032:0
> #11 0x01baae7b llvm::FPPassManager::runOnFunction(llvm::Function&) 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/IR/LegacyPassManager.cpp:1514:0
> #12 0x0165e8cb RunPassOnSCC 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/Analysis/CallGraphSCCPass.cpp:156:0
> #13 0x0165e8cb RunAllPassesOnSCC 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/Analysis/CallGraphSCCPass.cpp:423:0
> #14 0x0165e8cb (anonymous 
> namespace)::CGPassManager::runOnModule(llvm::Module&) 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/Analysis/CallGraphSCCPass.cpp:479:0
> #15 0x01babaa1 runOnModule 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/IR/LegacyPassManager.cpp:1591:0
> #16 0x01babaa1 llvm::legacy::PassManagerImpl::run(llvm::Module&) 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/lib/IR/LegacyPassManager.cpp:1694:0
> #17 0x021d26af 
> llvm::PrettyStackTraceString::~PrettyStackTraceString() 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/llvm/include/llvm/Support/PrettyStackTrace.h:52:0
> #18 0x021d26af EmitAssembly 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/clang/lib/CodeGen/BackendUtil.cpp:788:0
> #19 0x021d26af clang::EmitBackendOutput(clang::DiagnosticsEngine&, 
> clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, 
> clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout 
> const&, llvm::Module*, clang::BackendAction, 
> std::unique_ptr std::default_delete >) 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/clang/lib/CodeGen/BackendUtil.cpp:1145:0
> #20 0x029b8158 std::unique_ptr std::default_delete >::~unique_ptr() 
> /usr/include/c++/6.4.1/bits/unique_ptr.h:238:0
> #21 0x029b8158 
> clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) 
> /data/sbergman/github.com/llvm-project/llvm-project-20170507/clang/lib/CodeGen/CodeGenAction.cpp:261:0
> #22 0x02b8ab98 
> std::enable_if, 
> std::is_move_assignable >::value, void>::type std::swap(bool&, 
> bool&) /usr/include/c++/6.4.1/bits/move.h:192:0
> #23 0x02b8ab98 clang::ParseAST(clang::Sema&, bool, bool) 
> /data/sbergman/github.com/llvm-project/llvm-project-20

[llvm-bugs] [Bug 34451] New: Assertion failure in clang::Expr::getBestDynamicClassType (via optin.cplusplus.VirtualCall SA checker)

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34451

Bug ID: 34451
   Summary: Assertion failure in
clang::Expr::getBestDynamicClassType (via
optin.cplusplus.VirtualCall SA checker)
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Static Analyzer
  Assignee: dcough...@apple.com
  Reporter: ale...@google.com
CC: llvm-bugs@lists.llvm.org

$ cat getBestDynamicClassType-crash.cc
class a {
 public:
  void b() const;
};
class c {
  int m_fn2() const;
  a d[];
};
int c::m_fn2() const { d->b(); }
$ clang-tidy -checks=-*,clang-analyzer-optin.cplusplus.VirtualCall
getBestDynamicClassType-crash.cc -- -std=c++11
assert.h assertion failed at llvm/include/llvm/Support/Casting.h:241 in
typename std::enable_if::value, typename cast_retty::ret_type>::type llvm::cast(const Y &) [X = clang::RecordType, Y =
clang::QualType]: isa(Val) && "cast() argument of incompatible type!"
@  0x544749a  __assert_fail
@  0x1adcd36  llvm::cast<>()
@  0x2d43339  clang::Type::castAs<>()
@  0x40913d7  clang::Expr::getBestDynamicClassType()
@  0x28346d0  isVirtualCall()
@  0x283412c  (anonymous
namespace)::VirtualCallChecker::checkPreCall()
@  0x2834030  clang::ento::check::PreCall::_checkCall<>()
@  0x2e03982  clang::ento::CheckerFn<>::operator()()
@  0x2df971a  (anonymous namespace)::CheckCallContext::runChecker()
@  0x2df670e  expandGraphWithCheckers<>()
@  0x2df6460 
clang::ento::CheckerManager::runCheckersForCallEvent()
@  0x2e57bf5  clang::ento::CheckerManager::runCheckersForPreCall()
@  0x2e5a297  clang::ento::ExprEngine::evalCall()
@  0x2e5a19b  clang::ento::ExprEngine::VisitCallExpr()
@  0x2e12f24  clang::ento::ExprEngine::Visit()
@  0x2e0fe44  clang::ento::ExprEngine::ProcessStmt()
@  0x2e0faca  clang::ento::ExprEngine::processCFGElement()
@  0x2e3dc66  clang::ento::CoreEngine::HandlePostStmt()
@  0x2e3d566  clang::ento::CoreEngine::dispatchWorkItem()
@  0x2e3d0a8  clang::ento::CoreEngine::ExecuteWorkList()
@  0x2138e05  clang::ento::ExprEngine::ExecuteWorkList()
@  0x20e1802  (anonymous
namespace)::AnalysisConsumer::ActionExprEngine()
@  0x20e15c1  (anonymous
namespace)::AnalysisConsumer::RunPathSensitiveChecks()
@  0x20e1285  (anonymous namespace)::AnalysisConsumer::HandleCode()
@  0x20d4963  (anonymous
namespace)::AnalysisConsumer::HandleDeclsCallGraph()
@  0x20d2be7  (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit()
@  0x25136ce  clang::MultiplexConsumer::HandleTranslationUnit()
@  0x2f59506  clang::ParseAST()
@  0x250109a  clang::ASTFrontendAction::ExecuteAction()

Devin, assigning to you, as the latest to make a significant change in this
code.

-- 
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


[llvm-bugs] [Bug 34452] New: NewGVN: Assertion `Val && "isa<> used on a null pointer

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34452

Bug ID: 34452
   Summary: NewGVN: Assertion `Val && "isa<> used on a null
pointer
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: tob...@grosser.es
CC: llvm-bugs@lists.llvm.org

Created attachment 19098
  --> https://bugs.llvm.org/attachment.cgi?id=19098&action=edit
NewGVN

NewGVN fails when running 'opt -newgvn' on out.ll:

opt: /home/grosser/Projects/polly/git/include/llvm/Support/Casting.h:106:
static bool llvm::isa_impl_cl::doit(const From *) [To = llvm::Instruction, From = const llvm::Value *]:
Assertion `Val && "isa<> used on a null pointer"' failed.
#0 0x7f30d3b63144 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/grosser/Projects/polly/git/lib/Support/Unix/Signals.inc:398:13
#1 0x7f30d3b63476 bool __gnu_cxx::operator!=*, std::vector,
std::allocator > >
>(__gnu_cxx::__normal_iterator*,
std::vector, std::allocator > > > const&, __gnu_cxx::__normal_iterator*, std::vector,
std::allocator > > > const&)
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/bits/stl_iterator.h:880:27
#2 0x7f30d3b63476 llvm::sys::RunSignalHandlers()
/home/grosser/Projects/polly/git/lib/Support/Signals.cpp:49:0
#3 0x7f30d3b63476 SignalHandler(int)
/home/grosser/Projects/polly/git/lib/Support/Unix/Signals.inc:242:0
#4 0x7f30d6767630 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11630)
#5 0x7f30d10007ef gsignal
/build/glibc-MECilU/glibc-2.24/signal/../sysdeps/unix/sysv/linux/raise.c:58:0
#6 0x7f30d10023ea abort /build/glibc-MECilU/glibc-2.24/stdlib/abort.c:91:0
#7 0x7f30d0ff8bb7 __assert_fail_base
/build/glibc-MECilU/glibc-2.24/assert/assert.c:92:0

-- 
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


[llvm-bugs] [Bug 34453] New: CLAMR breaks on AArch64

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34453

Bug ID: 34453
   Summary: CLAMR breaks on AArch64
   Product: Test Suite
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Programs Tests
  Assignee: unassignedb...@nondot.org
  Reporter: renato.go...@linaro.org
CC: llvm-bugs@lists.llvm.org

Due to an alignment issue between input.cpp and mesh.cpp's declaration of
`neighbor_remap` (int and bool, respectively), we get alignment error in a
linker relocation: misaligned R_AARCH64_LDST32_ABS_LO12_NC

http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/8141

-- 
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


[llvm-bugs] [Bug 34454] New: [X86] Failure to prevent schedule across x87 control word instructions

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34454

Bug ID: 34454
   Summary: [X86] Failure to prevent schedule across x87 control
word instructions
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Backend: X86
  Assignee: unassignedb...@nondot.org
  Reporter: llvm-...@redking.me.uk
CC: craig.top...@gmail.com, ema...@freebsd.org,
gadi.ha...@intel.com, llvm-bugs@lists.llvm.org,
spatel+l...@rotateright.com

Branched off from [Bug #34080].

The partial SandyBridge schedule model (which is used for all default x86-64
targets) resulted in the scheduler moving some instructions across fldcw/fnstcw
instructions, affecting rounding of truncated stores etc.

The issue appears to be that we're incorrectly handling the control word
register dependency, which is odd because it looks like fldcw/fnstcw are
correctly flagged to cause side effects.

It could also be a chain issue in the fptosi store code in
X86TargetLowering::EmitInstrWithCustomInserter but I didn't notice anything.

Exposing this is tricky, and seems to involve applying rL307529 but not
rL310792.

-- 
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


[llvm-bugs] [Bug 34455] New: clang-format became really slow on pre-processed files

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34455

Bug ID: 34455
   Summary: clang-format became really slow on pre-processed files
   Product: clang
   Version: trunk
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Formatter
  Assignee: unassignedclangb...@nondot.org
  Reporter: gonzalob...@gmail.com
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org

I used to be able to format large pre-processed files with clang-format without
issues. But with the latest trunk formatting does not terminate. 

The example that clang-format fails to format is:

https://github.com/gnzlbg/clang_format_test/blob/master/test.cpp

-- 
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


[llvm-bugs] [Bug 34456] New: DynamicLibrary Shutdown unit test crashes when built with /MTd

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34456

Bug ID: 34456
   Summary: DynamicLibrary Shutdown unit test crashes when built
with /MTd
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: Support Libraries
  Assignee: unassignedb...@nondot.org
  Reporter: jh7370.2...@my.bristol.ac.uk
CC: llvm-bugs@lists.llvm.org

In DynamicLibraryTest.cpp, the unit test "Shutdown" crashes if building with
Visual Studio and the cmake variable "LLVM_USE_CRT_DEBUG" is set to /MTd.

The problem appears to be that in this mode, allocating in the main
executable's heap and destroying from the DLL (or vice versa) is not allowed.
During the test, a vector owned by the main executable is resized by the DLL,
resulting in the crash as it deallocates the original vector element.

I attempted to reserve space in the vector to fix the issue, but then the
copying of the string within push_back (called during the Global destructor in
PipSqueak) resulted in a memory allocation in the DLL, leading to a crash when
destroying the vector in the main executable.

-- 
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


[llvm-bugs] [Bug 34382] [X86] Not taking advantage of the permute-in-lane instruction (vpermilps)

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34382

Simon Pilgrim  changed:

   What|Removed |Added

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

--- Comment #2 from Simon Pilgrim  ---
rL312486

-- 
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


[llvm-bugs] [Bug 34453] CLAMR breaks on AArch64

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34453

Hal Finkel  changed:

   What|Removed |Added

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

--- Comment #2 from Hal Finkel  ---
I've recommitted in r312488. That wasn't the only ODR violation. Hopefully,
they're all fixed now.

-- 
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


[llvm-bugs] [Bug 34457] New: polly crashes with "opt -simplifycfg -newgvn -instcombine -polly-mse -polly-optree" while running pass 'Polly - Forward operand tree'

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34457

Bug ID: 34457
   Summary: polly crashes with "opt -simplifycfg -newgvn
-instcombine -polly-mse -polly-optree" while running
pass 'Polly - Forward operand tree'
   Product: Polly
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Optimizer
  Assignee: polly-...@googlegroups.com
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
9b9a71803226ccc3c9310312967117875b9ff77e) (http://llvm.org/git/llvm.git
2677f9404b42bfb87e26402dc878fe08378c1129)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clangpolly -O3 -mllvm -disable-llvm-optzns -c -emit-llvm -o small.bc small.c
$ optpolly -simplifycfg -newgvn -instcombine -polly-mse -polly-optree -o
small-opt.bc small.bc
optpolly: /home/su/software/tmp/polly/llvm/include/llvm/Support/Casting.h:106:
static bool llvm::isa_impl_cl::doit(const From*) [with To =
llvm::StoreInst; From = llvm::Instruction]: Assertion `Val && "isa<> used on a
null pointer"' failed.
#0 0x039745c5 (optpolly+0x39745c5)
#1 0x03974658 (optpolly+0x3974658)
#2 0x0397289f (optpolly+0x397289f)
#3 0x03973e3a (optpolly+0x3973e3a)
#4 0x7fd5bd2a4390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#5 0x7fd5bc016428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#6 0x7fd5bc01802a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#7 0x7fd5bc00ebd7 __assert_fail_base
/build/glibc-bfm8X4/glibc-2.23/assert/assert.c:92:0
#8 0x7fd5bc00ec82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#9 0x018d3fd0 (optpolly+0x18d3fd0)
#10 0x018d3564 (optpolly+0x18d3564)
#11 0x01ba954e (optpolly+0x1ba954e)
#12 0x01ba88b1 (optpolly+0x1ba88b1)
#13 0x03cbbfbb (optpolly+0x3cbbfbb)
#14 0x03cbc1dd (optpolly+0x3cbc1dd)
#15 0x03ca64b2 (optpolly+0x3ca64b2)
#16 0x03ca897a (optpolly+0x3ca897a)
#17 0x03d7a943 (optpolly+0x3d7a943)
#18 0x02acfaf0 (optpolly+0x2acfaf0)
#19 0x031f6f6e (optpolly+0x31f6f6e)
#20 0x031f7107 (optpolly+0x31f7107)
#21 0x031f7482 (optpolly+0x31f7482)
#22 0x031f7b97 (optpolly+0x31f7b97)
#23 0x031f7da3 (optpolly+0x31f7da3)
#24 0x0172ca2e (optpolly+0x172ca2e)
#25 0x7fd5bc001830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#26 0x01704069 (optpolly+0x1704069)
Stack dump:
0.  Program arguments: optpolly -simplifycfg -newgvn -instcombine
-polly-mse -polly-optree -o small-opt.bc small.bc 
1.  Running pass 'Function Pass Manager' on module 'small.bc'.
2.  Running pass 'Region Pass Manager' on function '@foo'
3.  Running pass 'Polly - Forward operand tree' on basic block '%for.cond'
Aborted (core dumped)
$ 


-


void foo ()
{
  int a, b, c;
  for (b = 0; b < 16; b++)
{
  a = b;
  for (c = 8; c; c--)
if (a)
  a = a / 2;
  c = a;
}
}

int main ()
{
  foo ();
  return 0; 
}

-- 
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


[llvm-bugs] [Bug 34458] New: polly crashes with "opt -mem2reg -polly-mse" while running pass 'Polly - Maximal static expansion of SCoP'

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34458

Bug ID: 34458
   Summary: polly crashes with "opt -mem2reg -polly-mse" while
running pass 'Polly - Maximal static expansion of
SCoP'
   Product: Polly
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Optimizer
  Assignee: polly-...@googlegroups.com
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
9b9a71803226ccc3c9310312967117875b9ff77e) (http://llvm.org/git/llvm.git
2677f9404b42bfb87e26402dc878fe08378c1129)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clangpolly -O3 -mllvm -disable-llvm-optzns -c -emit-llvm -o small.bc small.c
$ optpolly -mem2reg -polly-mse -o small-opt.bc small.bc
#0 0x039745c5 (optpolly+0x39745c5)
#1 0x03974658 (optpolly+0x3974658)
#2 0x0397289f (optpolly+0x397289f)
#3 0x03973e3a (optpolly+0x3973e3a)
#4 0x7f678c5fa390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#5 0x03c979c4 (optpolly+0x3c979c4)
#6 0x03c9a8a0 (optpolly+0x3c9a8a0)
#7 0x03c9a8d1 (optpolly+0x3c9a8d1)
#8 0x03cc4706 (optpolly+0x3cc4706)
#9 0x03cca87b (optpolly+0x3cca87b)
#10 0x03ccb560 (optpolly+0x3ccb560)
#11 0x03d7a943 (optpolly+0x3d7a943)
#12 0x02acfaf0 (optpolly+0x2acfaf0)
#13 0x031f6f6e (optpolly+0x31f6f6e)
#14 0x031f7107 (optpolly+0x31f7107)
#15 0x031f7482 (optpolly+0x31f7482)
#16 0x031f7b97 (optpolly+0x31f7b97)
#17 0x031f7da3 (optpolly+0x31f7da3)
#18 0x0172ca2e (optpolly+0x172ca2e)
#19 0x7f678b357830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#20 0x01704069 (optpolly+0x1704069)
Stack dump:
0.  Program arguments: optpolly -mem2reg -polly-mse -o small-opt.bc
small.bc 
1.  Running pass 'Function Pass Manager' on module 'small.bc'.
2.  Running pass 'Region Pass Manager' on function '@foo'
3.  Running pass 'Polly - Maximal static expansion of SCoP' on basic block
'%while.cond'
Segmentation fault (core dumped)
$ 





int a, b;

void foo ()
{
  for (; a; a++)
{
  int c;
  while (c)
;
  for (; c < 1; c++)
b = 1;
}
}

int main ()
{
  foo ();
  return 0; 
}

-- 
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


[llvm-bugs] [Bug 34459] New: opt crashes with "opt -inline -instcombine -adce -newgvn -gvn-hoist": Assertion `dominates(MD, U) && "Memory Def does not dominate it's uses"' failed

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34459

Bug ID: 34459
   Summary: opt crashes with "opt -inline -instcombine -adce
-newgvn -gvn-hoist": Assertion `dominates(MD, U) &&
"Memory Def does not dominate it's uses"' failed
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

$ clang -v
clang version 6.0.0 (trunk 312462)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clang -w -O3 -mllvm -disable-llvm-optzns -c -emit-llvm -o small.bc small.c
$ opt -inline -instcombine -adce -newgvn -gvn-hoist -o small-opt.bc small.bc
opt: /tmp/llvm-builder/llvm-source-trunk/lib/Analysis/MemorySSA.cpp:1715: void
llvm::MemorySSA::verifyDomination(llvm::Function&) const: Assertion
`dominates(MD, U) && "Memory Def does not dominate it's uses"' failed.
#0 0x01e5966a (opt+0x1e5966a)
#1 0x01e573de (opt+0x1e573de)
#2 0x01e57552 (opt+0x1e57552)
#3 0x7f4159b0d390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x7f415887f428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x7f415888102a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#6 0x7f4158877bd7 __assert_fail_base
/build/glibc-bfm8X4/glibc-2.23/assert/assert.c:92:0
#7 0x7f4158877c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x0142c9a7 (opt+0x142c9a7)
#9 0x0142c9e9 (opt+0x142c9e9)
#10 0x0193c509 (opt+0x193c509)
#11 0x0194023a (opt+0x194023a)
#12 0x0137596e (opt+0x137596e)
#13 0x0193fe7d (opt+0x193fe7d)
#14 0x006f30d6 (opt+0x6f30d6)
#15 0x7f415886a830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#16 0x00765a09 (opt+0x765a09)
Stack dump:
0.  Program arguments: opt -inline -instcombine -adce -newgvn -gvn-hoist -o
small-opt.bc small.bc 
1.  Running pass 'CallGraph Pass Manager' on module 'small.bc'.
Aborted (core dumped)
$ 


---


int a, b, c, e, f, g, h, i, j, k;
char d;

int fn1 (int l)
{
  return a ? l : a;
}

char fn2 ()
{
  return b ? d : b;
}

int fn3 (int l)
{
  return l ? l : c;
}

int fn4 ()
{
  return e ? e : f;
}

void fn5 ()
{
  while (j)
;
  if (1 | ((g || fn1 (fn2 () > i)) > 0))
;
  else 
{
L:
  fn3 ((h && 0, fn4 ()));
  if (k)
goto L;
}
}

int main ()
{
  fn5 (); 
  return 0;  
}

-- 
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


[llvm-bugs] [Bug 34460] New: Assertion failure in clang::ento::SVal::castAs

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34460

Bug ID: 34460
   Summary: Assertion failure in clang::ento::SVal::castAs
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Static Analyzer
  Assignee: ga...@apple.com
  Reporter: ale...@google.com
CC: llvm-bugs@lists.llvm.org

$ cat castAs-crash.cc
void mempcpy(void *, void *, long);
short a;
class b {
  int c;
  long g;
  void d() {
int e = c;
f += e;
mempcpy(f, &a, g);
  }
  unsigned *f;
};
$ clang-tidy -checks=-*,clang-analyzer-unix.cstring*  castAs-crash.cc --
-std=c++11
assert.h assertion failed at
llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:93 in
T clang::ento::SVal::castAs() const [T = clang::ento::loc::MemRegionVal]:
T::isKind(*this)
@  0x544749a  __assert_fail
@  0x2839e1a  clang::ento::SVal::castAs<>()
@  0x2cdecd5  (anonymous
namespace)::CStringChecker::evalCopyCommon()
@  0x2cdc59e  (anonymous namespace)::CStringChecker::evalMempcpy()
@  0x2cdc384  (anonymous namespace)::CStringChecker::evalCall()
@  0x2cdb140  clang::ento::eval::Call::_evalCall<>()
@  0x2dfb722  clang::ento::CheckerFn<>::operator()()
@  0x2df879a  clang::ento::CheckerManager::runCheckersForEvalCall()
@  0x2e5a2d9  clang::ento::ExprEngine::evalCall()
@  0x2e5a19b  clang::ento::ExprEngine::VisitCallExpr()
@  0x2e12f24  clang::ento::ExprEngine::Visit()
@  0x2e0fe44  clang::ento::ExprEngine::ProcessStmt()
@  0x2e0faca  clang::ento::ExprEngine::processCFGElement()
@  0x2e3dc66  clang::ento::CoreEngine::HandlePostStmt()
@  0x2e3d566  clang::ento::CoreEngine::dispatchWorkItem()
@  0x2e3d0a8  clang::ento::CoreEngine::ExecuteWorkList()
@  0x2138e05  clang::ento::ExprEngine::ExecuteWorkList()
@  0x20e1802  (anonymous
namespace)::AnalysisConsumer::ActionExprEngine()
@  0x20e15c1  (anonymous
namespace)::AnalysisConsumer::RunPathSensitiveChecks()
@  0x20e1285  (anonymous namespace)::AnalysisConsumer::HandleCode()
@  0x20d4963  (anonymous
namespace)::AnalysisConsumer::HandleDeclsCallGraph()
@  0x20d2be7  (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit()
@  0x25136ce  clang::MultiplexConsumer::HandleTranslationUnit()
@  0x2f59506  clang::ParseAST()
@  0x250109a  clang::ASTFrontendAction::ExecuteAction()
@  0x2500b30  clang::FrontendAction::Execute()
@  0x23192c2  clang::CompilerInstance::ExecuteAction()
@  0x21eac92 
clang::tooling::FrontendActionFactory::runInvocation()
@  0x21eab33  clang::tooling::ToolInvocation::runInvocation()

-- 
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


[llvm-bugs] [Bug 34461] New: opt crashes with "opt -gvn -inline -slp-vectorizer -adce -gvn-hoist -sroa": Assertion `UBB == DBB' failed

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34461

Bug ID: 34461
   Summary: opt crashes with "opt -gvn -inline -slp-vectorizer
-adce -gvn-hoist -sroa": Assertion `UBB == DBB' failed
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

$ clang -v
clang version 6.0.0 (trunk 312462)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clang -O3 -mllvm -disable-llvm-optzns -w -c -emit-llvm -o small.bc small.c
$ opt -gvn -inline -slp-vectorizer -adce -gvn-hoist -sroa -o small-opt.bc
small.bc
opt:
/tmp/llvm-builder/llvm-source-trunk/lib/Transforms/Scalar/GVNHoist.cpp:526:
bool llvm::GVNHoist::safeToHoistLdSt(const llvm::Instruction*, const
llvm::Instruction*, llvm::MemoryUseOrDef*, llvm::GVNHoist::InsKind, int&):
Assertion `UBB == DBB' failed.
#0 0x01f3031a (opt+0x1f3031a)
#1 0x01f2e4ae (opt+0x1f2e4ae)
#2 0x01f2e610 (opt+0x1f2e610)
#3 0x7fbc9195b330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x7fbc90743c37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x7fbc90747028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#6 0x7fbc9073cbf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#7 0x7fbc9073cca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x01d38039 (opt+0x1d38039)
#9 0x01d38879 (opt+0x1d38879)
#10 0x01d38cfb (opt+0x1d38cfb)
#11 0x01d39b0d (opt+0x1d39b0d)
#12 0x01d3a063 (opt+0x1d3a063)
#13 0x01d3a464 (opt+0x1d3a464)
#14 0x01a51963 (opt+0x1a51963)
#15 0x01496626 (opt+0x1496626)
#16 0x01a5227a (opt+0x1a5227a)
#17 0x007fcfb7 (opt+0x7fcfb7)
#18 0x7fbc9072ef45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#19 0x00860c6a (opt+0x860c6a)
Stack dump:
0.  Program arguments: opt -gvn -inline -slp-vectorizer -adce -gvn-hoist
-sroa -o small-opt.bc small.bc 
1.  Running pass 'CallGraph Pass Manager' on module 'small.bc'.
2.  Running pass 'Early GVN Hoisting of Expressions' on function '@bj'
Aborted (core dumped)
$ 





long m, d, e, r, s, u, v, w;
int a, g, h, j, o, p, q, t, x, y, ab, ac;
char c, i, k, n, z;
short f, l;
unsigned ae;

char af (int i) { return 0; }
char ag (int ah) { return 0; }
void ai (int i, ...) {}
char aj (int ah) { return 0; }
void ak () {}
short al (int ah) { return 0; }
int am (int i, int j) { return 0; }
int an (int i) { return 0; }
long ao (long ah, long ap) { return 0; }
long aq (int ah) {  return !ah || m && m % ah; }
void ar () {}
char as (int i) { return 0; }
char at (int i) { return 0; }
short au () { return 0; }
short av (short ah, short ap) { return 0; }
short aw (int i) { return 0; }
short ax (int i) { return i; }
int ay (int i, int j) { return 0; }
long az (long ah, long ap) { return 0; }

static long ba (int ah)
{
  int bb, bc, bd;
  short be;
  if (k)
{
  int bf;
  short bg;
  n = 0;
  while (n)
{
  int b = bf;
  aw (ah) >= ah;
  -1L >= ae && (ah == ah, ah);
  ak ();
  if (ax (ah))
{
  o = c ^ ah ^ f;
  char b 

[llvm-bugs] [Bug 34462] New: opt crashes with "opt -jump-threading -mem2reg -gvn -ipsccp -gvn -adce -gvn-hoist": Assertion `UpperBound != 0' failed

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34462

Bug ID: 34462
   Summary: opt crashes with "opt -jump-threading -mem2reg -gvn
-ipsccp -gvn -adce -gvn-hoist": Assertion `UpperBound
!= 0' failed
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

$ clang -v
clang version 6.0.0 (trunk 312462)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clang -w -O3 -mllvm -disable-llvm-optzns -c -emit-llvm -o small.bc small.c
$ opt -jump-threading -mem2reg -gvn -ipsccp -gvn -adce -gvn-hoist -o
small-opt.bc small.bc
opt: /tmp/llvm-builder/llvm-source-trunk/lib/Analysis/MemorySSA.cpp:1248: void
llvm::MemorySSA::OptimizeUses::optimizeUsesInBlock(const llvm::BasicBlock*,
long unsigned int&, long unsigned int&,
llvm::SmallVectorImpl&,
llvm::DenseMap<{anonymous}::MemoryLocOrCall,
llvm::MemorySSA::OptimizeUses::MemlocStackInfo>&): Assertion `UpperBound != 0'
failed.
#0 0x01f3031a (opt+0x1f3031a)
#1 0x01f2e4ae (opt+0x1f2e4ae)
#2 0x01f2e610 (opt+0x1f2e610)
#3 0x7fe7428f5330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x7fe7416ddc37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x7fe7416e1028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#6 0x7fe7416d6bf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#7 0x7fe7416d6ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x01557cb3 (opt+0x1557cb3)
#9 0x01559ce2 (opt+0x1559ce2)
#10 0x0155a0dc (opt+0x155a0dc)
#11 0x01a51963 (opt+0x1a51963)
#12 0x01a51a0c (opt+0x1a51a0c)
#13 0x01a5227a (opt+0x1a5227a)
#14 0x007fcfb7 (opt+0x7fcfb7)
#15 0x7fe7416c8f45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#16 0x00860c6a (opt+0x860c6a)
Stack dump:
0.  Program arguments: opt -jump-threading -mem2reg -gvn -ipsccp -gvn -adce
-gvn-hoist -o small-opt.bc small.bc 
1.  Running pass 'Function Pass Manager' on module 'small.bc'.
2.  Running pass 'Memory SSA' on function '@fn1'
Aborted (core dumped)
$ 


---


int printf (const char *, ...);

int a, b, c, d, e, f, g, h;

void fn1 ()
{
  long j = -2810502576847672268; 
  int k = j; 
  if (b)
printf ("0");
  if (k)
h;
  if (b)
while (e)
  {
char l = c || d || a;
int m, n = m / j;
m = n = e;
if (c || (f && j > l))
  printf ("1");
if (j && l)
  continue;
e = n;
if (g)
  return;
  }
}

int main ()
{
  fn1 (); 
  return 0;
}

-- 
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


[llvm-bugs] [Bug 34463] New: Can't compile with address sanitizer using clang3.9 trusty package

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34463

Bug ID: 34463
   Summary: Can't compile with address sanitizer using clang3.9
trusty package
   Product: new-bugs
   Version: 3.9
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: lec...@gmail.com
CC: llvm-bugs@lists.llvm.org

I can't seem to link any application using clang3.9 from the ubuntu trusty
package when using -fsanitize=address.


The error is the following :

/usr/bin/clang++-3.9 -fsanitize=address,undefined,integer
-fno-omit-frame-pointer -fno-sanitize=unsigned-integer-overflow
-D__extern_always_inline=inline -stdlib=libc++ -nostdinc++ -cxx-isystem
/usr/include/c++/v1/ -Wno-unused-command-line-argument
CMakeFiles/cmTC_c37c8.dir/testCXXCompiler.cxx.o -o cmTC_c37c8
/usr/bin/ld:
   
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/lib/linux/libclang_rt.asan-x86_64.a(asan_allocator.cc.o):
unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value


Here is my travis log :

https://travis-ci.org/Lectem/range-v3/jobs/271277307#L1417


The very same travis build, but this time on Ubuntu precise works :

https://travis-ci.org/Lectem/range-v3/jobs/271278949

-- 
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


[llvm-bugs] [Bug 34464] New: clang crashes at -O2 and above with polly and newgvn: Assertion `ArrayAccess && "No array access found for instruction!"' failed.

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34464

Bug ID: 34464
   Summary: clang crashes at -O2 and above with polly and newgvn:
Assertion `ArrayAccess && "No array access found for
instruction!"' failed.
   Product: Polly
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Optimizer
  Assignee: polly-...@googlegroups.com
  Reporter: helloqi...@gmail.com
CC: llvm-bugs@lists.llvm.org

The hashtag for polly is 8c351e694ba7.

$ clang-trunk -v
clang version 6.0.0 (trunk 312472)
Target: x86_64-unknown-linux-gnu


$ clang-trunk -O2 -mllvm -enable-newgvn -mllvm -polly abc.c
abc.c:19:9: warning: incompatible pointer types assigning to 'char *' from
'short *' [-Wincompatible-pointer-types]
  h = &d;
^ ~~
abc.c:22:3: warning: expression result unused [-Wunused-value]
  a ?: (c = 3);
  ^~~~
abc.c:12:13: warning: implicit conversion from 'int' to 'short' changes value
from 50423 to -15113 [-Wconstant-conversion]
  short g = 50423;
~   ^
clang-6.0: /home/absozero/trunk/llvm/tools/polly/include/polly/ScopInfo.h:1494:
polly::MemoryAccess& polly::ScopStmt::getArrayAccessFor(const
llvm::Instruction*) const: Assertion `ArrayAccess && "No array access found for
instruction!"' failed.
#0 0x020c60aa llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x20c60aa)
#1 0x020c3f2e llvm::sys::RunSignalHandlers()
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x20c3f2e)
#2 0x020c4082 SignalHandler(int)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x20c4082)
#3 0x7ff353705330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x7ff352282c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x7ff352286028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x7ff35227bbf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x7ff35227bca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0279369f (/home/absozero/trunk/root-clang/bin/clang-6.0+0x279369f)
#9 0x02793efd
polly::BlockGenerator::generateArrayLoad(polly::ScopStmt&, llvm::LoadInst*,
llvm::DenseMap, llvm::AssertingVH,
llvm::DenseMapInfo >,
llvm::detail::DenseMapPair,
llvm::AssertingVH > >&, llvm::DenseMap,
llvm::detail::DenseMapPair >&,
isl_id_to_ast_expr*) (/home/absozero/trunk/root-clang/bin/clang-6.0+0x2793efd)
#10 0x0279506f polly::BlockGenerator::copyInstruction(polly::ScopStmt&,
llvm::Instruction*, llvm::DenseMap,
llvm::AssertingVH,
llvm::DenseMapInfo >,
llvm::detail::DenseMapPair,
llvm::AssertingVH > >&, llvm::DenseMap,
llvm::detail::DenseMapPair >&,
isl_id_to_ast_expr*) (/home/absozero/trunk/root-clang/bin/clang-6.0+0x279506f)
#11 0x0279519b polly::BlockGenerator::copyBB(polly::ScopStmt&,
llvm::BasicBlock*, llvm::BasicBlock*,
llvm::DenseMap, llvm::AssertingVH,
llvm::DenseMapInfo >,
llvm::detail::DenseMapPair,
llvm::AssertingVH > >&, llvm::DenseMap,
llvm::detail::DenseMapPair >&,
isl_id_to_ast_expr*) (/home/absozero/trunk/root-clang/bin/clang-6.0+0x279519b)
#12 0x0279a13a polly::RegionGenerator::copyStmt(polly::ScopStmt&,
llvm::DenseMap, llvm::detail::DenseMapPair >&, isl_id_to_ast_expr*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x279a13a)
#13 0x027a7b13 IslNodeBuilder::createUser(isl_ast_node*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x27a7b13)
#14 0x027a4a58 IslNodeBuilder::createBlock(isl_ast_node*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x27a4a58)
#15 0x0274a0d0 CodeGen(polly::Scop&, polly::IslAstInfo&,
llvm::LoopInfo&, llvm::DominatorTree&, llvm::ScalarEvolution&,
llvm::RegionInfo&) [clone .constprop.273]
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x274a0d0)
#16 0x01761693 llvm::RGPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1761693)
#17 0x01c1f913 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1c1f913)
#18 0x01c1f9dc llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1c1f9dc)
#19 0x01c1f4ad llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1c1f4ad)
#20 0x0226f076 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr >)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x226f076)
#21 0x02a7415f
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2a7415f)
#22 0x00

[llvm-bugs] [Bug 34465] New: llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp:100: dead code ?

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34465

Bug ID: 34465
   Summary: llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
:100: dead code ?
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: dcb...@hotmail.com
CC: llvm-bugs@lists.llvm.org

llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp:100]: (warning) Opposite
inner 'if' condition leads to a dead code block.

Source code is

  for (CallEvent::param_type_iterator I = param_type_begin(),
  E = param_type_end();
   I != E && Idx < NumOfArgs; ++I, ++Idx) {
if (NumOfArgs <= Idx)
  break;

Suggest delete if condition.

-- 
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


[llvm-bugs] [Bug 34466] New: opt crashes with "opt -polly-canonicalize -polly-dependences -adce -newgvn -gvn-hoist": Assertion `DT->dominates(NewBB, OldBB) && "invalid path"' failed

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34466

Bug ID: 34466
   Summary: opt crashes with "opt -polly-canonicalize
-polly-dependences -adce -newgvn -gvn-hoist":
Assertion `DT->dominates(NewBB, OldBB) && "invalid
path"' failed
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
c55c0db172fe48c0ee64bd86d2cb35c3e38f328b) (http://llvm.org/git/llvm.git
2677f9404b42bfb87e26402dc878fe08378c1129)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clangpolly -O3 -mllvm -disable-llvm-optzns -c -emit-llvm -o small.bc small.c
$ optpolly -polly-canonicalize -polly-dependences -adce -newgvn -gvn-hoist -o
small-opt.bc small.bc
optpolly:
/home/su/software/tmp/polly/llvm/lib/Transforms/Scalar/GVNHoist.cpp:401: bool
llvm::GVNHoist::hasEHOrLoadsOnPath(const llvm::Instruction*, llvm::MemoryDef*,
int&): Assertion `DT->dominates(NewBB, OldBB) && "invalid path"' failed.
#0 0x038afd3c (optpolly+0x38afd3c)
#1 0x038afdcd (optpolly+0x38afdcd)
#2 0x038ae1e2 (optpolly+0x38ae1e2)
#3 0x038af6bf (optpolly+0x38af6bf)
#4 0x7fbddff60330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#5 0x7fbdded48c37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#6 0x7fbdded4c028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#7 0x7fbdded41bf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#8 0x7fbdded41ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#9 0x035dfcae (optpolly+0x35dfcae)
#10 0x035e0292 (optpolly+0x35e0292)
#11 0x035e08de (optpolly+0x35e08de)
#12 0x035e0d68 (optpolly+0x35e0d68)
#13 0x035e24da (optpolly+0x35e24da)
#14 0x035df4ca (optpolly+0x35df4ca)
#15 0x035e2790 (optpolly+0x35e2790)
#16 0x031940ee (optpolly+0x31940ee)
#17 0x03194281 (optpolly+0x3194281)
#18 0x0319461c (optpolly+0x319461c)
#19 0x03194d73 (optpolly+0x3194d73)
#20 0x03194fb3 (optpolly+0x3194fb3)
#21 0x017fe1b8 (optpolly+0x17fe1b8)
#22 0x7fbdded33f45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#23 0x017d7ac9 (optpolly+0x17d7ac9)
Stack dump:
0.  Program arguments: optpolly -polly-canonicalize -polly-dependences
-adce -newgvn -gvn-hoist -o small-opt.bc small.bc 
1.  Running pass 'Function Pass Manager' on module 'small.bc'.
2.  Running pass 'Early GVN Hoisting of Expressions' on function '@fn1'
Aborted (core dumped)
$ 


-


int a, b, c;

void fn1 ()
{
  int e;
  while (b) 
if (e && a)
{
  int f;
  if (c)
while (f)
  ;
  else
{
  int g;
  for (; 2;)
return;
}
}
}

int main ()
{
  fn1 ();
  return 0; 
}

-- 
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


[llvm-bugs] [Bug 34467] New: llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp:100: dead code ?

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34467

Bug ID: 34467
   Summary: llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
:100: dead code ?
   Product: new-bugs
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: new bugs
  Assignee: unassignedb...@nondot.org
  Reporter: dcb...@hotmail.com
CC: llvm-bugs@lists.llvm.org

llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp:100]: (warning) Opposite
inner 'if' condition leads to a dead code block.

Source code is

  for (CallEvent::param_type_iterator I = param_type_begin(),
  E = param_type_end();
   I != E && Idx < NumOfArgs; ++I, ++Idx) {
if (NumOfArgs <= Idx)
  break;

Suggest delete if condition.

-- 
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


[llvm-bugs] [Bug 17683] Optimize division of positive signed integer by power of 2 to a simple shift

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=17683

Sanjay Patel  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
 CC||haich...@codeaurora.org

--- Comment #3 from Sanjay Patel  ---
This was fixed via correlated-propagation in:
https://reviews.llvm.org/rL263406 (clang 3.9 gets this)

-- 
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


[llvm-bugs] [Bug 17713] optimization: propagate equalities for fcmp (floating point compares)

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=17713
Bug 17713 depends on bug 17683, which changed state.

Bug 17683 Summary: Optimize division of positive signed integer by power of 2 
to a simple shift
https://bugs.llvm.org/show_bug.cgi?id=17683

   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
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 34438] LoopVectorizer bails out when ShortTripCount=8, MaxVF=16

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34438

Zvi Rackover  changed:

   What|Removed |Added

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

-- 
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


[llvm-bugs] [Bug 34468] New: LoopVectorizer creates a dead loop when ShortTripCount=32, MaxVF=64

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34468

Bug ID: 34468
   Summary: LoopVectorizer creates a dead loop when
ShortTripCount=32, MaxVF=64
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Loop Optimizer
  Assignee: unassignedb...@nondot.org
  Reporter: zvi.racko...@intel.com
CC: llvm-bugs@lists.llvm.org

Here's another case where we mess-up vectorization of a loop with a constant
trip count. This time for MaxVL=64, TripCount=32 (which is larger than the
TinyTripCount threshold, but still lower than MaxVL). Thanks to Ayal for
mentioning this kind of case in https://reviews.llvm.org/D37425.

***
 target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.8.0"
 define void @small_tc(i8* noalias nocapture %A, i8* noalias nocapture readonly
%B) {
 entry:
   br label %for.body

 for.body:
   %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
   %arrayidx = getelementptr inbounds i8, i8* %B, i64 %indvars.iv
   %0 = load i8, i8* %arrayidx, align 4, !llvm.mem.parallel_loop_access !3
   %arrayidx2 = getelementptr inbounds i8, i8* %A, i64 %indvars.iv
   %1 = load i8, i8* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3
   %add = add i8 %0, %1
   store i8 %add, i8* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3
   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
   %exitcond = icmp eq i64 %indvars.iv.next, 32
   br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !4

 for.end:
   ret void
 }

 !3 = !{!3}
 !4 = !{!4}
***

opt -loop-vectorize -S -mcpu=skx 
Results with:
***
define void @small_tc(i8* noalias nocapture %A, i8* noalias nocapture readonly
%B) #0 {
entry:
  br i1 true, label %scalar.ph, label %vector.ph

vector.ph:; preds = %entry
  br label %vector.body

vector.body:  ; preds = %vector.body,
%vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %broadcast.splatinsert = insertelement <64 x i64> undef, i64 %index, i32 0
  %broadcast.splat = shufflevector <64 x i64> %broadcast.splatinsert, <64 x
i64> undef, <64 x i32> zeroinitializer
  %induction = add <64 x i64> %broadcast.splat, 
  %0 = add i64 %index, 0
  %1 = getelementptr inbounds i8, i8* %B, i64 %0
  %2 = getelementptr i8, i8* %1, i32 0
  %3 = bitcast i8* %2 to <64 x i8>*
  %wide.load = load <64 x i8>, <64 x i8>* %3, align 4
  %4 = getelementptr inbounds i8, i8* %A, i64 %0
  %5 = getelementptr i8, i8* %4, i32 0
  %6 = bitcast i8* %5 to <64 x i8>*
  %wide.load1 = load <64 x i8>, <64 x i8>* %6, align 4
  %7 = add <64 x i8> %wide.load, %wide.load1
  %8 = bitcast i8* %5 to <64 x i8>*
  store <64 x i8> %7, <64 x i8>* %8, align 4
  %index.next = add i64 %index, 64
  %9 = icmp eq i64 %index.next, 0
  br i1 %9, label %middle.block, label %vector.body, !llvm.loop !0

middle.block: ; preds = %vector.body
  %cmp.n = icmp eq i64 32, 0
  br i1 %cmp.n, label %for.end, label %scalar.ph

scalar.ph:; preds = %middle.block,
%entry
  %bc.resume.val = phi i64 [ 0, %middle.block ], [ 0, %entry ]
  br label %for.body

for.body: ; preds = %for.body,
%scalar.ph
  %indvars.iv = phi i64 [ %bc.resume.val, %scalar.ph ], [ %indvars.iv.next,
%for.body ]
  %arrayidx = getelementptr inbounds i8, i8* %B, i64 %indvars.iv
  %10 = load i8, i8* %arrayidx, align 4, !llvm.mem.parallel_loop_access !2
  %arrayidx2 = getelementptr inbounds i8, i8* %A, i64 %indvars.iv
  %11 = load i8, i8* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !2
  %add = add i8 %10, %11
  store i8 %add, i8* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond = icmp eq i64 %indvars.iv.next, 32
  br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !3

for.end:  ; preds = %middle.block,
%for.body
  ret void
}
***

Note the first instruction is a jmp with a constant condition which will always
skip the vector loop.
VL was chosen as 64 which is larger than the loop trip count, so good thing we
never enter that vector loop, but it is unfortunate that the loop is not
vectorized to a more practical VL such as 32.
Running the same opt command as above only with -ma

[llvm-bugs] [Bug 34469] New: wrong code in Polly on x86_64-linux-gnu with "opt -instcombine -newgvn -polly-opt-isl -polly-mse -polly-codegen"

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34469

Bug ID: 34469
   Summary: wrong code in Polly on x86_64-linux-gnu with "opt
-instcombine -newgvn -polly-opt-isl -polly-mse
-polly-codegen"
   Product: Polly
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Optimizer
  Assignee: polly-...@googlegroups.com
  Reporter: s...@cs.ucdavis.edu
CC: llvm-bugs@lists.llvm.org

It might be a dup of or related to PR 34439 (and PR 34431). 


$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
c55c0db172fe48c0ee64bd86d2cb35c3e38f328b) (http://llvm.org/git/llvm.git
cfc091852bfc3c1fe9c2731e73f7ee9e832a2e60)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clangpolly -O3 -mllvm -disable-llvm-optzns -c -emit-llvm -o small.bc small.c
$ optpolly -instcombine -newgvn -polly-opt-isl -polly-mse -polly-codegen -o
small-opt.bc small.bc
$ clangpolly small-opt.bc 
$ ./a.out
0
$ 
$ clangpolly -O0 small.c; ./a.out
1
$ 


---


int printf (const char *, ...);

int a[16], b;

int main ()
{
  int c = 0;
  for (; c < 16; c++)
{
  a[c] = c;
  b = a[1];
}
  printf ("%d\n", b);
  return 0; 
}

-- 
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


[llvm-bugs] [Bug 34452] NewGVN: Assertion `Val && "isa<> used on a null pointer

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34452

Daniel Berlin  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #7 from Daniel Berlin  ---
Fixed in r312509

-- 
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


[llvm-bugs] [Bug 34430] clang crashes with "-mllvm -enable-newgvn": Assertion `ProcessedCount[V] < 100 && "Seem to have processed the same Value a lot"' failed

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34430

Daniel Berlin  changed:

   What|Removed |Added

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

-- 
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


[llvm-bugs] [Bug 33204] void {anonymous}::NewGVN::verifyIterationSettled(llvm::Function&): Assertion `BeforeCC->isEquivalentTo(AfterCC) && "Value number changed after main loop completed!"' failed

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=33204

Daniel Berlin  changed:

   What|Removed |Added

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

--- Comment #17 from Daniel Berlin  ---
(Assumed fixed, please reopen or open a new bug if it's not)

-- 
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


[llvm-bugs] [Bug 34348] Assertion: InitVal->getType() == getValueType() && "Initializer type must match GlobalVariable type"

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34348

Mehdi Amini  changed:

   What|Removed |Added

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

--- Comment #2 from Mehdi Amini  ---
Fixed the issue and reapplied the commit in r312512

-- 
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


[llvm-bugs] [Bug 34470] New: Ubuntu Trusty LLVM packages are down

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34470

Bug ID: 34470
   Summary: Ubuntu Trusty LLVM packages are down
   Product: Packaging
   Version: unspecified
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: deb packages
  Assignee: unassignedb...@nondot.org
  Reporter: zionnimc...@gmail.com
CC: llvm-bugs@lists.llvm.org

Not sure if this was intentional or not, but the Ubuntu Trusty packages are
down.
If you check apt.llvm.org you can see that it says on Trusty:

Trusty (14.04) - Last update : / Revision:

where it should obviously say something like

Trusty (14.04) - Last update : Mon, 04 Sep 2017 03:46:02 UTC / Revision: 312460

Also, if you go to http://apt.llvm.org/trusty/ you can see that it returns 404,
but it should return a 403, forbidden.

I realize that it may seem like the amount of people using Ubuntu Trusty would
seem pretty minimal, but do realize that Travis CI uses Ubuntu Trusty (as
default, now), and as such this has broken multiple projects CI.

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
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 34427] clang generate incompatible code for std::tie

2017-09-04 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=34427

Weng Xuetian  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #1 from Weng Xuetian  ---


*** This bug has been marked as a duplicate of bug 23034 ***

-- 
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