<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 20, 2015, at 12:11 PM, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" class="">dexonsmith@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On 2015-Nov-19, at 15:52, David Blaikie via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""><br class=""><br class=""><br class="">On Thu, Nov 19, 2015 at 2:38 PM, Dehao Chen <<a href="mailto:dehao@google.com" class="">dehao@google.com</a>> wrote:<br class="">I'm not quite familiar with the pass manager, but the stack trace for<br class="">the AddDiscriminators call from the frontend run (with<br class="">-disable-llvm-optzns) is:<br class=""><br class="">*looks around*<br class=""><br class="">Oh, that's lame:<br class=""><br class=""> // Handle disabling of LLVM optimization, where we want to preserve the<br class=""> // internal module before any optimization.<br class=""> if (CodeGenOpts.DisableLLVMOpts) {<br class="">   OptLevel = 0;<br class="">   Inlining = CodeGenOpts.NoInlining;<br class=""> }<br class=""><br class="">It doesn't /actually/ disable LLVM optimizations... it just turns off the inliner and switches to -O0. *eyeroll*<br class=""><br class="">I wonder what the history is here... *goes spelunking*<br class=""><br class="">Yep, seems to have been there since it was added... in r72742<br class=""><br class="">We really should fix that. It really shouldn't run the LLVM optimization pipeline at all. (you know, because that's what it says on the tin)<br class=""><br class="">Hmm, OK, maybe it does make sense-ish (disable-llvm-optzns is for disabling /optimizations/? But that's still arguably... (always inlining isn't strictly an optimization))<br class=""><br class="">But there's -disable-llvm-passes. That seems to do the trick. Could you try that?<span class="Apple-converted-space"> </span><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I think -disable-llvm-optzns at one point disabled all the passes,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">but then some of the sanitizers were skipping it.  When we included</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">an IR dump in -save-temps, we noticed it wasn't working correctly</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">and Steven Wu added the less muddy -disable-llvm-passes in r242565.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I wouldn't have a problem with -disable-llvm-optzns skipping all</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">passes (again?), but I figured the sanitizers avoided it for a</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">reason?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div>Most of the instrumentation passes ignore -disable-llvm-optzns. I don't know the exact reason in the beginning but my guess is that it will allow you to compile code with both -disable-llvm-optzns and sanitizer. That is why I added a new option -disable-llvm-passes instead of replace -disable-llvm-optzns. Other than that, -disable-llvm-optzns should only run immutable passes which is pretty close to no optimization.</div><div><br class=""></div><div>Steven  </div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="">- David<br class=""><br class=""><br class="">#0  (anonymous namespace)::AddDiscriminators::runOnFunction<br class="">(this=0x8924170, F=...) at<br class="">/ssd/llvm_trunk/lib/Transforms/Utils/AddDiscriminators.cpp:177<br class="">#1  0x0000000002769946 in llvm::FPPassManager::runOnFunction<br class="">(this=0x8921380, F=...) at<br class="">/ssd/llvm_trunk/lib/IR/LegacyPassManager.cpp:1521<br class="">#2  0x00000000027696d8 in llvm::legacy::FunctionPassManagerImpl::run<br class="">(this=0x891ee90, F=...) at<br class="">/ssd/llvm_trunk/lib/IR/LegacyPassManager.cpp:1470<br class="">#3  0x00000000027692aa in llvm::legacy::FunctionPassManager::run<br class="">(this=0x88e6a60, F=...) at<br class="">/ssd/llvm_trunk/lib/IR/LegacyPassManager.cpp:1394<br class="">#4  0x0000000002dcd9c2 in (anonymous<br class="">namespace)::EmitAssemblyHelper::EmitAssembly (this=0x7fffffffbd80,<br class="">Action=clang::Backend_EmitLL, OS=0x88b04a0) at<br class="">/ssd/llvm_trunk/tools/clang/lib/CodeGen/<br class="">BackendUtil.cpp:643<br class="">#5  0x0000000002dcdb7a in clang::EmitBackendOutput (Diags=...,<br class="">CGOpts=..., TOpts=..., LOpts=..., TDesc=..., M=0x88b8810,<br class="">Action=clang::Backend_EmitLL, OS=0x88b04a0) at /ssd/llvm_trunk/tools/c<br class="">lang/lib/CodeGen/BackendUtil.cpp:666<br class="">#6  0x00000000035f64b7 in<br class="">clang::BackendConsumer::HandleTranslationUnit (this=0x88b83f0, C=...)<br class="">at /ssd/llvm_trunk/tools/clang/lib/CodeGen/CodeGenAction.cpp:191<br class="">#7  0x0000000003e9aa19 in clang::ParseAST (S=..., PrintStats=false,<br class="">SkipFunctionBodies=false) at<br class="">/ssd/llvm_trunk/tools/clang/lib/Parse/ParseAST.cpp:168<br class="">#8  0x000000000325deec in clang::ASTFrontendAction::ExecuteAction<br class="">(this=0x8887530) at<br class="">/ssd/llvm_trunk/tools/clang/lib/Frontend/FrontendAction.cpp:539<br class="">#9  0x00000000035f5572 in clang::CodeGenAction::ExecuteAction<br class="">(this=0x8887530) at<br class="">/ssd/llvm_trunk/tools/clang/lib/CodeGen/CodeGenAction.cpp:797<br class="">#10 0x000000000325d9b1 in clang::FrontendAction::Execute<br class="">(this=0x8887530) at<br class="">/ssd/llvm_trunk/tools/clang/lib/Frontend/FrontendAction.cpp:439<br class="">#11 0x00000000032176e6 in clang::CompilerInstance::ExecuteAction<br class="">(this=0x8884410, Act=...) at<br class="">/ssd/llvm_trunk/tools/clang/lib/Frontend/CompilerInstance.cpp:841<br class="">#12 0x000000000335c64a in clang::ExecuteCompilerInvocation<br class="">(Clang=0x8884410) at<br class="">/ssd/llvm_trunk/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:222<br class="">#13 0x00000000014847d1 in cc1_main (Argv=..., Argv0=0x7fffffffdffd<br class="">"/ssd/llvm_trunk/build.debug/bin/clang", MainAddr=0x1478abe<br class=""><GetExecutablePath(char const*, bool)>) at /ssd/llvm_trunk/tools<br class="">/clang/tools/driver/cc1_main.cpp:116<br class="">#14 0x000000000147af89 in ExecuteCC1Tool (argv=..., Tool=...) at<br class="">/ssd/llvm_trunk/tools/clang/tools/driver/driver.cpp:301<br class="">#15 0x000000000147b938 in main (argc_=12, argv_=0x7fffffffdbf8) at<br class="">/ssd/llvm_trunk/tools/clang/tools/driver/driver.cpp:366<br class=""><br class="">On Thu, Nov 19, 2015 at 1:16 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">On Thu, Nov 19, 2015 at 1:09 PM, Dehao Chen <<a href="mailto:dehao@google.com" class="">dehao@google.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">disable-llvm-optzns does not help:<br class=""><br class="">/ssd/llvm_trunk/build.gccopt/./bin/clang -cc1 -internal-isystem<br class="">/ssd/llvm_trunk/build.gccopt/bin/../lib/clang/3.8.0/include<br class="">-nostdsysteminc -dwarf-version=4 -debug-info-kind=line-tables-only<br class="">-disable-llvm-optzns  -emit-llvm <<br class="">/ssd/llvm_trunk/tools/clang/test/CodeGen/debug-info-scope.c<br class=""><br class="">This still emits discriminators.<br class=""></blockquote><br class=""><br class="">Do you know where the discriminators are coming from in this case? Does the<br class="">frontend add some of them (in which case the test case shouldn't need<br class="">updating for your recent backend change still, hopefully)? Is there some<br class="">other codepath that is running the AddDiscriminator transformation?<br class=""><br class=""><blockquote type="cite" class=""><br class=""><br class="">On Thu, Nov 19, 2015 at 12:46 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>><br class="">wrote:<br class=""><blockquote type="cite" class=""><br class=""><br class="">On Thu, Nov 19, 2015 at 12:42 PM, Dehao Chen <<a href="mailto:dehao@google.com" class="">dehao@google.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">Yes, as discriminator is a backend pass, it should *not* affect<br class="">frontend<br class="">tests.<br class=""></blockquote><br class=""><br class="">Could you update these tests to not involve discriminators by passing<br class="">-disable-llvm-optzns instead?<br class=""><br class=""><blockquote type="cite" class=""><br class=""><br class="">On Thu, Nov 19, 2015 at 12:36 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>><br class="">wrote:<br class=""><blockquote type="cite" class=""><br class=""><br class="">On Thu, Nov 19, 2015 at 11:53 AM, Dehao Chen via cfe-commits<br class=""><<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">Author: dehao<br class="">Date: Thu Nov 19 13:53:16 2015<br class="">New Revision: 253595<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=253595&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=253595&view=rev</a><br class="">Log:<br class="">Update clang tests to accomendate discriminator changes.<br class=""><br class="">Summary: The discriminator change in <a href="http://reviews.llvm.org/D14738" class="">http://reviews.llvm.org/D14738</a><br class="">will<br class="">fail these clang tests. Update the test to accomendate the<br class="">discriminator<br class="">change.<br class=""></blockquote><br class=""><br class="">Do these tests need to be testing discriminators in the frontend?<br class="">Could<br class="">we<br class="">just -mllvm -disable-llvm-optzns on these tests? (can the<br class="">functionality<br class="">be<br class="">wholely tested in LLVM, I assume so if it's phrased as an LLVM<br class="">transformation pass?)<br class=""><br class=""><blockquote type="cite" class=""><br class=""><br class="">Reviewers: dblaikie, davidxl, dnovillo<br class=""><br class="">Differential Revision: <a href="http://reviews.llvm.org/D14836" class="">http://reviews.llvm.org/D14836</a><br class=""><br class="">Modified:<br class="">   cfe/trunk/test/CodeGen/debug-info-scope.c<br class="">   cfe/trunk/test/CodeGenObjC/arc-linetable.m<br class=""><br class="">Modified: cfe/trunk/test/CodeGen/debug-info-scope.c<br class="">URL:<br class=""><br class=""><br class=""><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-scope.c?rev=253595&r1=253594&r2=253595&view=diff" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-scope.c?rev=253595&r1=253594&r2=253595&view=diff</a><br class=""><br class=""><br class=""><br class="">==============================================================================<br class="">--- cfe/trunk/test/CodeGen/debug-info-scope.c (original)<br class="">+++ cfe/trunk/test/CodeGen/debug-info-scope.c Thu Nov 19 13:53:16<br class="">2015<br class="">@@ -10,6 +10,7 @@ int main() {<br class=""><br class="">// GMLT-NOT: !DILexicalBlock<br class="">// GMLT: !DILexicalBlockFile({{.*}}, discriminator: 1)<br class="">+// GMLT: !DILexicalBlockFile({{.*}}, discriminator: 2)<br class="">// Make sure we don't have any more lexical blocks because we don't<br class="">need<br class="">them in<br class="">// -gmlt.<br class="">// GMLT-NOT: !DILexicalBlock<br class=""><br class="">Modified: cfe/trunk/test/CodeGenObjC/arc-linetable.m<br class="">URL:<br class=""><br class=""><br class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-linetable.m?rev=253595&r1=253594&r2=253595&view=diff<br class=""><br class=""><br class=""><br class="">==============================================================================<br class="">--- cfe/trunk/test/CodeGenObjC/arc-linetable.m (original)<br class="">+++ cfe/trunk/test/CodeGenObjC/arc-linetable.m Thu Nov 19 13:53:16<br class="">2015<br class="">@@ -34,9 +34,9 @@<br class=""><br class="">// CHECK: define {{.*}}testCleanupVoid<br class="">// CHECK: icmp ne {{.*}}!dbg ![[SKIP1:[0-9]+]]<br class="">-// CHECK: store i32 0, i32* {{.*}}, !dbg ![[RET8:[0-9]+]]<br class="">+// CHECK: store i32 0, i32* {{.*}}, !dbg ![[STORE8:[0-9]+]]<br class="">// CHECK: @objc_storeStrong{{.*}}, !dbg ![[ARC8:[0-9]+]]<br class="">-// CHECK: ret {{.*}} !dbg ![[RET8]]<br class="">+// CHECK: ret {{.*}} !dbg ![[RET8:[0-9]+]]<br class=""><br class="">typedef signed char BOOL;<br class=""><br class="">@@ -112,8 +112,9 @@ typedef signed char BOOL;<br class="">      [delegate testVoid :s];<br class="">    }<br class="">  }<br class="">-  // CHECK: ![[RET8]] = !DILocation(line: [[@LINE+2]], scope:<br class="">-  // CHECK: ![[ARC8]] = !DILocation(line: [[@LINE+1]], scope:<br class="">+  // CHECK: ![[STORE8]] = !DILocation(line: [[@LINE+3]], scope:<br class="">+  // CHECK: ![[ARC8]] = !DILocation(line: [[@LINE+2]], scope:<br class="">+  // CHECK: ![[RET8]] = !DILocation(line: [[@LINE+1]], scope:<br class="">}<br class=""><br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">cfe-commits mailing list<br class="">cfe-commits@lists.llvm.org<br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits<br class=""></blockquote><br class=""><br class=""></blockquote></blockquote><br class=""><br class=""></blockquote></blockquote><br class=""><br class=""></blockquote><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</blockquote></div></blockquote></div><br class=""></body></html>