[llvm] [IR] Add llvm `clmul` intrinsic (PR #140301)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon May 19 17:20:12 PDT 2025


topperc wrote:

We need to make `ISD::CLMUL` `Expand` by default for all data types in `TargetLoweringBase::initActions()`

See existing examples like 

```
    // [US]CMP default to expand                                                 
    setOperationAction({ISD::UCMP, ISD::SCMP}, VT, Expand);                      
                                                                                 
    // Halving adds                                                              
    setOperationAction(                                                          
        {ISD::AVGFLOORS, ISD::AVGFLOORU, ISD::AVGCEILS, ISD::AVGCEILU}, VT,      
        Expand);                                                                 
                                                                                 
    // Absolute difference                                                       
    setOperationAction({ISD::ABDS, ISD::ABDU}, VT, Expand);                      
                                                                                 
    // Saturated trunc                                                           
    setOperationAction(ISD::TRUNCATE_SSAT_S, VT, Expand);                        
    setOperationAction(ISD::TRUNCATE_SSAT_U, VT, Expand);                        
    setOperationAction(ISD::TRUNCATE_USAT_U, VT, Expand);
```

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


More information about the llvm-commits mailing list