Skip to content

[Target] Use range-based for loops (NFC) #146198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jun 28, 2025

@llvm/pr-subscribers-backend-x86
@llvm/pr-subscribers-backend-arm

@llvm/pr-subscribers-backend-amdgpu

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/146198.diff

6 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp (+1-4)
  • (modified) llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp (+2-2)
  • (modified) llvm/lib/Target/ARM/ARMConstantIslandPass.cpp (+2-2)
  • (modified) llvm/lib/Target/ARM/ARMFrameLowering.cpp (+2-2)
  • (modified) llvm/lib/Target/ARM/ARMISelLowering.cpp (+4-6)
  • (modified) llvm/lib/Target/X86/X86ISelLoweringCall.cpp (+10-12)
diff --git a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
index 0eb55daf32089..fd39b8a1350c6 100644
--- a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
+++ b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
@@ -842,10 +842,7 @@ bool SIShrinkInstructions::run(MachineFunction &MF) {
 
   unsigned VCCReg = ST->isWave32() ? AMDGPU::VCC_LO : AMDGPU::VCC;
 
-  for (MachineFunction::iterator BI = MF.begin(), BE = MF.end();
-                                                  BI != BE; ++BI) {
-
-    MachineBasicBlock &MBB = *BI;
+  for (MachineBasicBlock &MBB : MF) {
     MachineBasicBlock::iterator I, Next;
     for (I = MBB.begin(); I != MBB.end(); I = Next) {
       Next = std::next(I);
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
index 8f17c62d4b906..50217c3a047df 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -3126,8 +3126,8 @@ bool ARMBaseInstrInfo::optimizeCompareInstr(
   // Modify the condition code of operands in OperandsToUpdate.
   // Since we have SUB(r1, r2) and CMP(r2, r1), the condition code needs to
   // be changed from r2 > r1 to r1 < r2, from r2 < r1 to r1 > r2, etc.
-  for (unsigned i = 0, e = OperandsToUpdate.size(); i < e; i++)
-    OperandsToUpdate[i].first->setImm(OperandsToUpdate[i].second);
+  for (auto &[MO, Cond] : OperandsToUpdate)
+    MO->setImm(Cond);
 
   MI->clearRegisterDeads(ARM::CPSR);
 
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index ca3dc15ff3ad6..e72aa8ef051cd 100644
--- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -476,8 +476,8 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &mf) {
 
     LLVM_DEBUG(dbgs() << "Beginning BR iteration #" << NoBRIters << '\n');
     bool BRChange = false;
-    for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i)
-      BRChange |= fixupImmediateBr(ImmBranches[i]);
+    for (ImmBranch &Br : ImmBranches)
+      BRChange |= fixupImmediateBr(Br);
     if (BRChange && ++NoBRIters > 30)
       report_fatal_error("Branch Fix Up pass failed to converge!");
     LLVM_DEBUG(dumpBBs());
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 80805ff34e1bd..50d8eee8644c1 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -1701,8 +1701,8 @@ void ARMFrameLowering::emitPushInst(MachineBasicBlock &MBB,
                                     .addReg(ARM::SP)
                                     .setMIFlags(MachineInstr::FrameSetup)
                                     .add(predOps(ARMCC::AL));
-      for (unsigned i = 0, e = Regs.size(); i < e; ++i)
-        MIB.addReg(Regs[i].first, getKillRegState(Regs[i].second));
+      for (const auto &[Reg, Kill] : Regs)
+        MIB.addReg(Reg, getKillRegState(Kill));
     } else if (Regs.size() == 1) {
       BuildMI(MBB, MI, DL, TII.get(StrOpc), ARM::SP)
           .addReg(Regs[0].first, getKillRegState(Regs[0].second))
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index d8fcf9d10d74c..5bce15eceafa7 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -2766,9 +2766,8 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
   // Build a sequence of copy-to-reg nodes chained together with token chain
   // and flag operands which copy the outgoing args into the appropriate regs.
   SDValue InGlue;
-  for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
-    Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first,
-                             RegsToPass[i].second, InGlue);
+  for (const auto &[Reg, N] : RegsToPass) {
+    Chain = DAG.getCopyToReg(Chain, dl, Reg, N, InGlue);
     InGlue = Chain.getValue(1);
   }
 
@@ -2952,9 +2951,8 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
 
   // Add argument registers to the end of the list so that they are known live
   // into the call.
-  for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
-    Ops.push_back(DAG.getRegister(RegsToPass[i].first,
-                                  RegsToPass[i].second.getValueType()));
+  for (const auto &[Reg, N] : RegsToPass)
+    Ops.push_back(DAG.getRegister(Reg, N.getValueType()));
 
   // Add a register mask operand representing the call-preserved registers.
   const uint32_t *Mask;
diff --git a/llvm/lib/Target/X86/X86ISelLoweringCall.cpp b/llvm/lib/Target/X86/X86ISelLoweringCall.cpp
index 1aa00d4f09f75..c34464d9e6fa8 100644
--- a/llvm/lib/Target/X86/X86ISelLoweringCall.cpp
+++ b/llvm/lib/Target/X86/X86ISelLoweringCall.cpp
@@ -1929,9 +1929,9 @@ SDValue X86TargetLowering::LowerFormalArguments(
   }
 
   if (CallingConv::PreserveNone == CallConv)
-    for (unsigned I = 0, E = Ins.size(); I != E; ++I) {
-      if (Ins[I].Flags.isSwiftSelf() || Ins[I].Flags.isSwiftAsync() ||
-          Ins[I].Flags.isSwiftError()) {
+    for (const ISD::InputArg &In : Ins) {
+      if (In.Flags.isSwiftSelf() || In.Flags.isSwiftAsync() ||
+          In.Flags.isSwiftError()) {
         errorUnsupported(DAG, dl,
                          "Swift attributes can't be used with preserve_none");
         break;
@@ -2421,9 +2421,8 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
   // Build a sequence of copy-to-reg nodes chained together with token chain
   // and glue operands which copy the outgoing args into registers.
   SDValue InGlue;
-  for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
-    Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first,
-                             RegsToPass[i].second, InGlue);
+  for (const auto &[Reg, N] : RegsToPass) {
+    Chain = DAG.getCopyToReg(Chain, dl, Reg, N, InGlue);
     InGlue = Chain.getValue(1);
   }
 
@@ -2462,9 +2461,8 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
 
   // Add argument registers to the end of the list so that they are known live
   // into the call.
-  for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
-    Ops.push_back(DAG.getRegister(RegsToPass[i].first,
-                                  RegsToPass[i].second.getValueType()));
+  for (const auto &[Reg, N] : RegsToPass)
+    Ops.push_back(DAG.getRegister(Reg, N.getValueType()));
 
   // Add a register mask operand representing the call-preserved registers.
   const uint32_t *Mask = [&]() {
@@ -2615,9 +2613,9 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
   }
 
   if (CallingConv::PreserveNone == CallConv)
-    for (unsigned I = 0, E = Outs.size(); I != E; ++I) {
-      if (Outs[I].Flags.isSwiftSelf() || Outs[I].Flags.isSwiftAsync() ||
-          Outs[I].Flags.isSwiftError()) {
+    for (const ISD::OutputArg &Out : Outs) {
+      if (Out.Flags.isSwiftSelf() || Out.Flags.isSwiftAsync() ||
+          Out.Flags.isSwiftError()) {
         errorUnsupported(DAG, dl,
                          "Swift attributes can't be used with preserve_none");
         break;

@kazutakahirata kazutakahirata merged commit 094a708 into llvm:main Jun 28, 2025
7 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250627_range_for_llvm_Target branch June 28, 2025 05:08
@qinkunbao
Copy link
Member

Hi, it looks like this PR broke the buildbot.

https://lab.llvm.org/buildbot/#/builders/24/builds/9943

@qinkunbao
Copy link
Member

Looks like to be UAF introduced a time long ago.

==> /usr/local/google/home/qinkun/scratch_dir/sanitizer_logs/report.llc.2462976 <==
=================================================================
==llc==2462976==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c19a3819d70 at pc 0x55ebaa9cf4dc bp 0x7fff213df830 sp 0x7fff213df828
READ of size 8 at 0x7c19a3819d70 thread T0
    #0 0x55ebaa9cf4db in (anonymous namespace)::ARMConstantIslands::runOnMachineFunction(llvm::MachineFunction&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:479:23
    #1 0x55ebae201af2 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:108:10
    #2 0x55ebaf15a9e2 in llvm::FPPassManager::runOnFunction(llvm::Function&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1401:27
    #3 0x55ebaf1713ee in llvm::FPPassManager::runOnModule(llvm::Module&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1447:16
    #4 0x55ebaf15c3ec in runOnModule /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1516:27
    #5 0x55ebaf15c3ec in llvm::legacy::PassManagerImpl::run(llvm::Module&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:534:44
    #6 0x55eba8c1ba1c in compileModule(char**, llvm::LLVMContext&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/tools/llc/llc.cpp:753:8
    #7 0x55eba8c1609f in main /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/tools/llc/llc.cpp:400:22
    #8 0x7fe9a4433ca7 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #9 0x7fe9a4433d64 in __libc_start_main csu/../csu/libc-start.c:360:3
    #10 0x55eba8b241a0 in _start (/usr/local/google/home/qinkun/scratch_dir/llvm_build_asan_ubsan/bin/llc+0xbc731a0)

0x7c19a3819d70 is located 16 bytes inside of 32-byte region [0x7c19a3819d60,0x7c19a3819d80)
freed by thread T0 here:
    #0 0x55eba8c0b3a2 in operator delete(void*, unsigned long) /usr/local/google/home/qinkun/scratch_dir/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:155:3
    #1 0x55ebaa9e3199 in __libcpp_operator_delete<(anonymous namespace)::ARMConstantIslands::ImmBranch *, unsigned long> /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__new/allocate.h:46:3
    #2 0x55ebaa9e3199 in __libcpp_deallocate<(anonymous namespace)::ARMConstantIslands::ImmBranch> /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__new/allocate.h:86:12
    #3 0x55ebaa9e3199 in deallocate /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__memory/allocator.h:120:7
    #4 0x55ebaa9e3199 in deallocate /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__memory/allocator_traits.h:289:9
    #5 0x55ebaa9e3199 in ~__split_buffer /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__split_buffer:342:5
    #6 0x55ebaa9e3199 in __emplace_back_slow_path<(anonymous namespace)::ARMConstantIslands::ImmBranch> /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__vector/vector.h:1134:1
    #7 0x55ebaa9e3199 in emplace_back<(anonymous namespace)::ARMConstantIslands::ImmBranch> /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__vector/vector.h:1150:13
    #8 0x55ebaa9e3199 in std::__1::vector<(anonymous namespace)::ARMConstantIslands::ImmBranch, std::__1::allocator<(anonymous namespace)::ARMConstantIslands::ImmBranch>>::push_back[abi:nn210000]((anonymous namespace)::ARMConstantIslands::ImmBranch&&) /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__vector/vector.h:457:90
    #9 0x55ebaa9c884a in fixupConditionalBr /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1809:15
    #10 0x55ebaa9c884a in fixupImmediateBr /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1694:10
    #11 0x55ebaa9c884a in (anonymous namespace)::ARMConstantIslands::runOnMachineFunction(llvm::MachineFunction&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:480:19
    #12 0x55ebae201af2 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:108:10
    #13 0x55ebaf15a9e2 in llvm::FPPassManager::runOnFunction(llvm::Function&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1401:27
    #14 0x55ebaf1713ee in llvm::FPPassManager::runOnModule(llvm::Module&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1447:16
    #15 0x55ebaf15c3ec in runOnModule /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1516:27
    #16 0x55ebaf15c3ec in llvm::legacy::PassManagerImpl::run(llvm::Module&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:534:44
    #17 0x55eba8c1ba1c in compileModule(char**, llvm::LLVMContext&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/tools/llc/llc.cpp:753:8
    #18 0x55eba8c1609f in main /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/tools/llc/llc.cpp:400:22
    #19 0x7fe9a4433ca7 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

previously allocated by thread T0 here:
    #0 0x55eba8c0a73d in operator new(unsigned long) /usr/local/google/home/qinkun/scratch_dir/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:86:3
    #1 0x55ebaa9e2f32 in __libcpp_operator_new<unsigned long> /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__new/allocate.h:37:10
    #2 0x55ebaa9e2f32 in __libcpp_allocate<(anonymous namespace)::ARMConstantIslands::ImmBranch> /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__new/allocate.h:64:28
    #3 0x55ebaa9e2f32 in allocate /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__memory/allocator.h:105:14
    #4 0x55ebaa9e2f32 in __allocate_at_least<std::__1::allocator<(anonymous namespace)::ARMConstantIslands::ImmBranch> > /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__memory/allocate_at_least.h:41:19
    #5 0x55ebaa9e2f32 in __split_buffer /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__split_buffer:330:25
    #6 0x55ebaa9e2f32 in __emplace_back_slow_path<(anonymous namespace)::ARMConstantIslands::ImmBranch> /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__vector/vector.h:1128:47
    #7 0x55ebaa9e2f32 in emplace_back<(anonymous namespace)::ARMConstantIslands::ImmBranch> /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__vector/vector.h:1150:13
    #8 0x55ebaa9e2f32 in std::__1::vector<(anonymous namespace)::ARMConstantIslands::ImmBranch, std::__1::allocator<(anonymous namespace)::ARMConstantIslands::ImmBranch>>::push_back[abi:nn210000]((anonymous namespace)::ARMConstantIslands::ImmBranch&&) /usr/local/google/home/qinkun/scratch_dir/libcxx_install_asan_ubsan/include/c++/v1/__vector/vector.h:457:90
    #9 0x55ebaa9c4dac in initializeFunctionInfo /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:823:21
    #10 0x55ebaa9c4dac in (anonymous namespace)::ARMConstantIslands::runOnMachineFunction(llvm::MachineFunction&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:446:3
    #11 0x55ebae201af2 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:108:10
    #12 0x55ebaf15a9e2 in llvm::FPPassManager::runOnFunction(llvm::Function&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1401:27
    #13 0x55ebaf1713ee in llvm::FPPassManager::runOnModule(llvm::Module&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1447:16
    #14 0x55ebaf15c3ec in runOnModule /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1516:27
    #15 0x55ebaf15c3ec in llvm::legacy::PassManagerImpl::run(llvm::Module&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:534:44
    #16 0x55eba8c1ba1c in compileModule(char**, llvm::LLVMContext&) /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/tools/llc/llc.cpp:753:8
    #17 0x55eba8c1609f in main /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/tools/llc/llc.cpp:400:22
    #18 0x7fe9a4433ca7 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

SUMMARY: AddressSanitizer: heap-use-after-free /usr/local/google/home/qinkun/scratch_dir/llvm-project/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:479:23 in (anonymous namespace)::ARMConstantIslands::runOnMachineFunction(llvm::MachineFunction&)
Shadow bytes around the buggy address:
  0x7c19a3819a80: fa fa 00 00 07 fa fa fa 00 00 07 fa fa fa 00 00
  0x7c19a3819b00: 00 fa fa fa 00 00 05 fa fa fa 00 00 06 fa fa fa
  0x7c19a3819b80: 00 00 06 fa fa fa 00 00 06 fa fa fa 00 00 05 fa
  0x7c19a3819c00: fa fa 00 00 05 fa fa fa 00 00 06 fa fa fa 00 00
  0x7c19a3819c80: 06 fa fa fa 00 00 00 03 fa fa fd fd fd fa fa fa
=>0x7c19a3819d00: fd fd fd fa fa fa 00 00 00 00 fa fa fd fd[fd]fd
  0x7c19a3819d80: fa fa 00 00 00 00 fa fa 00 00 00 fa fa fa fa fa
  0x7c19a3819e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7c19a3819e80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7c19a3819f00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7c19a3819f80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb

qinkunbao added a commit that referenced this pull request Jun 29, 2025
#146198 changes
```
    for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i)
      BRChange |= fixupImmediateBr(ImmBranches[i]);
```
to
```
    for (ImmBranch &Br : ImmBranches)
      BRChange |= fixupImmediateBr(Br);
```
Unfortunately, they are not NFC and cause the buildbot error. e.g.,
https://lab.llvm.org/buildbot/#/builders/24/builds/9943
https://lab.llvm.org/buildbot/#/builders/169/builds/12570
Use make_early_inc_range to fix the issue
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jun 29, 2025
llvm/llvm-project#146198 changes
```
    for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i)
      BRChange |= fixupImmediateBr(ImmBranches[i]);
```
to
```
    for (ImmBranch &Br : ImmBranches)
      BRChange |= fixupImmediateBr(Br);
```
Unfortunately, they are not NFC and cause the buildbot error. e.g.,
https://lab.llvm.org/buildbot/#/builders/24/builds/9943
https://lab.llvm.org/buildbot/#/builders/169/builds/12570
Use make_early_inc_range to fix the issue
qinkunbao added a commit that referenced this pull request Jun 29, 2025
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jun 29, 2025
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
llvm#146198 changes
```
    for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i)
      BRChange |= fixupImmediateBr(ImmBranches[i]);
```
to
```
    for (ImmBranch &Br : ImmBranches)
      BRChange |= fixupImmediateBr(Br);
```
Unfortunately, they are not NFC and cause the buildbot error. e.g.,
https://lab.llvm.org/buildbot/#/builders/24/builds/9943
https://lab.llvm.org/buildbot/#/builders/169/builds/12570
Use make_early_inc_range to fix the issue
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
llvm#146198 changes
```
    for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i)
      BRChange |= fixupImmediateBr(ImmBranches[i]);
```
to
```
    for (ImmBranch &Br : ImmBranches)
      BRChange |= fixupImmediateBr(Br);
```
Unfortunately, they are not NFC and cause the buildbot error. e.g.,
https://lab.llvm.org/buildbot/#/builders/24/builds/9943
https://lab.llvm.org/buildbot/#/builders/169/builds/12570
Use make_early_inc_range to fix the issue
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants