aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-07-22 16:22:01 +0200
committerGitHub <noreply@github.com>2024-07-22 16:22:01 +0200
commit32cd18975d2e1de5a783e9b1c3c21a234d5723b4 (patch)
treef0b404e096878ff28fbc951b20ffe8ed79f4134d /clang/lib/CodeGen/CodeGenModule.cpp
parent091ec15bbebf5be42d10f05a393489732ce651e4 (diff)
downloadllvm-32cd18975d2e1de5a783e9b1c3c21a234d5723b4.zip
llvm-32cd18975d2e1de5a783e9b1c3c21a234d5723b4.tar.gz
llvm-32cd18975d2e1de5a783e9b1c3c21a234d5723b4.tar.bz2
[GVN] Look through select/phi when determining underlying object (#99509)
This addresses an optimization regression in Rust we have observed after https://github.com/llvm/llvm-project/pull/82458. We now only perform pointer replacement if they have the same underlying object. However, getUnderlyingObject() by default only looks through linear chains, not selects/phis. In particular, this means that we miss cases involving involving pointer induction variables. This patch fixes this by introducing a new helper getUnderlyingObjectAggressive() which basically does what getUnderlyingObjects() does, just specialized to the case where we must arrive at a single underlying object in the end, and with a limit on the number of inspected values. Doing this more expensive underlying object check has no measurable compile-time impact on CTMark.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions