[llvm-branch-commits] [llvm-branch] r309586 - Merging r309323:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jul 31 10:17:43 PDT 2017
Author: hans
Date: Mon Jul 31 10:17:43 2017
New Revision: 309586
URL: http://llvm.org/viewvc/llvm-project?rev=309586&view=rev
Log:
Merging r309323:
------------------------------------------------------------------------
r309323 | ab | 2017-07-27 14:27:25 -0700 (Thu, 27 Jul 2017) | 12 lines
[AArch64] Fix legality info passed to demanded bits for TBI opt.
The (seldom-used) TBI-aware optimization had a typo lying dormant since
it was first introduced, in r252573: when asking for demanded bits, it
told TLI that it was running after legalize, where the opposite was
true.
This is an important piece of information, that the demanded bits
analysis uses to make assumptions about the node. r301019 added such an
assumption, which was broken by the TBI combine.
Instead, pass the correct flags to TLO.
------------------------------------------------------------------------
Modified:
llvm/branches/release_50/ (props changed)
llvm/branches/release_50/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/branches/release_50/test/CodeGen/AArch64/tbi.ll
Propchange: llvm/branches/release_50/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jul 31 10:17:43 2017
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,308483-308484,308503,308808,308813,308891,308906,308950,308963,308978,308986,309113,309302,309343,309353,309355,309422
+/llvm/trunk:155241,308483-308484,308503,308808,308813,308891,308906,308950,308963,308978,308986,309113,309302,309323,309343,309353,309355,309422
Modified: llvm/branches/release_50/lib/Target/AArch64/AArch64ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_50/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=309586&r1=309585&r2=309586&view=diff
==============================================================================
--- llvm/branches/release_50/lib/Target/AArch64/AArch64ISelLowering.cpp (original)
+++ llvm/branches/release_50/lib/Target/AArch64/AArch64ISelLowering.cpp Mon Jul 31 10:17:43 2017
@@ -9586,8 +9586,8 @@ static bool performTBISimplification(SDV
SelectionDAG &DAG) {
APInt DemandedMask = APInt::getLowBitsSet(64, 56);
KnownBits Known;
- TargetLowering::TargetLoweringOpt TLO(DAG, DCI.isBeforeLegalize(),
- DCI.isBeforeLegalizeOps());
+ TargetLowering::TargetLoweringOpt TLO(DAG, !DCI.isBeforeLegalize(),
+ !DCI.isBeforeLegalizeOps());
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
if (TLI.SimplifyDemandedBits(Addr, DemandedMask, Known, TLO)) {
DCI.CommitTargetLoweringOpt(TLO);
Modified: llvm/branches/release_50/test/CodeGen/AArch64/tbi.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_50/test/CodeGen/AArch64/tbi.ll?rev=309586&r1=309585&r2=309586&view=diff
==============================================================================
--- llvm/branches/release_50/test/CodeGen/AArch64/tbi.ll (original)
+++ llvm/branches/release_50/test/CodeGen/AArch64/tbi.ll Mon Jul 31 10:17:43 2017
@@ -100,3 +100,14 @@ define i32 @ld_and32_narrower(i64 %p) {
%load = load i32, i32* %cast
ret i32 %load
}
+
+; BOTH-LABEL:ld_and8:
+; BOTH: and x
+define i32 @ld_and8(i64 %base, i8 %off) {
+ %off_masked = and i8 %off, 63
+ %off_64 = zext i8 %off_masked to i64
+ %p = add i64 %base, %off_64
+ %cast = inttoptr i64 %p to i32*
+ %load = load i32, i32* %cast
+ ret i32 %load
+}
More information about the llvm-branch-commits
mailing list