[PATCH] D146622: [AggressiveInstCombine] folding load for constant global patterened arrays and structs by GEP indices

Kohei Asano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 20:46:31 PDT 2023


khei4 added a comment.

WIP notes: 
This is clearly div by 0 error. Some handling is needed for i128, the following test cases only crashes the last one.

  @g128 = internal constant i128 42
  @g64 = internal constant i64 42
  define i128 @no-gep-128-as128(i64 %idx){
   %1 = load i128, ptr @g128, align 4
    ret i128 %1
  }
  define i128 @no-gep-64-as128(i64 %idx){
   %1 = load i128, ptr @g64, align 4
    ret i128 %1
  }
  define i32 @no-gep-64-as32(i64 %idx){
   %1 = load i32, ptr @g64, align 4
    ret i32 %1
  }
  define i32 @no-gep-128-as32-crash(i64 %idx){
   %1 = load i32, ptr @g128, align 4
    ret i32 %1
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146622/new/

https://reviews.llvm.org/D146622



More information about the llvm-commits mailing list