File tree Expand file tree Collapse file tree 2 files changed +35
-12
lines changed
AdaptorOCL/preprocess_spvir
Compiler/tests/PromoteBools Expand file tree Collapse file tree 2 files changed +35
-12
lines changed Original file line number Diff line number Diff line change @@ -520,19 +520,15 @@ Value* PromoteBools::getOrCreatePromotedValue(Value* value)
520520 if (newValue != value)
521521 {
522522 promotedValuesCache[value] = newValue;
523- if (value->getType () == newValue->getType ())
524- {
525- value->replaceAllUsesWith (newValue);
526- }
527- else
528- {
529- for (const auto & user : value->users ())
530- {
531- if (!wasPromoted (user))
532- {
533- promotionQueue.push (user);
534- }
523+ auto ty = value->getType ();
524+ if (!IGCLLVM::isOpaquePointerTy (ty) && ty == newValue->getType ()) {
525+ value->replaceAllUsesWith (newValue);
526+ } else {
527+ for (const auto &user : value->users ()) {
528+ if (!wasPromoted (user)) {
529+ promotionQueue.push (user);
535530 }
531+ }
536532 }
537533 }
538534 return newValue;
Original file line number Diff line number Diff line change 1+ ;=========================== begin_copyright_notice ============================
2+ ;
3+ ; Copyright (C) 2025 Intel Corporation
4+ ;
5+ ; SPDX-License-Identifier: MIT
6+ ;
7+ ;============================ end_copyright_notice =============================
8+
9+ ; RUN: igc_opt --typed-pointers -igc-promote-bools -S %s | FileCheck %s
10+ ; RUN: igc_opt --opaque-pointers -igc-promote-bools -S %s | FileCheck %s
11+
12+ target triple = "spir64-unknown-unknown"
13+
14+ ; CHECK-LABEL: define spir_func float @readSrcPixelSingle() {
15+ ; CHECK-NEXT: call spir_func zeroext i8 @isBorder()
16+
17+ ; CHECK-LABEL: define spir_func zeroext i8 @isBorder() {
18+ ; CHECK-NEXT: ret i8 0
19+
20+ define spir_func zeroext i1 @isBorder () {
21+ ret i1 false
22+ }
23+
24+ define spir_func float @readSrcPixelSingle () {
25+ %call = call spir_func zeroext i1 @isBorder ()
26+ ret float 0 .000000e+00
27+ }
You can’t perform that action at this time.
0 commit comments