I would just disable these two globals -- they are used only for experiments right now. Let me do the change. --kcc On Mon, Mar 19, 2012 at 3:00 AM, <samsonov@google.com> wrote: > Reviewers: kcc, > > > > Please review this at http://codereview.appspot.com/5844058/ > > Affected files: > M lib/Transforms/Instrumentation/AddressSanitizer.cpp > > > Index: lib/Transforms/Instrumentation/AddressSanitizer.cpp > =================================================================== > --- lib/Transforms/Instrumentation/AddressSanitizer.cpp (revision 153031) > +++ lib/Transforms/Instrumentation/AddressSanitizer.cpp (working copy) > @@ -62,6 +62,7 @@ > static const char *kAsanHandleNoReturnName = "__asan_handle_no_return"; > static const char *kAsanMappingOffsetName = "__asan_mapping_offset"; > static const char *kAsanMappingScaleName = "__asan_mapping_scale"; > +static const int kAsanMappingConstantsAlignment = 1 << 5; > static const char *kAsanStackMallocName = "__asan_stack_malloc"; > static const char *kAsanStackFreeName = "__asan_stack_free"; > > @@ -584,10 +585,12 @@ > new GlobalVariable(M, IntptrTy, true, > GlobalValue::LinkOnceODRLinkage, > ConstantInt::get(IntptrTy, MappingOffset), > kAsanMappingOffsetName); > + asan_mapping_offset->setAlignment(kAsanMappingConstantsAlignment); > GlobalValue *asan_mapping_scale = > new GlobalVariable(M, IntptrTy, true, > GlobalValue::LinkOnceODRLinkage, > ConstantInt::get(IntptrTy, MappingScale), > kAsanMappingScaleName); > + asan_mapping_scale->setAlignment(kAsanMappingConstantsAlignment); > // Read these globals, otherwise they may be optimized away. > IRB.CreateLoad(asan_mapping_scale, true); > IRB.CreateLoad(asan_mapping_offset, true); > > > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >
How about adding a flag that enables emitting them? On Mon, Mar 19, 2012 at 8:11 PM, Kostya Serebryany <kcc@google.com> wrote: > I would just disable these two globals -- they are used only for experiments > right now. > Let me do the change. > > --kcc > > > On Mon, Mar 19, 2012 at 3:00 AM, <samsonov@google.com> wrote: >> >> Reviewers: kcc, >> >> >> >> Please review this at http://codereview.appspot.com/5844058/ >> >> Affected files: >> M lib/Transforms/Instrumentation/AddressSanitizer.cpp >> >> >> Index: lib/Transforms/Instrumentation/AddressSanitizer.cpp >> =================================================================== >> --- lib/Transforms/Instrumentation/AddressSanitizer.cpp (revision 153031) >> +++ lib/Transforms/Instrumentation/AddressSanitizer.cpp (working copy) >> @@ -62,6 +62,7 @@ >> static const char *kAsanHandleNoReturnName = "__asan_handle_no_return"; >> static const char *kAsanMappingOffsetName = "__asan_mapping_offset"; >> static const char *kAsanMappingScaleName = "__asan_mapping_scale"; >> +static const int kAsanMappingConstantsAlignment = 1 << 5; >> static const char *kAsanStackMallocName = "__asan_stack_malloc"; >> static const char *kAsanStackFreeName = "__asan_stack_free"; >> >> @@ -584,10 +585,12 @@ >> new GlobalVariable(M, IntptrTy, true, >> GlobalValue::LinkOnceODRLinkage, >> ConstantInt::get(IntptrTy, MappingOffset), >> kAsanMappingOffsetName); >> + asan_mapping_offset->setAlignment(kAsanMappingConstantsAlignment); >> GlobalValue *asan_mapping_scale = >> new GlobalVariable(M, IntptrTy, true, >> GlobalValue::LinkOnceODRLinkage, >> ConstantInt::get(IntptrTy, MappingScale), >> kAsanMappingScaleName); >> + asan_mapping_scale->setAlignment(kAsanMappingConstantsAlignment); >> // Read these globals, otherwise they may be optimized away. >> IRB.CreateLoad(asan_mapping_scale, true); >> IRB.CreateLoad(asan_mapping_offset, true); >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits@cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -- Alexander Potapenko Software Engineer Google Moscow
On Mon, Mar 19, 2012 at 9:22 AM, Alexander Potapenko <glider@google.com>wrote: > How about adding a flag that enables emitting them? > there were flags that controlled their values, now the same flags are used to also control their presence. r153040. --kcc > > On Mon, Mar 19, 2012 at 8:11 PM, Kostya Serebryany <kcc@google.com> wrote: > > I would just disable these two globals -- they are used only for > experiments > > right now. > > Let me do the change. > > > > --kcc > > > > > > On Mon, Mar 19, 2012 at 3:00 AM, <samsonov@google.com> wrote: > >> > >> Reviewers: kcc, > >> > >> > >> > >> Please review this at http://codereview.appspot.com/5844058/ > >> > >> Affected files: > >> M lib/Transforms/Instrumentation/AddressSanitizer.cpp > >> > >> > >> Index: lib/Transforms/Instrumentation/AddressSanitizer.cpp > >> =================================================================== > >> --- lib/Transforms/Instrumentation/AddressSanitizer.cpp (revision > 153031) > >> +++ lib/Transforms/Instrumentation/AddressSanitizer.cpp (working copy) > >> @@ -62,6 +62,7 @@ > >> static const char *kAsanHandleNoReturnName = "__asan_handle_no_return"; > >> static const char *kAsanMappingOffsetName = "__asan_mapping_offset"; > >> static const char *kAsanMappingScaleName = "__asan_mapping_scale"; > >> +static const int kAsanMappingConstantsAlignment = 1 << 5; > >> static const char *kAsanStackMallocName = "__asan_stack_malloc"; > >> static const char *kAsanStackFreeName = "__asan_stack_free"; > >> > >> @@ -584,10 +585,12 @@ > >> new GlobalVariable(M, IntptrTy, true, > >> GlobalValue::LinkOnceODRLinkage, > >> ConstantInt::get(IntptrTy, MappingOffset), > >> kAsanMappingOffsetName); > >> + asan_mapping_offset->setAlignment(kAsanMappingConstantsAlignment); > >> GlobalValue *asan_mapping_scale = > >> new GlobalVariable(M, IntptrTy, true, > >> GlobalValue::LinkOnceODRLinkage, > >> ConstantInt::get(IntptrTy, MappingScale), > >> kAsanMappingScaleName); > >> + asan_mapping_scale->setAlignment(kAsanMappingConstantsAlignment); > >> // Read these globals, otherwise they may be optimized away. > >> IRB.CreateLoad(asan_mapping_scale, true); > >> IRB.CreateLoad(asan_mapping_offset, true); > >> > >> > >> _______________________________________________ > >> llvm-commits mailing list > >> llvm-commits@cs.uiuc.edu > >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > > > > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits@cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > > > -- > Alexander Potapenko > Software Engineer > Google Moscow >