[PATCH] D107580: [VectorCombine] Support AND/UREM indices that require freezing.
    Sanjay Patel via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sun Aug  8 07:46:19 PDT 2021
    
    
  
spatel added subscribers: hyeongyukim, aqjune.
spatel added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:779
+/// if a freeze needs to be inserted.
+class ScalarizationResult {
+  enum class StatusTy { Unsafe, Safe, SafeWithFreeze };
----------------
Other than the name, this looks like it could be a generic freeze utility. Should we put it in some header for other potential callers? cc @aqjune  @hyeongyukim 
================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:812
+      if (U.getUser() == &User) {
+        Builder.SetInsertPoint(cast<Instruction>(&User));
+        Value *Frozen = Builder.CreateFreeze(ToFreeze);
----------------
Use `InsertPointGuard` so caller doesn't have to manually reset it.
================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:857
+  return ScalarizationResult::unsafe();
+  ;
 }
----------------
stray punctuation
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107580/new/
https://reviews.llvm.org/D107580
    
    
More information about the llvm-commits
mailing list