[clang] [X86] Finely handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx (PR #84136)

Freddy Ye via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 6 19:15:00 PST 2024


FreddyLeaf wrote:

> > > Still not understand. Shouldn't the target feature of the caller be passed to the intrinsic when checking the argument of the intrinsic?
> > 
> > 
> > The target features passing from option can be passed to Semachecking. It's special for attribute_target, which is handled in `handleTargetAttr`, which is after Sema::CheckBuiltinFunctionCall.
> 
> Then why not move the call `handleTargetAttr` before `Sema::CheckBuiltinFunctionCall`?

Mainly because all Sema::CheckBuiltinFunctionCall before doesn't dependent on target feature, right? We don't have any other builtins have different range limit of same const parameter. But clang::CodegenFunction has the information of the whole function, which I think is a more reasonable place to do the check.

https://github.com/llvm/llvm-project/pull/84136


More information about the cfe-commits mailing list