[PATCH] Scalarizer for masked vector intrinsics

hfinkel at anl.gov hfinkel at anl.gov
Thu Nov 27 10:31:07 PST 2014


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:229
@@ -228,2 +228,3 @@
       BasicBlock *BB = I++;
-      MadeChange |= OptimizeBlock(*BB);
+      bool ControlFlowChanges = false;
+      MadeChange |= OptimizeBlock(*BB, ControlFlowChanges);
----------------
We already have a ModifiedDT variable, can we reuse that?

Regardless, you need to set ModifiedDT to true (or update the DT manually) because CGP preserves the dominator tree.

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:939
@@ +938,3 @@
+    
+    Value* Gep = Builder.CreateGEP(FirstEltPtr, Builder.getInt32(Idx));
+    LoadInst* Load = Builder.CreateLoad(Gep, false);
----------------
This can be an 'inbounds' GEP, right?

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:1033
@@ +1032,3 @@
+    Value *OneElt = Builder.CreateExtractElement(Src, Builder.getInt32(Idx));
+    Value* Gep = Builder.CreateGEP(FirstEltPtr, Builder.getInt32(Idx));
+    StoreInst *Store = Builder.CreateStore(OneElt, Gep);
----------------
Same here; inbounds GEP?

http://reviews.llvm.org/D6436






More information about the llvm-commits mailing list