[PATCH] D14260: Optimize store of "bitcast" from vector to aggregate.

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 17:09:04 PST 2015


hfinkel added a subscriber: hfinkel.

================
Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:857
@@ +856,3 @@
+///
+///     %x0 = extractelement <2 x double> %x, i32 0
+///     %i0 = insertvalue [2 x double] undef, double %x0, 0
----------------
Please use %U<n> and %W<n> in this comment because you use the variables named U and W in the code (and that should make things clearer without necessitating longer variable names).

================
Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:877
@@ +876,3 @@
+    auto *CI = dyn_cast<ConstantInt>(EI->getIndexOperand());
+    if (!CI || IV->getNumIndices() != 1 || CI->getZExtValue() != *IV->idx_begin())
+      return nullptr;
----------------
Do we need to check here that IV has only one index?

================
Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:899
@@ +898,3 @@
+    for (const Type *EltT : ST->elements()) {
+      if (EltT != UT->getElementType())
+        return nullptr;
----------------
Do the types here need to agree, or just the type sizes?


http://reviews.llvm.org/D14260





More information about the llvm-commits mailing list