[llvm] r259145 - [GVN] Add clarifying assert [NFCI]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 18:23:10 PST 2016


Author: reames
Date: Thu Jan 28 20:23:10 2016
New Revision: 259145

URL: http://llvm.org/viewvc/llvm-project?rev=259145&view=rev
Log:
[GVN] Add clarifying assert [NFCI]

Just adding an assert which makes invariants between AnalyzeLoadsFromClobberingLoads and GetLoadValueForLoad slightly more clear.



Modified:
    llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=259145&r1=259144&r2=259145&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Thu Jan 28 20:23:10 2016
@@ -1109,6 +1109,11 @@ static int AnalyzeLoadFromClobberingLoad
       LoadBase, LoadOffs, LoadSize, DepLI);
   if (Size == 0) return -1;
 
+  // Check non-obvious conditions enforced by MDA which we rely on for being
+  // able to materialize this potentially available value
+  assert(DepLI->isSimple() && "Cannot widen volatile/atomic load!");
+  assert(DepLI->getType()->isIntegerTy() && "Can't widen non-integer load");
+
   return AnalyzeLoadFromClobberingWrite(LoadTy, LoadPtr, DepPtr, Size*8, DL);
 }
 




More information about the llvm-commits mailing list