summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorJun Bum Lim <junbuml@codeaurora.org>2017-01-27 17:16:37 +0000
committerJun Bum Lim <junbuml@codeaurora.org>2017-01-27 17:16:37 +0000
commitb99a06b7c9f4f6559da9fefeb1011c8aefe3f34c (patch)
treef4d23b358c90ca976ab61e58859fbcc0b1e1d1c6 /llvm/test
parent091f1b6ef314d4e0e37eaf438c63c307253e8b42 (diff)
downloadbcm5719-llvm-b99a06b7c9f4f6559da9fefeb1011c8aefe3f34c.tar.gz
bcm5719-llvm-b99a06b7c9f4f6559da9fefeb1011c8aefe3f34c.zip
[CodeGenPrep]No negative cost in the ExtLd promotion
Summary: This change prevent the signed value of cost from being negative as the value is passed as an unsigned argument. Reviewers: mcrosier, jmolloy, qcolombet, javed.absar Reviewed By: mcrosier, qcolombet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28871 llvm-svn: 293307
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/AArch64/arm64-codegen-prepare-extload.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/arm64-codegen-prepare-extload.ll b/llvm/test/CodeGen/AArch64/arm64-codegen-prepare-extload.ll
index c9f668f2c42..3d9c86139ed 100644
--- a/llvm/test/CodeGen/AArch64/arm64-codegen-prepare-extload.ll
+++ b/llvm/test/CodeGen/AArch64/arm64-codegen-prepare-extload.ll
@@ -636,3 +636,24 @@ define i64 @doNotPromoteBecauseOfPairedLoad(i32* %p, i32 %cst) {
%final = add i64 %sextres, %zextLd0
ret i64 %final
}
+
+define i64 @promoteZextShl(i1 %c, i16* %P) {
+entry:
+; OPTALL-LABEL: promoteZextShl
+; OPTALL-LABEL: entry:
+; OPT: %[[LD:.*]] = load i16, i16* %P
+; OPT: %[[EXT:.*]] = zext i16 %[[LD]] to i64
+; OPT-LABEL: if.then:
+; OPT: shl nsw i64 %[[EXT]], 1
+; DISABLE-LABEL: if.then:
+; DISABLE: %r = sext i32 %shl2 to i64
+ %ld = load i16, i16* %P
+ br i1 %c, label %end, label %if.then
+if.then:
+ %z = zext i16 %ld to i32
+ %shl2 = shl nsw i32 %z, 1
+ %r = sext i32 %shl2 to i64
+ ret i64 %r
+end:
+ ret i64 0
+}
OpenPOWER on IntegriCloud