[llvm] [GlobalISel] Call `setInstrAndDebugLoc` before `tryCombineAll` (PR #86993)
    Shilei Tian via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Mar 29 08:13:36 PDT 2024
    
    
  
================
@@ -2459,6 +2459,7 @@ void GICombinerEmitter::emitRunCustomAction(raw_ostream &OS) {
     OS << "  switch(ApplyID) {\n";
     for (const auto &Apply : ApplyCode) {
       OS << "  case " << Apply->getEnumNameWithPrefix(CXXApplyPrefix) << ":{\n"
+         << "    Helper.getBuilder().setInstrAndDebugLoc(*State.MIs[0]);\n"
----------------
shiltian wrote:
I suppose `State.MIs[0]` is always the current instruction that is being tried to be combined. I ran all tests and it works good so far.
https://github.com/llvm/llvm-project/pull/86993
    
    
More information about the llvm-commits
mailing list