Skip to content

Commit be8eb93

Browse files
authored
Fix C++ integration test (rust-lang#450)
1 parent 5565c68 commit be8eb93

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,8 @@ void TypeAnalyzer::visitGetElementPtrInst(GetElementPtrInst &gep) {
13361336
// is valid. We could make it always valid by checking the pointer
13371337
// operand explicitly is a pointer.
13381338
if (direction & UP) {
1339-
if (gep.isInBounds() || (pointerAnalysis.Inner0() == BaseType::Pointer &&
1339+
if (gep.isInBounds() || (!EnzymeStrictAliasing &&
1340+
pointerAnalysis.Inner0() == BaseType::Pointer &&
13401341
getAnalysis(&gep).Inner0() == BaseType::Pointer)) {
13411342
for (auto &ind : gep.indices()) {
13421343
updateAnalysis(ind, TypeTree(BaseType::Integer).Only(-1), &gep);

enzyme/test/TypeAnalysis/gepint.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: %opt < %s %loadEnzyme -print-type-analysis -type-analysis-func=callee -o /dev/null | FileCheck %s
1+
; RUN: %opt < %s %loadEnzyme -print-type-analysis -enzyme-strict-aliasing=0 -type-analysis-func=callee -o /dev/null | FileCheck %s
22

33
declare i64 @val()
44

0 commit comments

Comments
 (0)