================ @@ -68,7 +68,9 @@ llvm::opt::DerivedArgList *AMDGPUOpenMPToolChain::TranslateArgs( Action::OffloadKind DeviceOffloadKind) const { DerivedArgList *DAL = HostTC.TranslateArgs(Args, BoundArch, DeviceOffloadKind); - if (!DAL || Args.hasArg(options::OPT_fsanitize_EQ)) + // Skip sanitize options passed from the HostTC. The decision to instrument + // device code is computed only by 'shouldSkipSanitizeOption'. + if (!DAL && DAL->hasArg(options::OPT_fsanitize_EQ)) ---------------- ampandey-1995 wrote:
Sorry, actually here the DAL computed from the HostTC picks up the sanitize option like ```-fsanitize=address``` and pass forward to ```DAL``` of device toolchain. The ```shouldSkipSanitizeOption ``` runs over each argument of ```Args [The user provided arguments which are not derived]``` and checks if the ```-fsanitize=address``` is there it early returns false which then avoids checking the :xnack+ capability. So, assume the case where when we pass ```-fsanitize=address --offload-arch=gfx90a``` . This should avoid appending ```-fsanitize=address``` in the DAL for device toolchain but it dosen't since the DAL already has -fsanitize=address from host toolchain and due to early return from ```shouldSkipSanitizeOption``` where it checks for the ```:xnack+``` capability is skipped. https://github.com/llvm/llvm-project/pull/126671 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits