<div dir="ltr"><div dir="ltr">Thanks.<div>It's already green on another bot <a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/29232" target="_blank" class="cremed">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/29232</a></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 7, 2019 at 10:57 AM Nirav Davé <<a href="mailto:niravd@google.com" target="_blank">niravd@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Thanks. I suspect it's actually the similar rL353428 which I've reverted until I figure out what's going on. </div><div dir="ltr"><br></div><div>-Nirav</div><div dir="ltr"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 7, 2019 at 1:51 PM Vitaly Buka <<a href="mailto:vitalybuka@google.com" target="_blank">vitalybuka@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">I suspect this patch is causing this:<div><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/10737" target="_blank">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/10737</a><br><div><br></div><div><pre style="font-family:"Courier New",courier,monotype,monospace;color:rgb(0,0,0);font-size:medium"><span class="gmail-m_-1130282874371062190gmail-m_-3938050670624696748gmail-m_-3659024345299406052gmail-stdout">AIL: LLVM :: CodeGen/AArch64/bswap-known-bits.ll (5521 of 29747)
******************** TEST 'LLVM :: CodeGen/AArch64/bswap-known-bits.ll' FAILED ********************
Script:
--
: 'RUN: at line 1';   /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/llc < /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AArch64/bswap-known-bits.ll -mtriple=aarch64-apple-darwin  | /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/FileCheck /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AArch64/bswap-known-bits.ll
--
Exit Code: 2

Command Output (stderr):
--
=================================================================
==25312==ERROR: AddressSanitizer: use-after-poison on address 0x62100004512a at pc 0x0000056e6d1e bp 0x7ffd018940d0 sp 0x7ffd018940c8
READ of size 2 at 0x62100004512a thread T0
    #0 0x56e6d1d in getValueType /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:975:5
    #1 0x56e6d1d in getValueType /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1123
    #2 0x56e6d1d in convertSelectOfFPConstantsToLoadOffset /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:18605
    #3 0x56e6d1d in (anonymous namespace)::DAGCombiner::SimplifySelectCC(llvm::SDLoc const&, llvm::SDValue, llvm::SDValue, llvm::SDValue, llvm::SDValue, llvm::ISD::CondCode, bool) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:18681
    #4 0x565073d in (anonymous namespace)::DAGCombiner::visitZERO_EXTEND(llvm::SDNode*) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9094:23
    #5 0x55dc7ef in (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1541:40
    #6 0x55d12fc in (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1599:16
    #7 0x55cd397 in Run /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1439:18
    #8 0x55cd397 in llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults*, llvm::CodeGenOpt::Level) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:19508
    #9 0x5aa41be in llvm::SelectionDAGISel::CodeGenAndEmitDAG() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:782:13
    #10 0x5a9dbfa in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1812:7
    #11 0x5a92941 in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:496:3
    #12 0x411288a in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/MachineFunctionPass.cpp:73:13
    #13 0x4bb42e1 in llvm::FPPassManager::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1643:27
    #14 0x4bb4a02 in llvm::FPPassManager::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1678:16
    #15 0x4bb57c5 in runOnModule /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1743:27
    #16 0x4bb57c5 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1856
    #17 0xa512ea in compileModule(char**, llvm::LLVMContext&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/llc/llc.cpp:596:8
    #18 0xa4ad10 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/llc/llc.cpp:350:22
    #19 0x7fbdc37982e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #20 0x939159 in _start (/b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/llc+0x939159)

0x62100004512a is located 1066 bytes inside of 4096-byte region [0x621000044d00,0x621000045d00)
allocated by thread T0 here:
    #0 0xa0896f in malloc /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:145
    #1 0xa87bd6 in safe_malloc /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Support/MemAlloc.h:26:18
    #2 0xa87bd6 in Allocate /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Support/Allocator.h:99
    #3 0xa87bd6 in llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>::StartNewSlab() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Support/Allocator.h:400
    #4 0xa87909 in llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>::Allocate(unsigned long, unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Support/Allocator.h:260:5
    #5 0x59c449b in Allocate<llvm::RegisterSDNode, llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096, 4096> > /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Support/Recycler.h:89:57
    #6 0x59c449b in Allocate<llvm::RegisterSDNode> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Support/RecyclingAllocator.h:43
    #7 0x59c449b in newSDNode<llvm::RegisterSDNode, unsigned int &, llvm::EVT &> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/CodeGen/SelectionDAG.h:338
    #8 0x59c449b in llvm::SelectionDAG::getRegister(unsigned int, llvm::EVT) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1736
    #9 0xbe7788 in getCopyFromReg /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/CodeGen/SelectionDAG.h:706:30
    #10 0xbe7788 in llvm::AArch64TargetLowering::LowerFormalArguments(llvm::SDValue, unsigned int, bool, llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, llvm::SDLoc const&, llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&) const /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:3095
    #11 0x594db68 in llvm::SelectionDAGISel::LowerArguments(llvm::Function const&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:9157:26
    #12 0x5a99180 in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1589:5
    #13 0x5a92941 in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:496:3
    #14 0x411288a in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/MachineFunctionPass.cpp:73:13
    #15 0x4bb42e1 in llvm::FPPassManager::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1643:27
    #16 0x4bb4a02 in llvm::FPPassManager::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1678:16
    #17 0x4bb57c5 in runOnModule /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1743:27
    #18 0x4bb57c5 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1856
    #19 0xa512ea in compileModule(char**, llvm::LLVMContext&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/llc/llc.cpp:596:8
    #20 0xa4ad10 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/llc/llc.cpp:350:22
    #21 0x7fbdc37982e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)

SUMMARY: AddressSanitizer: use-after-poison /b/sanitizer-x86_64-linux-b</span><span class="gmail-m_-1130282874371062190gmail-m_-3938050670624696748gmail-m_-3659024345299406052gmail-stdout">ootstrap/build/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:975:5 in getValueType
</span><span class="gmail-m_-1130282874371062190gmail-m_-3938050670624696748gmail-m_-3659024345299406052gmail-stdout">Shadow bytes around the buggy address:
  0x0c42800009d0: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 02 f7 f7 f7 f7
  0x0c42800009e0: f7 f7 f7 f7 f7 f7 00 00 00 00 00 00 00 00 00 00
  0x0c42800009f0: 00 00 00 f7 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4280000a00: 00 f7 00 00 00 00 00 00 00 00 00 00 00 00 00 f7
  0x0c4280000a10: 00 00 00 00 00 00 00 00 00 00 00 00 00 f7 f7 f7
=>0x0c4280000a20: f7 02 f7 f7 f7[f7]f7 f7 f7 f7 f7 f7 00 00 00 00
  0x0c4280000a30: 00 00 00 00 00 00 00 00 00 f7 00 00 00 00 00 00
  0x0c4280000a40: 00 00 00 00 00 00 00 f7 00 00 00 00 00 00 00 00
  0x0c4280000a50: 00 00 00 00 00 f7 00 00 00 00 00 00 00 00 00 00
  0x0c4280000a60: 00 00 00 f7 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4280000a70: 00 f7 00 00 00 00 00 00 00 00 00 00 00 00 00 f7
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==25312==ABORTING
FileCheck error: '-' is empty.
FileCheck command line:  /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/FileCheck /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AArch64/bswap-known-bits.ll
</span></pre><br class="gmail-m_-1130282874371062190gmail-m_-3938050670624696748gmail-m_-3659024345299406052gmail-Apple-interchange-newline"></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 7, 2019 at 8:57 AM Nirav Dave via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: niravd<br>
Date: Thu Feb  7 08:57:50 2019<br>
New Revision: 353426<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=353426&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=353426&view=rev</a><br>
Log:<br>
[DAG] Cleanup unused node on failed SELECT Combine.<br>
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp<br>
<br>
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=353426&r1=353425&r2=353426&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=353426&r1=353425&r2=353426&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Feb  7 08:57:50 2019<br>
@@ -7444,6 +7444,9 @@ SDValue DAGCombiner::visitSELECT(SDNode<br>
       if (normalizeToSequence || !InnerSelect.use_empty())<br>
         return DAG.getNode(ISD::SELECT, DL, N1.getValueType(), Cond0,<br>
                            InnerSelect, N2);<br>
+      // Cleanup on failure.<br>
+      if (InnerSelect.use_empty())<br>
+        recursivelyDeleteUnusedNodes(InnerSelect.getNode());<br>
     }<br>
     // select (or Cond0, Cond1), X, Y -> select Cond0, X, (select Cond1, X, Y)<br>
     if (N0->getOpcode() == ISD::OR && N0->hasOneUse()) {<br>
@@ -7454,6 +7457,9 @@ SDValue DAGCombiner::visitSELECT(SDNode<br>
       if (normalizeToSequence || !InnerSelect.use_empty())<br>
         return DAG.getNode(ISD::SELECT, DL, N1.getValueType(), Cond0, N1,<br>
                            InnerSelect);<br>
+      // Cleanup on failure.<br>
+      if (InnerSelect.use_empty())<br>
+        recursivelyDeleteUnusedNodes(InnerSelect.getNode());<br>
     }<br>
<br>
     // select Cond0, (select Cond1, X, Y), Y -> select (and Cond0, Cond1), X, Y<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>