aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorLucas Prates <lucas.prates@arm.com>2022-01-10 10:19:27 +0000
committerLucas Prates <lucas.prates@arm.com>2022-01-20 17:02:52 +0000
commit283f5a198a0e3c9978ca426e64a3011b566c2581 (patch)
treefcd22270a500f59d02aa2821becf8f7f2320f990 /clang/lib/CodeGen/CodeGenFunction.cpp
parentfabf1de13202030151899786c21d624b96605ca3 (diff)
downloadllvm-283f5a198a0e3c9978ca426e64a3011b566c2581.zip
llvm-283f5a198a0e3c9978ca426e64a3011b566c2581.tar.gz
llvm-283f5a198a0e3c9978ca426e64a3011b566c2581.tar.bz2
[GlobalISel] Fix incorrect sign extension when combining G_INTTOPTR and G_PTR_ADD
The GlobalISel combiner currently uses sign extension when manipulating the LHS constant when combining a sequence of the following sequence of machine instructions into a single constant: ``` %0:_(s32) = G_CONSTANT i32 <CONSTANT> %1:_(p0) = G_INTTOPTR %0:_(s32) %2:_(s64) = G_CONSTANT i64 <CONSTANT> %3:_(p0) = G_PTR_ADD %1:_, %2:_(s64) ``` This causes an issue when the bit width of the first contant and the target pointer size are different, as G_INTTOPTR has no sign extension semantics. This patch fixes this by capture an arbitrary precision in when matching the constant, allowing the matching function to correctly zero extend it. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D116941
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions