Compare commits

...

1 commit

Author SHA1 Message Date
Harrison Hao
f9a6d13fdf [InstCombine] Don't change the type of elementwise atomic loads 2026-08-01 14:40:26 +08:00
2 changed files with 14 additions and 0 deletions

View file

@ -684,6 +684,9 @@ static Instruction *combineLoadToOperationType(InstCombinerImpl &IC,
if (!Load.isUnordered())
return nullptr;
if (Load.isElementwise())
return nullptr;
if (Load.use_empty())
return nullptr;

View file

@ -452,4 +452,15 @@ define void @volatile_load_from_constant_global() {
ret void
}
define i64 @load_elementwise_bitcast(ptr %p) {
; CHECK-LABEL: @load_elementwise_bitcast(
; CHECK-NEXT: [[V:%.*]] = load atomic elementwise <2 x i32>, ptr [[P:%.*]] unordered, align 8
; CHECK-NEXT: [[R:%.*]] = bitcast <2 x i32> [[V]] to i64
; CHECK-NEXT: ret i64 [[R]]
;
%v = load atomic elementwise <2 x i32>, ptr %p unordered, align 8
%r = bitcast <2 x i32> %v to i64
ret i64 %r
}
attributes #0 = { null_pointer_is_valid }