[llvm] [RISCV] Allocate the varargs GPR save area as a single object. (PR #74354)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 22:31:51 PST 2023


================
@@ -10,55 +10,59 @@ define void @va1arg(ptr %a, ...) {
   ; RV32-NEXT:   liveins: $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17
   ; RV32-NEXT: {{  $}}
   ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(p0) = COPY $x10
+  ; RV32-NEXT:   [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.1
----------------
topperc wrote:

I assume it would get optimized by this generic combiner.

```
def ptr_add_immed_matchdata : GIDefMatchData<"PtrAddChain">;                     
def ptr_add_immed_chain : GICombineRule<                                         
  (defs root:$d, ptr_add_immed_matchdata:$matchinfo),                            
  (match (wip_match_opcode G_PTR_ADD):$d,                                        
         [{ return Helper.matchPtrAddImmedChain(*${d}, ${matchinfo}); }]),       
  (apply [{ Helper.applyPtrAddImmedChain(*${d}, ${matchinfo}); }])>
```

https://github.com/llvm/llvm-project/pull/74354


More information about the llvm-commits mailing list