[PATCH] D11830: AMDGPU/SI: Fold AMDGPUISD::CLAMP into VOP3 instructions when possible
    Matt Arsenault via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Aug  7 09:42:37 PDT 2015
    
    
  
arsenm added inline comments.
================
Comment at: lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:596-597
@@ +595,4 @@
+  case AMDGPUISD::CLAMP: {
+    SDNode *Clamp = SelectCLAMP(N);
+    if (Clamp)
+      return Clamp;
----------------
This can be folded into the if (SDNode ...
================
Comment at: lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:878
@@ -868,1 +877,3 @@
 
+SDNode *AMDGPUDAGToDAGISel::SelectCLAMP(SDNode *N) {
+
----------------
I think I read somewhere that using clamp / omod doesn't work with denormals, so maybe this should be not doing this fold if hasFP32Denormals.
Does this work with f64 also?
http://reviews.llvm.org/D11830
    
    
More information about the llvm-commits
mailing list