[llvm] 3566c75 - [amdgpu] Skip non-instruction values in CF user tracing.

Michael Liao via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 13:02:54 PST 2020


Author: Michael Liao
Date: 2020-01-03T16:02:47-05:00
New Revision: 3566c75ca82ff4a0bb3e9e906a6c63f6022b03ae

URL: https://github.com/llvm/llvm-project/commit/3566c75ca82ff4a0bb3e9e906a6c63f6022b03ae
DIFF: https://github.com/llvm/llvm-project/commit/3566c75ca82ff4a0bb3e9e906a6c63f6022b03ae.diff

LOG: [amdgpu] Skip non-instruction values in CF user tracing.

Summary:
- CF users won't be non-instruction values. Skip them to save the
  compilation time. It's especially true when there are multiple
  functions in that module, where, says, a constant may be used in most
  functions. The current CF user tracing adds significant overhead.

Reviewers: alex-t, rampitec

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72174

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index fccb1326feee..2033e1f7db46 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -11023,6 +11023,8 @@ SITargetLowering::getRegClassFor(MVT VT, bool isDivergent) const {
 }
 
 static bool hasCFUser(const Value *V, SmallPtrSet<const Value *, 16> &Visited) {
+  if (!isa<Instruction>(V))
+    return false;
   if (!Visited.insert(V).second)
     return false;
   bool Result = false;


        


More information about the llvm-commits mailing list